Plugin Directory

Changeset 2092139


Ignore:
Timestamp:
05/21/2019 09:16:22 AM (7 years ago)
Author:
diddledan
Message:

Version 2.3.0

Location:
a-z-listing
Files:
47 added
10 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • a-z-listing/trunk/.svnignore

    r1939419 r2092139  
    11._.*
    22.DS_Store
     3.editorconfig
    34.eslint*
    45.git
    56.gitignore
    67.idea
     8.jshintrc
    79.travis.yml
    810.vs
     11.vscode
     12*.msbuildproj
    913*.phar
    1014*.sql
     
    1418assets/
    1519bin/
     20obj/
    1621node_modules/
    1722vendor/
     23tests/
    1824Dockunit.json
    19 phpcs.xml
    20 phpunit.xml
     25docker-compose.yml
     26Gruntfile.js
     27phpcs.xml*
     28phpunit.xml*
    2129Thumbs.db
    2230wp-cli.local.yml
    23 
     31package*.json
     32composer.*
  • a-z-listing/trunk/README.md

    r2056348 r2092139  
    66**Requires at least:** 4.6 
    77**Requires PHP:** 5.6 
    8 **Tested up to:** 5.1 
    9 **Stable tag:** 2.2.0 
     8**Tested up to:** 5.2 
     9**Stable tag:** 2.3.0 
    1010**License:** GPLv2 or later 
    1111**License URI:** http://www.gnu.org/licenses/gpl-2.0.html 
     
    2020Show your posts, pages, and terms alphabetically in a Rolodex-, catalogue-, or directory-style list with the A-Z Listing plugin!
    2121
    22 The plugin has a shortcode for the list, and a widget so you can link to the list from anywhere on your site. If a letter doesn't have any pages then the widget will display the letter unlinked. The list page will omit the display for that letter entirely.
     22The plugin has a short-code for the list, and a widget so you can link to the list from anywhere on your site. If a letter doesn't have any pages then the widget will display the letter unlinked. The list page will omit the display for that letter entirely.
    2323
    2424Show posts from any or multiple post types including the in-built posts and pages. Also supported are post-types from plugins like WooCommerce products. Alternatively, show terms like categories or tags.
     
    3535### Instructions ###
    3636
    37 1. Upload the `a-z-listing` folder to the `/wp-content/plugins/` directory
    38 1. Activate the plugin through the 'Plugins' menu in WordPress
    39 1. Place `<?php the_a_z_listing(); ?>` in your templates for the index page output (see the **php** section of this document for details) or use the `a-z-listing` shortcode (see the **shortcode** section of this document for details).
    40 1. Add the A-Z Site Map widget to a sidebar or use `<?php the_a_z_widget( null, array( 'post' => get_page( $id ) ) ); ?>` in your templates (see the **php** section of this document for details).
    41 
    42 ## Shortcode ##
    43 
    44 The plugin supplies a shortcode for the full A-Z listing allowing use without modifying your theme's templates.
     371. Upload the a-z-listing folder to the `/wp-content/plugins/` directory.
     381. Activate the plugin through the 'Plugins' menu in WordPress.
     391. Use the `[a-z-listing]` short-code on the page or post that you want to show the listing.
     401. Add the A-Z Site Map widget to a sidebar.
     41
     42## short-code ##
     43
     44The plugin supplies a short-code for the full A-Z listing allowing use without modifying your theme's templates.
    4545
    4646Basic usage is as follows:
     
    4848    [a-z-listing]
    4949
    50 To specify a post-type to display instead of `page` then use, e.g. `Posts`:
    51 
    52     [a-z-listing post-type="post"]
     50To specify a post-type to display instead of `page` then use, e.g. `post`:
     51
     52    [a-z-listing display="posts" post-type="post"]
    5353
    5454To filter the posts by a term from a taxonomy:
    5555
    56     [a-z-listing taxonomy="category" terms="my-term-slug"]
     56    [a-z-listing display="posts" taxonomy="category" terms="my-term-slug"]
     57
     58To display pages that are direct children of the page with ID `24`:
     59
     60    [a-z-listing display="posts" post-type="page" parent-post="24"]
     61
     62To display pages that are children of any depth below the page with ID `24`:
     63
     64    [a-z-listing display="posts" post-type="page" parent-post="24" get-all-children="yes"]
    5765
    5866To show terms from a taxonomy instead of posts and pages, e.g. Terms from the `Categories` taxonomy:
    5967
    60     [a-z-listing taxonomy="category" display="terms"]
     68    [a-z-listing display="terms" taxonomy="category"]
     69
     70To show terms from the `Categories` taxonomy that are direct children of the term with ID of `42`:
     71
     72    [a-z-listing display="terms" taxonomy="category" parent-term="42"]
     73
     74To show terms from the `Categories` taxonomy that are children of any depth in the tree below the term with ID of `42`:
     75
     76    [a-z-listing display="terms" taxonomy="category" parent-term="42" get-all-children="yes"]
    6177
    6278To override the alphabet used by the plugin:
    6379
    64     [a-z-listing alphabet="Aa,Bb,Cc,Dd,Ee,Ff,Gg,Hh,Ii,Jj,Kk,Ll,Mm,Nn,Oo,Pp,Qq,Rr,Ss,Tt,Uu,Vv,Ww,Xx,Yy,Zz"]
     80    [a-z-listing display="posts" alphabet="Aa,Bb,Cc,Dd,Ee,Ff,Gg,Hh,Ii,Jj,Kk,Ll,Mm,Nn,Oo,Pp,Qq,Rr,Ss,Tt,Uu,Vv,Ww,Xx,Yy,Zz"]
    6581
    6682To add numbers to the listing:
    6783
    68     [a-z-listing numbers="after"]
     84    [a-z-listing display="posts" numbers="after"]
    6985
    7086The numbers can also be shown before the alphabet:
    7187
    72     [a-z-listing numbers="before"]
     88    [a-z-listing display="posts" numbers="before"]
    7389
    7490You can group the numbers into a single collection for all posts beginning with a numeral:
    7591
    76     [a-z-listing numbers="after" grouping="numbers"]
     92    [a-z-listing numbers="after" group-numbers="yes"]
    7793
    7894To group the alphabet letters into a range:
     
    8298** The arguments are all optional **
    8399
    84 * `display`: specifies whether to display posts or terms from a taxonomy
    85   * Default value: `posts`
    86   * May be set to either `posts` or `terms`
    87   * Any value other than unset, `posts` or `terms` will default to displaying posts
    88 * `post-type`: sets the listing to show a specific post-type
    89   * Default value: `page`
    90   * You may specify multiple post-types by separating with commas (`,`) e.g. `post-type="page,post"`
    91 * `exclude-posts`: remove specific posts from the list
    92   * Default value: unset
    93   * Uses the `ID` of the post(s)
    94   * Multiple posts may be specified by separating by commas: `,`
    95   * Only affects `display="posts"`
    96 * `taxonomy`: does nothing by itself, see the combinations below
    97   * Default value: unset
    98   * Uses the `slug` of the taxonomy
    99   * When combined with:
    100     * `terms=""`, will filter your posts by the terms you set there, which appear in the taxonomy set here
    101     * `display="terms"`, will switch from displaying post titles to displaying the names of terms from the taxonomy specified
    102 * `terms`: sets the taxonomy terms for filtering posts
    103   * Default value: unset
    104   * The taxonomy must also be specified in `taxonomy`
    105   * Uses the `slug` of the term(s) when `display="posts"` and the `ID` of the term(s) when `display="terms"`
    106   * Multiple terms may be specified by separating with commas: `,`
    107   * May not be used with `exclude-terms=""`
    108 * `exclude-terms`: sets the terms to exclude from display
    109   * Default value: unset
    110   * The taxonomy must also be specified in `taxonomy`
    111   * Uses the `ID` of the term(s)
    112   * Multiple terms may be specified by separating with commas: `,`
    113   * May not be used with `terms=""`
    114   * Only affects `display="terms"`
    115 * `parent-term`: set the parent that all displayed terms must be organised under
    116   * Default value: unset
    117   * Uses the `slug` of the parent term
    118   * Single value only
    119   * Only affects `display="terms"`
    120 * `hide-empty-terms`: hide terms that have no posts associated
    121   * Default value: `false`
    122   * May be set to `true` or `1` to hide the empty terms
    123   * Only affects `display="terms"`
    124 * `numbers`: appends or prepends numerals to the alphabet
    125   * Default value: unset
    126   * May be set to either `before` or `after`
    127   * Any value other than unset, `before` or `after` will default to **appending** numerals to the alphabet
    128 * `grouping`: tells the plugin if and how to group the alphabet
    129   * Default value: unset
    130   * May be set to any positive number greater than `1` or the value `numbers`
    131   * Any value other than a positive number or the value `numbers` will default to disabling all grouping functionality
    132   * When set to a number higher than `1` the listing will group letters together into ranges
    133     * For example, if you chose `3` then a latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on
    134     * When using this setting, if numbers are also shown via the `numbers="before"` or `numbers="after"` attribute then they will be shown as a single separate group `0-9`
    135   * When set to the value `numbers` it will group numerals into a single group `0-9`
    136     * This requires the numbers to be displayed via the `numbers="before"` or `numbers="after"` attributes
    137 * `alphabet`: allows you to override the alphabet that the plugin uses
    138   * Default value: unset
    139   * When this attribute is unset, the plugin will either use the untranslated default, or if [glotpress](https://translate.wordpress.org/projects/wp-plugins/a-z-listing) includes a translation for your site's language as set in `Admin -> Settings -> Site Language` it will use that translation
    140   * The current untranslated default is: `AÁÀÄÂaáàäâ,Bb,Cc,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz`
    141   * Accepts a single line of letters/symbols, which need to be separated via the comma character `,`
    142   * Including more than one letter/symbol in each group will display posts starting with any of those under the same section
    143   * The first letter/symbol in each group is used as the group's heading when displayed on your site
     100### Common options ###
     101
     102* `display`: specifies whether to display posts or terms from a taxonomy.
     103  * Default value: `posts`.
     104  * May only contain one value.
     105  * Must be set to either `posts` or `terms`.
     106  * Any value other than `posts` or `terms` will default to displaying posts.
     107* `numbers`: appends or prepends numerals to the alphabet.
     108  * Default value: `unset`.
     109  * May only contain one value.
     110  * Must be set to either `before` or `after`.
     111  * Any value other than `before` or `after` will default to **appending** numerals to the alphabet.
     112* `grouping`: tells the plugin if and how to group the alphabet.
     113  * Default value: `unset`.
     114  * May only contain one value.
     115  * Must be set to any positive number greater than `1` or the value `numbers`.
     116  * Any value other than a positive number or the value `numbers` will default to disabling all grouping functionality.
     117  * When set to a number higher than `1` the listing will group letters together into ranges.
     118    * For example, if you chose `3` then a Latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on.
     119    * When using this setting, if numbers are also shown via the `numbers="before"` or `numbers="after"` attribute then they will be shown as a single separate group `0-9`.
     120  * When set to the value `numbers` it will group numerals into a single group `0-9`.
     121    * This requires the numbers to be displayed via the `numbers="before"` or `numbers="after"` attributes.
     122* `group-numbers`: tells the plugin to group all items beginning with a numeral into a single collection.
     123  * Default value: `false`.
     124  * May only contain one value.
     125  * Must be set to `true`, `yes`, `on`, or `1` to group items beginning with a numeral in a single collection. All other values will keep the default behaviour.
     126* `alphabet`: allows you to override the alphabet that the plugin uses.
     127  * Default value: `unset`.
     128  * When this attribute is not defined, the plugin will either use the untranslated default, or if [glotpress](https://translate.wordpress.org/projects/wp-plugins/a-z-listing) includes a translation for your site's language as set in `Admin -> Settings -> Site Language` it will use that translation.
     129  * The current untranslated default is: `AÁÀÄÂaáàäâ,Bb,Cc,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz`.
     130  * Accepts a single line of letters/symbols, which need to be separated via the comma character `,`.
     131  * Including more than one letter/symbol in each group will display posts starting with any of those under the same section.
     132  * The first letter/symbol in each group is used as the group's heading when displayed on your site.
     133
     134### Posts options ###
     135
     136* `post-type`: sets the listing to show a specific post-type.
     137  * Default value: `page`.
     138  * Multiple post-types may be specified by separating with commas (`,`) e.g. `post-type="page,post"`.
     139  * Must be the `slug` of the post-type(s).
     140* `parent-post`: sets the parent post that all displayed posts must be descended from.
     141  * Default value: `unset`.
     142  * May only contain one value.
     143  * Must be the `ID` of the parent post.
     144  * Add `get-all-children="yes"` to also include all descendants of any depth below the parent post.
     145* `exclude-posts`: remove these posts from the list.
     146  * Default value: `unset`.
     147  * Multiple posts may be specified by separating by commas: `,`.
     148  * Must be the `ID` of the post(s).
     149* `taxonomy`: sets the taxonomy containing the terms specified in the `terms=""` option.
     150  * Default value: `unset`.
     151  * May only contain one value.
     152  * Must be the `slug` of the taxonomy.
     153* `terms`: sets the taxonomy terms for filtering posts.
     154  * Default value: `unset`.
     155  * The taxonomy must also be specified in `taxonomy`.
     156  * Multiple terms may be specified by separating with commas: `,`.
     157  * Must be the `slug` of the term(s).
     158
     159### Terms options ###
     160
     161* `taxonomy`: sets the taxonomy to display terms from in the listing.
     162  * Default value: `unset`.
     163  * Multiple taxonomies may be specified by separating with commas: `,`.
     164  * Must be the `slug` of the taxonomy.
     165* `terms`: sets the taxonomy terms to include in the listing.
     166  * Default value: `unset`.
     167  * The taxonomy must also be specified in `taxonomy`.
     168  * Multiple terms may be specified by separating with commas: `,`.
     169  * Must be the `ID` of the term(s).
     170  * Cannot be used with `exclude-terms=""`.
     171* `exclude-terms`: sets the terms to exclude from display.
     172  * Default value: `unset`.
     173  * The taxonomy must also be specified in `taxonomy`.
     174  * Multiple terms may be specified by separating with commas: `,`.
     175  * Must be the `ID` of the term(s).
     176  * Cannot be used with `terms=""`.
     177* `parent-term`: set the parent that all displayed terms must be descended from.
     178  * Default value: `unset`.
     179  * May only contain one value.
     180  * Must be the `slug` of the parent term.
     181  * Add `get-all-children="yes"` to also include all descendants of any depth below the parent term.
     182* `get-all-children`: when a parent term is chosen this option is used to show all children of any depth or only direct children.
     183  * Default value: `false`.
     184  * May only contain one value.
     185  * Must be set to `true`, `yes`, `on`, or `1` to include all children of any depth. Any value other will use the default behaviour of only showing direct children.
     186* `hide-empty-terms`: hide terms that have no posts associated.
     187  * Default value: `false`.
     188  * May only contain one value.
     189  * Must be set to `true`, `yes`, `on`, or `1` to hide the empty terms. Any other value will use the default behaviour of showing all terms.
     190
     191### Internal-use options for completeness ###
     192
     193** You should not need to touch these, as they are meant for internal use by the plugin only**
     194
     195* `target`: the default target for a listing that doesn't show any items.
     196  * Default value: `unset`.
     197  * May only contain one value.
     198  * Must be set to a URL which will be used as the target for the letters' hyperlinks.
     199* `return`: what type of listing to show, either `listing` or `letters`.
     200  * Default value: `listing`.
     201  * May only contain one value.
     202  * Must be set to either `listing` to display the default view, or `letters` to show only the letters without any items (posts or terms).
    144203
    145204## PHP ##
     
    165224Full API documentation is available at [A-Z-Listing Reference](https://a-z-listing.com/reference/)
    166225
    167 ## Multi Column Output ##
    168 
    169 If you want the multi-column output support, you need to copy the file `a-z-listing-multi-column.example.php` from the plugin inside the `templates` directory to your theme. The file needs to also be renamed to `a-z-listing.php` when copied to your theme. The **Templates and Theming** section of this Document details the functions used within templates and The Loop process this plugin follows.
     226## Multiple Column Output ##
     227
     228Multiple column layout is the default on wide screens. A letter's group of items must contain at least 15 items to create two or more columns. This is to provide a more aesthetically pleasing view when a list is short with only a few items.
    170229
    171230## Templates and Theming ##
     
    185244* `$a_z_query->the_letters()` prints the full alphabet, and links the letters that have posts to their section within the index page.
    186245* `$a_z_query->have_letters()` returns true or false depending on whether there are any letters left to loop-through. This is part of the Letter Loop.
    187 * `$a_z_query->have_items()` this behaves very similarly to Core's `have_posts()` function. It is part of the Item Loop.
     246* `$a_z_query->have_items()` behaves very similarly to Core's `have_posts()` function. It is part of the Item Loop.
    188247* `$a_z_query->the_letter()` similar to Core's `the_post()`, this will set-up the next iteration of the A-Z Listing's Letter Loop. This needs to wrap-around the Item Loop.
    189248* `$a_z_query->the_item()` similar to Core's `the_post()`, this will set-up the next iteration of the A-Z Listing's Item Loop, the same way the normal WordPress Loop works. This needs to be _within_ the Letter Loop.
     
    191250When you are within the Item Loop you may utilise all in-built WordPress Core post-related functions such as `the_content()`. Note that titles and permalinks have helper functions to cope with the A-Z Listing showing taxonomy terms (see the next section).
    192251
    193 I advise that you start with a copy of the default template or the multi-column template when customizing your own version. The supplied templates show the usage of most of the functions this plugin provides.
     252I advise that you start with a copy of the default template template when customizing your own version. The supplied templates show the usage of most of the functions this plugin provides.
    194253
    195254### Helper functions ###
     
    210269### Why is the list layout completely broken? ###
    211270
    212 If you are using a page-builder such as WPBakery or Elementor you need to ensure that you put the shortcode into a normal text area. Placing the shortcode into a preformatted text area will add `<pre>` tags around the listing output. These extra tags break the layout considerably.
     271If you are using a page-builder such as WPBakery or Elementor you need to ensure that you put the short-code into a normal text area. Placing the short-code into a preformatted text area will add `<pre>` tags around the listing output. These extra tags break the layout considerably.
    213272
    214273### Why is my list in a single column? ###
    215274
    216 The list of items under each letter heading needs to have at least 11 items for a second column to be created. Once you hit the magic 11 items, the list will break into two columns with 6 items in the first column and 5 items in the second. When you get to 21 items a third column will be added if there is room on your page; and so-on up to a maximum of 15 columns if there is enough space, though it is unexpected that any webpage be wide enough for more than a few columns to fit. The columns will fill-up evenly once you have more than one column on the page.
    217 
    218 ### How do I show posts of a different post-type (not pages) or multiple post-types (e.g. posts AND pages) ###
    219 
    220 This can be achieved using the shortcode or PHP. In these examples the generic phrase `post-type-slug` is used to describe the concept. The default post types provided by WordPress are called "Posts" and "Pages". Their slugs are `post` and `page` respectively. You need to use these names in place of the examples (i.e. `your-post-type-slug`, `type1-slug`, and `type1-slug`).
    221 
    222 #### Shortcode method ####
     275The list of items under each letter heading needs to have at least 11 items for a second column to be created. Once you hit the magic 11 items, the list will break into two columns with 6 items in the first column and 5 items in the second. When you get to 21 items a third column will be added if there is room on your page; and so-on up to a maximum of 15 columns if there is enough space, though it is unexpected that any web-page be wide enough for more than a few columns to fit. The columns will fill-up evenly once you have more than one column on the page.
     276
     277### How do I show posts of a different post-type (not pages) or multiple post-types (e.g. posts AND pages)? ###
     278
     279This can be achieved using the short-code or PHP. In these examples the generic phrase `post-type-slug` is used to describe the concept. The default post types provided by WordPress are called "Posts" and "Pages". Their slugs are `post` and `page` respectively. You need to use these names in place of the examples (i.e. `your-post-type-slug`, `type1-slug`, and `type1-slug`).
     280
     281#### short-code method ####
    223282
    224283##### Single post-type #####
     
    234293#### PHP method ####
    235294
    236 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     295PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    237296
    238297##### Single post-type #####
     
    260319The code above needs to be within a php block which is denoted by the `<?php` and `?>` pair. Depending on your theme, you might not need the opening and closing php tags shown in the above snippet; if that is the case, you are free to omit them in your code.
    261320
    262 ### How do I show posts from a specific category only ###
    263 
    264 This can be achieved using the shortcode or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. Each Category and Tag are then known as "terms". You need to use the slug for each individual category or tag in place of the example slugs (i.e. `term-slug`, `term1-slug`, and `term1-slug`).
    265 
    266 #### Shortcode method ####
     321### How do I show posts from a specific category only? ###
     322
     323This can be achieved using the short-code or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. Each Category and Tag are then known as "terms". You need to use the slug for each individual category or tag in place of the example slugs (i.e. `term-slug`, `term1-slug`, and `term1-slug`).
     324
     325#### short-code method ####
    267326
    268327##### Single term #####
     
    278337#### PHP method ####
    279338
    280 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     339PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    281340
    282341```php
     
    298357The code above needs to be within a php block which is denoted by the `<?php` and `?>` pair. Depending on your theme, you might not need the opening and closing php tags shown in the above snippet; if that is the case, you are free to omit them in your code.
    299358
    300 ### How do I show terms from a taxonomy instead of posts ###
    301 
    302 This can be achieved using the shortcode or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. You need to use the slug for the taxonomy in place of the example slugs (i.e. `taxonomy-slug`).
    303 
    304 #### Shortcode method ####
     359### How do I show terms from a taxonomy instead of posts? ###
     360
     361This can be achieved using the short-code or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. You need to use the slug for the taxonomy in place of the example slugs (i.e. `taxonomy-slug`).
     362
     363#### short-code method ####
    305364
    306365    [a-z-listing taxonomy="taxonomy-slug" display="terms"]
     
    312371#### PHP method ####
    313372
    314 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     373PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    315374
    316375```php
     
    326385### How do I remove section targeting or limit which sections are available? ###
    327386
    328 In your theme's functions.php add the following code:
     387In your theme's `functions.php` file add the following code:
    329388
    330389```php
     
    340399### I am not using the short-code so the styles are not working, can I still use the in-built styles without the short-code? ###
    341400
    342 Yes you can. This needs the following code added to your theme's functions.php. We purposely only display the stylesheet on pages where the short-code is active.
     401Yes you can. This needs the following code added to your theme's `functions.php` file. We purposely only display the stylesheet on pages where the short-code is active.
    343402
    344403```php
     
    348407```
    349408
    350 If there is code already in your functions.php then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
     409If there is code already in your theme's `functions.php` file then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
    351410
    352411The sidebar widget styling also works in a similar manner, and will also respond to the same code above to forcibly enable it.
     
    366425```
    367426
    368 If there is code already in your functions.php then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
     427If there is code already in your theme's `functions.php` file then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
    369428
    370429### How do I disable the in-built styling? ###
     
    403462## Changelog ##
    404463
     464### 2.3.0 ###
     465
     466* Add multiple taxonomy support to taxonomy terms listing.
     467* Add site health-check feature compatibility.
     468* Fix `hide-empty-terms` in a taxonomy terms listing. Previously completely broken.
     469* Fix hard-coded `admin-ajax.php` URL in widget configuration javascript.
     470* Improve documentation in the readme.txt file, which is shown on the plugin page at WordPress.org.
     471
    405472### 2.2.0 ###
    406473
    407474* Add `get_the_item_post_count` and `the_item_post_count` template methods to get or display the number of posts associated with a term.
    408475* Add support for `get-all-children` when specifying a `parent-term`.
    409 * Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the shortcode.
     476* Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the short-code.
    410477* Deprecate PHP 5.3-5.5. Please ensure you are running at least PHP 5.6. The plugin may work on older PHP versions, but compatibility is not guaranteed.
    411 * Bugfix for incorrect behaviour of `exclude-terms` in the shortcode. Thanks go to Chris Skrzypchak for finding this.
    412 
    413 ### 2.1.4 ###
    414 
    415 #### Bug Fix ####
    416 
    417 * Fixed a spurious `NOTICE` message (shown below) when error logging is output to the browser. Thanks to the discovery by @npiper.
    418   * If your site is not showing the message below then you do not need to upgrade with any urgency.
    419 
    420 `Notice: Trying to get property of non-object in [Path-to-WordPress]/wp-content/plugins/a-z-listing/classes/class-a-z-listing.php on line 215`
    421 
    422 ### 2.1.3 ###
    423 
    424 #### Bug Fix ####
    425 
    426 * Fixed the bug reported by @ighosts22 where the letter for non-alphabetic items was not pointing at the list of items.
    427 * Fixed incorrect behaviour discovered after adding tests to the automated testing to verify that I correctly fixed the above bug.
    428 
    429 ### 2.1.2 ###
    430 
    431 #### Bug Fix ####
    432 
    433 * Post links in 2.1.0 and 2.1.1 included a series of `%09` which caused visitors' clicks to return a 404 Not Found error. Thanks to @forestpump for their effort in finding the problem and highlighting the fix.
    434 
    435 ### 2.1.1 ###
    436 
    437 #### Bug Fix ####
    438 
    439 * Replace hardcoded path to `admin-ajax.php` in widget administration javascript.
    440   * This release fixes the widget administration form for sites running in a path similar to https://example.com/wp/. You should install this fix if your site is a configured in a subfolder to be able to successfully configure the widget.
    441   * Sites running in the top-level, e.g. https://example.com/, already work correctly and their behaviour is unchanged by this fix. You do not need to hurry to update if your site is configured at the top-level without a subfolder.
    442 
    443 ### 2.1.0 ###
    444 
    445 #### Bug Fixes ####
    446 
    447 * Fix widget configuration autocomplete fields for target post and parent post in the theme customizer
    448 * Fix taxonomy-term-filtered listings displaying all posts (e.g. shortcodes of the form `[a-z-listing taxonomy="category" terms="term"])
    449 * Fix `get_the_item_object()` to work with old-style overridden indices
    450 * Fix `get_the_item_object()` to correctly extract the item ID and load the correct item
    451 * Improve javascript on the widget configuration
    452 * Clarified the examples with explanations about "post types", "taxonomies", and "terms" to explain what each of these mean.
    453 
    454 #### New Features ####
    455 
    456 * Add parent-page attribute to the shortcode
    457 * Add simpler and safer filter for overriding the index letter for an item
    458 * Add simpler and safer filter for overriding the title for an item
    459 * Add new function for fetching meta data in a template: `$a_z_listing->get_item_meta()`
    460 * Allow exclude-terms to be used with display="posts"
    461 * Moved template loading function outside of the `A_Z_Query` class to prevent accidental access to the plugin internal structure
    462 
    463 ### 2.0.6 ###
    464 
    465 * Fix widget target post support
    466 * Fix filtering posts by multiple taxonomy terms
    467 * Fix styling error causing two or more posts to sometimes appear on the same line
    468 * Minor style tweak to fix short listings, and long titles
    469 * Fix broken styling in 2.0.0
    470 * Fix javascript error on widgets screen
    471 
    472 ### 2.0.0 ###
    473 
    474 * Improved widget configuration.
    475 * New attribute added to the shortcode when `display="posts"`:
    476   * `exclude-posts`: remove specific posts from the list
    477 * New attributes added to the shortcode when `display="terms"`:
    478   * `exclude-terms`: sets the terms to exclude from display
    479   * `parent-term`: set the parent that all displayed terms must be organised under
    480   * `hide-empty-terms`: hide terms that have no posts associated
    481 * Fix the stylesheet to better cope with variances in font-size and text length in the alphabet links list and widget.
    482 * Introduce PHP classes for adding numbers and grouping to the alphabet. Allows unhooking from the filters to undo the changes, where previously you could not unhook these modifications once they'd been applied.
    483 
    484 #### BREAKING CHANGES ####
     478* Bugfix for incorrect behaviour of `exclude-terms` in the short-code. Thanks go to Chris Skrzypchak for finding this.
     479
     480### BREAKING CHANGES in 2.0.0+ ###
    485481
    486482##### Multi column example #####
  • a-z-listing/trunk/a-z-listing.php

    r2056348 r2092139  
    88 * Text Domain:     a-z-listing
    99 * Domain Path:     /languages
    10  * Version:         2.2.0
     10 * Version:         2.3.0
    1111 *
    1212 * @package         A_Z_Listing
     
    3333function a_z_listing_plugins_loaded() {
    3434    require 'functions/i18n.php';
     35    require 'functions/health-check.php';
    3536    require 'functions/helpers.php';
    3637    require 'functions/styles.php';
  • a-z-listing/trunk/changelog.md

    r2056348 r2092139  
    11# Full Changelog #
     2
     3## 2.3.0 ##
     4
     5* Add multiple taxonomy support to taxonomy terms listing.
     6* Add site health-check feature compatibility.
     7* Fix `hide-empty-terms` in a taxonomy terms listing. Previously completely broken.
     8* Fix hard-coded `admin-ajax.php` URL in widget configuration javascript.
     9* Improve documentation in the readme.txt file, which is shown on the plugin page at WordPress.org.
    210
    311## 2.2.0 ##
     
    513* Add `get_the_item_post_count` and `the_item_post_count` template methods to get or display the number of posts associated with a term.
    614* Add support for `get-all-children` when specifying a `parent-term`.
    7 * Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the shortcode.
     15* Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the short-code.
    816* Deprecate PHP 5.3-5.5. Please ensure you are running at least PHP 5.6. The plugin may work on older PHP versions, but compatibility is not guaranteed.
    9 * Bugfix for incorrect behaviour of `exclude-terms` in the shortcode. Thanks go to Chris Skrzypchak for finding this.
     17* Bugfix for incorrect behaviour of `exclude-terms` in the short-code. Thanks go to Chris Skrzypchak for finding this.
    1018
    1119## 2.1.4 ##
    12 
    13 ### Bug Fix ###
    1420
    1521* Fixed a spurious `NOTICE` message (shown below) when error logging is output to the browser. Thanks to the discovery by @npiper.
     
    2026## 2.1.3 ##
    2127
    22 ### Bug Fix ###
    23 
    2428* Fixed the bug reported by @ighosts22 where the letter for non-alphabetic items was not pointing at the list of items.
    2529* Fixed incorrect behaviour discovered after adding tests to the automated testing to verify that I correctly fixed the above bug.
     
    2731## 2.1.2 ##
    2832
    29 ### Bug Fix ###
    30 
    3133* Post links in 2.1.0 and 2.1.1 included a series of `%09` which caused visitors' clicks to return a 404 Not Found error. Thanks to @forestpump for their effort in finding the problem and highlighting the fix.
    3234
    3335## 2.1.1 ##
    34 
    35 ### Bug Fix ###
    3636
    3737* Replace hardcoded path to `admin-ajax.php` in widget administration javascript.
     
    4141## 2.1.0 ##
    4242
    43 ### Bug Fixes ###
    44 
    45 * Fix widget configuration autocomplete fields for target post and parent post in the theme customizer
    46 * Fix taxonomy-term-filtered listings displaying all posts (e.g. shortcodes of the form `[a-z-listing taxonomy="category" terms="term"])
    47 * Fix `get_the_item_object()` to work with old-style overridden indices
    48 * Fix `get_the_item_object()` to correctly extract the item ID and load the correct item
    49 * Improve javascript on the widget configuration
    50 * Clarified the examples with explanations about "post types", "taxonomies", and "terms" to explain what each of these mean.
    51 
    52 ### New Features ###
    53 
    54 * Add parent-page attribute to the shortcode
     43* Add parent-page attribute to the short-code
    5544* Add simpler and safer filter for overriding the index letter for an item
    5645* Add simpler and safer filter for overriding the title for an item
     
    5847* Allow exclude-terms to be used with display="posts"
    5948* Moved template loading function outside of the `A_Z_Query` class to prevent accidental access to the plugin internal structure
     49* Fix widget configuration autocomplete fields for target post and parent post in the theme customizer
     50* Fix taxonomy-term-filtered listings displaying all posts (e.g. short-codes of the form `[a-z-listing taxonomy="category" terms="term"])
     51* Fix `get_the_item_object()` to work with old-style overridden indices
     52* Fix `get_the_item_object()` to correctly extract the item ID and load the correct item
     53* Improve javascript on the widget configuration
     54* Clarified the examples with explanations about "post types", "taxonomies", and "terms" to explain what each of these mean.
    6055
    6156## 2.0.6 ##
     
    8782
    8883* Improved widget configuration.
    89 * New attribute added to the shortcode when `display="posts"`:
     84* New attribute added to the short-code when `display="posts"`:
    9085  * `exclude-posts`: remove specific posts from the list
    91 * New attributes added to the shortcode when `display="terms"`:
     86* New attributes added to the short-code when `display="terms"`:
    9287  * `exclude-terms`: sets the terms to exclude from display
    9388  * `parent-term`: set the parent that all displayed terms must be organised under
     
    9691* Introduce PHP classes for adding numbers and grouping to the alphabet. Allows unhooking from the filters to undo the changes, where previously you could not unhook these modifications once they'd been applied.
    9792
    98 ### BREAKING CHANGES ###
     93### BREAKING CHANGES in 2.0.0+ ###
    9994
    10095* Multi column example:
     
    134129## 1.8.0 ##
    135130
    136 * Add extra shortcode attributes:
     131* Add extra short-code attributes:
    137132  * `numbers`: appends or prepends numerals to the alphabet
    138133    * Default value: unset
     
    144139    * Any value other than a positive number or the value `numbers` will default to disabling all grouping functionality
    145140    * When set to a number higher than `1` the listing will group letters together into ranges
    146       * For example, if you chose `3` then a latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on
     141      * For example, if you chose `3` then a Latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on
    147142      * When using this setting, if numbers are also shown via the `numbers="before"` or `numbers="after"` attribute then they will be shown as a single separate group `0-9`
    148143    * When set to the value `numbers` it will group numerals into a single group `0-9`
     
    155150    * Including more than one letter/symbol in each group will display posts starting with any of those under the same section
    156151    * The first letter/symbol in each group is used as the group's heading when displayed on your site
    157 * Bugfix: Shortcode to display taxonomy terms wouldn't also display numbers groups. Hat-tip to @sotos for the report.
     152* Bugfix: short-code to display taxonomy terms wouldn't also display numbers groups. Hat-tip to @sotos for the report.
    158153
    159154## 1.7.2 ##
    160155
    161 * Bugfix: Previous release broke the shortcode
     156* Bugfix: Previous release broke the short-code
    162157
    163158## 1.7.1 ##
    164159
    165160* Add additional filters allowing for hyphens or underscores to be used when defining. The readme.txt incorrectly used then-unsupported names with hyphens in examples so now we support both.
    166 * Add numbers="before" and numbers="after" in shortcode
     161* Add numbers="before" and numbers="after" in short-code
    167162
    168163## 1.7.0 ##
    169164
    170 * Add support for taxonomy term listings to the shortcode
    171 * Add support for filtering by taxonomy terms to the shortcode
     165* Add support for taxonomy term listings to the short-code
     166* Add support for filtering by taxonomy terms to the short-code
    172167
    173168## 1.6.5 ##
     
    209204## 1.5.1 ##
    210205
    211 * Fix multiple post-types support for shortcode
    212 * Update documentation to explain how to show multiple post-types with the shortcode
     206* Fix multiple post-types support for short-code
     207* Update documentation to explain how to show multiple post-types with the short-code
    213208
    214209## 1.5.0 ##
     
    225220* Add support for passing a WP_Post object instead of an ID to the widget function
    226221* Fix widget config not saving post-type parameter
    227 * Fix warning of incorrect usage of `has_shortcode()` function
     222* Fix warning of incorrect usage of `has_short-code()` function
    228223* Fix section-targeting to work as described
    229224
     
    253248
    254249* BREAKING CHANGE: Refactored several function names. If you have written your own template/loop you will need to adapt your code. See the readme's Theming section for details.
    255 * Added `post-type` attribute into the shortcode to display for post-types other than pages.
     250* Added `post-type` attribute into the short-code to display for post-types other than pages.
    256251* Minor code cleanup.
    257252
     
    284279## 0.5 ##
    285280
    286 * Added new shortcode to display the index page.
     281* Added new short-code to display the index page.
    287282
    288283## 0.4 ##
  • a-z-listing/trunk/classes/class-a-z-listing.php

    r2056348 r2092139  
    1919     * The taxonomy
    2020     *
    21      * @var string
     21     * @var string|array
    2222     */
    2323    private $taxonomy;
     
    133133                $query = wp_parse_args( $query, $defaults );
    134134            } elseif ( is_string( $query ) ) {
     135                $taxonomies = explode( ',', $query );
     136                $taxonomies = array_unique( array_filter( array_map( 'trim', $taxonomies ) ) );
     137
    135138                $query = wp_parse_args(
    136139                    array(
    137                         'taxonomy' => $query,
     140                        'taxonomy' => (array) $taxonomies,
    138141                    ),
    139142                    $defaults
     
    161164            $query = apply_filters( 'a-z-listing-query', $query, 'terms' );
    162165
     166            if ( is_object( $query ) ) {
     167                $query = (array) $query;
     168            }
    163169            $this->taxonomy = $query['taxonomy'];
    164170
     
    188194             *
    189195             * @since 1.0.0
     196             * @since 2.0.0 apply to taxonomy queries. Add type parameter indicating type of query.
    190197             * @param array|Object|WP_Query $query The query object
    191198             */
     
    196203             *
    197204             * @since 1.7.1
     205             * @since 2.0.0 apply to taxonomy queries. Add type parameter indicating type of query.
    198206             * @param array|Object|WP_Query $query The query object
    199207             */
     
    458466        if ( $section_object === $page ) {
    459467            $section_object = null;
    460         }
    461 
    462         if ( null !== $section_object ) {
     468        } elseif ( null !== $section_object ) {
    463469            if ( isset( $section_object->post_name ) ) {
    464470                $section_name = $section_object->post_name;
     
    664670        global $post;
    665671        if ( 'terms' === $this->type ) {
    666             $section = $this->taxonomy;
     672            if ( is_array( $this->taxonomy ) ) {
     673                $section = join( '_', $this->taxonomy );
     674            } else {
     675                $section = $this->taxonomy;
     676            }
    667677        } else {
    668678            $section = self::get_section();
  • a-z-listing/trunk/functions/helpers.php

    r2056348 r2092139  
    335335 */
    336336function a_z_listing_is_truthy( $value ) {
    337     switch ( $value ) {
    338         case '1':
    339         case 'on':
    340         case 'yes':
    341         case 'true':
    342         case 1:
    343         case true:
    344             return true;
    345         default:
    346             return false;
     337    if ( '1' === $value ||
     338        'on' === $value ||
     339        'yes' === $value ||
     340        'true' === $value ||
     341        1 === $value ||
     342        true === $value
     343    ) {
     344        return true;
     345    } else {
     346        return false;
    347347    }
    348348}
  • a-z-listing/trunk/functions/shortcode.php

    r2056348 r2092139  
    7474
    7575    if ( 'terms' === $attributes['display'] && ! empty( $attributes['taxonomy'] ) ) {
    76         $taxonomy = '' !== $attributes['taxonomy'] ? $attributes['taxonomy'] : 'category';
    77         $query    = array(
    78             'taxonomy'   => $taxonomy,
    79             'hide_empty' => isset( $attributes['hide_empty'] ) && a_z_listing_is_truthy( $attributes['hide-empty'] ),
     76        $taxonomy = ! empty( $attributes['taxonomy'] ) ? $attributes['taxonomy'] : 'category';
     77        if ( isset( $attributes['hide-empty'] ) && ! empty( $attributes['hide-empty'] ) ) {
     78            $hide_empty = a_z_listing_is_truthy( $attributes['hide-empty'] );
     79        } else {
     80            $hide_empty = a_z_listing_is_truthy( $attributes['hide-empty-terms'] );
     81        }
     82
     83        $taxonomies = explode( ',', $taxonomy );
     84        $taxonomies = array_unique( array_filter( array_map( 'trim', $taxonomies ) ) );
     85
     86        $query = array(
     87            'taxonomy'   => $taxonomies,
     88            'hide_empty' => $hide_empty,
    8089        );
    8190
     
    92101        if ( ! empty( $terms_string ) ) {
    93102            $terms = explode( ',', $terms_string );
    94             $terms = array_map( 'trim', $terms );
    95             $terms = array_map( 'intval', $terms );
    96             $terms = array_filter(
    97                 $terms,
    98                 function( $value ) {
    99                     return 0 < $value;
    100                 }
    101             );
    102             $terms = array_unique( $terms );
     103            $terms = array_unique(
     104                array_filter(
     105                    array_map(
     106                        'intval',
     107                        array_map( 'trim', $terms )
     108                    ),
     109                    function( $value ) {
     110                        return 0 < $value;
     111                    }
     112                )
     113            );
    103114
    104115            $query = wp_parse_args(
     
    128139        }
    129140
    130         if ( ! empty( $attributes['hide-empty-terms'] ) ) {
    131             $hide_empty = a_z_listing_is_truthy( $attributes['hide-empty-terms'] );
    132 
    133             $query = wp_parse_args(
    134                 $query,
    135                 array(
    136                     'hide_empty' => $hide_empty,
    137                 )
    138             );
    139         }
    140 
    141141        $a_z_query = new A_Z_Listing( $query, 'terms' );
    142142    } else {
    143143        $post_type = explode( ',', $attributes['post-type'] );
    144         $post_type = array_map( 'trim', $post_type );
     144        $post_type = array_unique( array_filter( array_map( 'trim', $post_type ) ) );
    145145
    146146        $query = array(
     
    150150        if ( ! empty( $attributes['exclude-posts'] ) ) {
    151151            $exclude_posts = explode( ',', $attributes['exclude-posts'] );
    152             $exclude_posts = array_map( 'trim', $exclude_posts );
    153             $exclude_posts = array_map( 'intval', $exclude_posts );
    154             $exclude_posts = array_filter(
    155                 $exclude_posts,
    156                 function( $value ) {
    157                     return 0 < $value;
    158                 }
    159             );
    160             $exclude_posts = array_unique( $exclude_posts );
     152            $exclude_posts = array_unique(
     153                array_filter(
     154                    array_map(
     155                        'intval',
     156                        array_map( 'trim', $exclude_posts )
     157                    ),
     158                    function( $value ) {
     159                        return 0 < $value;
     160                    }
     161                )
     162            );
    161163
    162164            if ( ! empty( $exclude_posts ) ) {
     
    174176        }
    175177
    176         $taxonomy  = '' !== $attributes['taxonomy'] ? $attributes['taxonomy'] : 'category';
     178        $taxonomy  = $attributes['taxonomy'] ? $attributes['taxonomy'] : 'category';
    177179        $tax_query = array();
    178180        if ( ! empty( $attributes['terms'] ) ) {
    179181            $terms = explode( ',', $attributes['terms'] );
    180             $terms = array_map( 'trim', $terms );
    181             $terms = array_filter(
    182                 $terms,
    183                 function( $value ) {
    184                     return ! empty( $value );
    185                 }
    186             );
    187             $terms = array_unique( $terms );
     182            $terms = array_unique( array_filter( array_map( 'trim', $terms ) ) );
    188183
    189184            $tax_query[] = array(
     
    196191        if ( ! empty( $attributes['exclude-terms'] ) ) {
    197192            $ex_terms = explode( ',', $attributes['exclude-terms'] );
    198             $ex_terms = array_map( 'trim', $ex_terms );
    199             $ex_terms = array_filter(
    200                 $ex_terms,
    201                 function( $value ) {
    202                     return ! empty( $value );
    203                 }
    204             );
    205             $ex_terms = array_unique( $ex_terms );
     193            $ex_terms = array_unique( array_filter( array_map( 'trim', $ex_terms ) ) );
    206194
    207195            $tax_query[] = array(
  • a-z-listing/trunk/languages/a-z-listing.pot

    r2056348 r2092139  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: A-Z Listing 2.2.0\n"
     5"Project-Id-Version: A-Z Listing 2.3.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/a-z-listing\n"
    7 "POT-Creation-Date: 2019-03-13 10:21:53+00:00\n"
     7"POT-Creation-Date: 2019-05-20 22:04:04+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: classes/class-a-z-listing.php:330
     27#: classes/class-a-z-listing.php:338
    2828#. translators: List the aphabet of your language in the order that your
    2929#. language prefers. list as groups of identical meanings but different
     
    4343msgstr ""
    4444
    45 #: classes/class-a-z-listing.php:332
     45#: classes/class-a-z-listing.php:340
    4646#. translators: This should be a single character to denote "all entries that
    4747#. didn't fit under one of the alphabet character groups defined". This is used
     
    5050#. letter.
    5151msgid "#"
     52msgstr ""
     53
     54#: functions/health-check.php:17
     55msgid "A to Z Listing plugin"
     56msgstr ""
     57
     58#: functions/health-check.php:32
     59msgid "PHP mbstring module is enabled"
     60msgstr ""
     61
     62#: functions/health-check.php:35
     63msgid "mbstring"
     64msgstr ""
     65
     66#: functions/health-check.php:40
     67msgid "The mbstring PHP module improves support for non-latin languages."
     68msgstr ""
     69
     70#: functions/health-check.php:48
     71msgid "PHP mbstring module is not enabled"
     72msgstr ""
     73
     74#: functions/health-check.php:52
     75msgid ""
     76"The mbstring PHP module is not enabled on your server. This module improves "
     77"support for non-latin languages."
     78msgstr ""
     79
     80#: functions/health-check.php:54
     81msgid ""
     82"Contact your web host to request that the mbstring PHP module is enabled "
     83"for your site."
    5284msgstr ""
    5385
  • a-z-listing/trunk/readme.txt

    r2056348 r2092139  
    66Requires at least: 4.6
    77Requires PHP: 5.6
    8 Tested up to: 5.1
    9 Stable tag: 2.2.0
     8Tested up to: 5.2
     9Stable tag: 2.3.0
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020Show your posts, pages, and terms alphabetically in a Rolodex-, catalogue-, or directory-style list with the A-Z Listing plugin!
    2121
    22 The plugin has a shortcode for the list, and a widget so you can link to the list from anywhere on your site. If a letter doesn't have any pages then the widget will display the letter unlinked. The list page will omit the display for that letter entirely.
     22The plugin has a short-code for the list, and a widget so you can link to the list from anywhere on your site. If a letter doesn't have any pages then the widget will display the letter unlinked. The list page will omit the display for that letter entirely.
    2323
    2424Show posts from any or multiple post types including the in-built posts and pages. Also supported are post-types from plugins like WooCommerce products. Alternatively, show terms like categories or tags.
     
    3535= Instructions =
    3636
    37 1. Upload the `a-z-listing` folder to the `/wp-content/plugins/` directory
    38 1. Activate the plugin through the 'Plugins' menu in WordPress
    39 1. Place `<?php the_a_z_listing(); ?>` in your templates for the index page output (see the **php** section of this document for details) or use the `a-z-listing` shortcode (see the **shortcode** section of this document for details).
    40 1. Add the A-Z Site Map widget to a sidebar or use `<?php the_a_z_widget( null, array( 'post' => get_page( $id ) ) ); ?>` in your templates (see the **php** section of this document for details).
    41 
    42 == Shortcode ==
    43 
    44 The plugin supplies a shortcode for the full A-Z listing allowing use without modifying your theme's templates.
     371. Upload the a-z-listing folder to the `/wp-content/plugins/` directory.
     381. Activate the plugin through the 'Plugins' menu in WordPress.
     391. Use the `[a-z-listing]` short-code on the page or post that you want to show the listing.
     401. Add the A-Z Site Map widget to a sidebar.
     41
     42== short-code ==
     43
     44The plugin supplies a short-code for the full A-Z listing allowing use without modifying your theme's templates.
    4545
    4646Basic usage is as follows:
     
    4848    [a-z-listing]
    4949
    50 To specify a post-type to display instead of `page` then use, e.g. `Posts`:
    51 
    52     [a-z-listing post-type="post"]
     50To specify a post-type to display instead of `page` then use, e.g. `post`:
     51
     52    [a-z-listing display="posts" post-type="post"]
    5353
    5454To filter the posts by a term from a taxonomy:
    5555
    56     [a-z-listing taxonomy="category" terms="my-term-slug"]
     56    [a-z-listing display="posts" taxonomy="category" terms="my-term-slug"]
     57
     58To display pages that are direct children of the page with ID `24`:
     59
     60    [a-z-listing display="posts" post-type="page" parent-post="24"]
     61
     62To display pages that are children of any depth below the page with ID `24`:
     63
     64    [a-z-listing display="posts" post-type="page" parent-post="24" get-all-children="yes"]
    5765
    5866To show terms from a taxonomy instead of posts and pages, e.g. Terms from the `Categories` taxonomy:
    5967
    60     [a-z-listing taxonomy="category" display="terms"]
     68    [a-z-listing display="terms" taxonomy="category"]
     69
     70To show terms from the `Categories` taxonomy that are direct children of the term with ID of `42`:
     71
     72    [a-z-listing display="terms" taxonomy="category" parent-term="42"]
     73
     74To show terms from the `Categories` taxonomy that are children of any depth in the tree below the term with ID of `42`:
     75
     76    [a-z-listing display="terms" taxonomy="category" parent-term="42" get-all-children="yes"]
    6177
    6278To override the alphabet used by the plugin:
    6379
    64     [a-z-listing alphabet="Aa,Bb,Cc,Dd,Ee,Ff,Gg,Hh,Ii,Jj,Kk,Ll,Mm,Nn,Oo,Pp,Qq,Rr,Ss,Tt,Uu,Vv,Ww,Xx,Yy,Zz"]
     80    [a-z-listing display="posts" alphabet="Aa,Bb,Cc,Dd,Ee,Ff,Gg,Hh,Ii,Jj,Kk,Ll,Mm,Nn,Oo,Pp,Qq,Rr,Ss,Tt,Uu,Vv,Ww,Xx,Yy,Zz"]
    6581
    6682To add numbers to the listing:
    6783
    68     [a-z-listing numbers="after"]
     84    [a-z-listing display="posts" numbers="after"]
    6985
    7086The numbers can also be shown before the alphabet:
    7187
    72     [a-z-listing numbers="before"]
     88    [a-z-listing display="posts" numbers="before"]
    7389
    7490You can group the numbers into a single collection for all posts beginning with a numeral:
    7591
    76     [a-z-listing numbers="after" grouping="numbers"]
     92    [a-z-listing numbers="after" group-numbers="yes"]
    7793
    7894To group the alphabet letters into a range:
     
    8298** The arguments are all optional **
    8399
    84 * `display`: specifies whether to display posts or terms from a taxonomy
    85   * Default value: `posts`
    86   * May be set to either `posts` or `terms`
    87   * Any value other than unset, `posts` or `terms` will default to displaying posts
    88 * `post-type`: sets the listing to show a specific post-type
    89   * Default value: `page`
    90   * You may specify multiple post-types by separating with commas (`,`) e.g. `post-type="page,post"`
    91 * `exclude-posts`: remove specific posts from the list
    92   * Default value: unset
    93   * Uses the `ID` of the post(s)
    94   * Multiple posts may be specified by separating by commas: `,`
    95   * Only affects `display="posts"`
    96 * `taxonomy`: does nothing by itself, see the combinations below
    97   * Default value: unset
    98   * Uses the `slug` of the taxonomy
    99   * When combined with:
    100     * `terms=""`, will filter your posts by the terms you set there, which appear in the taxonomy set here
    101     * `display="terms"`, will switch from displaying post titles to displaying the names of terms from the taxonomy specified
    102 * `terms`: sets the taxonomy terms for filtering posts
    103   * Default value: unset
    104   * The taxonomy must also be specified in `taxonomy`
    105   * Uses the `slug` of the term(s) when `display="posts"` and the `ID` of the term(s) when `display="terms"`
    106   * Multiple terms may be specified by separating with commas: `,`
    107   * May not be used with `exclude-terms=""`
    108 * `exclude-terms`: sets the terms to exclude from display
    109   * Default value: unset
    110   * The taxonomy must also be specified in `taxonomy`
    111   * Uses the `ID` of the term(s)
    112   * Multiple terms may be specified by separating with commas: `,`
    113   * May not be used with `terms=""`
    114   * Only affects `display="terms"`
    115 * `parent-term`: set the parent that all displayed terms must be organised under
    116   * Default value: unset
    117   * Uses the `slug` of the parent term
    118   * Single value only
    119   * Only affects `display="terms"`
    120 * `hide-empty-terms`: hide terms that have no posts associated
    121   * Default value: `false`
    122   * May be set to `true` or `1` to hide the empty terms
    123   * Only affects `display="terms"`
    124 * `numbers`: appends or prepends numerals to the alphabet
    125   * Default value: unset
    126   * May be set to either `before` or `after`
    127   * Any value other than unset, `before` or `after` will default to **appending** numerals to the alphabet
    128 * `grouping`: tells the plugin if and how to group the alphabet
    129   * Default value: unset
    130   * May be set to any positive number greater than `1` or the value `numbers`
    131   * Any value other than a positive number or the value `numbers` will default to disabling all grouping functionality
    132   * When set to a number higher than `1` the listing will group letters together into ranges
    133     * For example, if you chose `3` then a latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on
    134     * When using this setting, if numbers are also shown via the `numbers="before"` or `numbers="after"` attribute then they will be shown as a single separate group `0-9`
    135   * When set to the value `numbers` it will group numerals into a single group `0-9`
    136     * This requires the numbers to be displayed via the `numbers="before"` or `numbers="after"` attributes
    137 * `alphabet`: allows you to override the alphabet that the plugin uses
    138   * Default value: unset
    139   * When this attribute is unset, the plugin will either use the untranslated default, or if [glotpress](https://translate.wordpress.org/projects/wp-plugins/a-z-listing) includes a translation for your site's language as set in `Admin -> Settings -> Site Language` it will use that translation
    140   * The current untranslated default is: `AÁÀÄÂaáàäâ,Bb,Cc,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz`
    141   * Accepts a single line of letters/symbols, which need to be separated via the comma character `,`
    142   * Including more than one letter/symbol in each group will display posts starting with any of those under the same section
    143   * The first letter/symbol in each group is used as the group's heading when displayed on your site
     100= Common options =
     101
     102* `display`: specifies whether to display posts or terms from a taxonomy.
     103  * Default value: `posts`.
     104  * May only contain one value.
     105  * Must be set to either `posts` or `terms`.
     106  * Any value other than `posts` or `terms` will default to displaying posts.
     107* `numbers`: appends or prepends numerals to the alphabet.
     108  * Default value: `unset`.
     109  * May only contain one value.
     110  * Must be set to either `before` or `after`.
     111  * Any value other than `before` or `after` will default to **appending** numerals to the alphabet.
     112* `grouping`: tells the plugin if and how to group the alphabet.
     113  * Default value: `unset`.
     114  * May only contain one value.
     115  * Must be set to any positive number greater than `1` or the value `numbers`.
     116  * Any value other than a positive number or the value `numbers` will default to disabling all grouping functionality.
     117  * When set to a number higher than `1` the listing will group letters together into ranges.
     118    * For example, if you chose `3` then a Latin alphabet will group together `A`, `B`, and `C` into `A-C`. Likewise for `D-F`, `G-I` and so-on.
     119    * When using this setting, if numbers are also shown via the `numbers="before"` or `numbers="after"` attribute then they will be shown as a single separate group `0-9`.
     120  * When set to the value `numbers` it will group numerals into a single group `0-9`.
     121    * This requires the numbers to be displayed via the `numbers="before"` or `numbers="after"` attributes.
     122* `group-numbers`: tells the plugin to group all items beginning with a numeral into a single collection.
     123  * Default value: `false`.
     124  * May only contain one value.
     125  * Must be set to `true`, `yes`, `on`, or `1` to group items beginning with a numeral in a single collection. All other values will keep the default behaviour.
     126* `alphabet`: allows you to override the alphabet that the plugin uses.
     127  * Default value: `unset`.
     128  * When this attribute is not defined, the plugin will either use the untranslated default, or if [glotpress](https://translate.wordpress.org/projects/wp-plugins/a-z-listing) includes a translation for your site's language as set in `Admin -> Settings -> Site Language` it will use that translation.
     129  * The current untranslated default is: `AÁÀÄÂaáàäâ,Bb,Cc,Dd,EÉÈËÊeéèëê,Ff,Gg,Hh,IÍÌÏÎiíìïî,Jj,Kk,Ll,Mm,Nn,OÓÒÖÔoóòöô,Pp,Qq,Rr,Ssß,Tt,UÚÙÜÛuúùüû,Vv,Ww,Xx,Yy,Zz`.
     130  * Accepts a single line of letters/symbols, which need to be separated via the comma character `,`.
     131  * Including more than one letter/symbol in each group will display posts starting with any of those under the same section.
     132  * The first letter/symbol in each group is used as the group's heading when displayed on your site.
     133
     134= Posts options =
     135
     136* `post-type`: sets the listing to show a specific post-type.
     137  * Default value: `page`.
     138  * Multiple post-types may be specified by separating with commas (`,`) e.g. `post-type="page,post"`.
     139  * Must be the `slug` of the post-type(s).
     140* `parent-post`: sets the parent post that all displayed posts must be descended from.
     141  * Default value: `unset`.
     142  * May only contain one value.
     143  * Must be the `ID` of the parent post.
     144  * Add `get-all-children="yes"` to also include all descendants of any depth below the parent post.
     145* `exclude-posts`: remove these posts from the list.
     146  * Default value: `unset`.
     147  * Multiple posts may be specified by separating by commas: `,`.
     148  * Must be the `ID` of the post(s).
     149* `taxonomy`: sets the taxonomy containing the terms specified in the `terms=""` option.
     150  * Default value: `unset`.
     151  * May only contain one value.
     152  * Must be the `slug` of the taxonomy.
     153* `terms`: sets the taxonomy terms for filtering posts.
     154  * Default value: `unset`.
     155  * The taxonomy must also be specified in `taxonomy`.
     156  * Multiple terms may be specified by separating with commas: `,`.
     157  * Must be the `slug` of the term(s).
     158
     159= Terms options =
     160
     161* `taxonomy`: sets the taxonomy to display terms from in the listing.
     162  * Default value: `unset`.
     163  * Multiple taxonomies may be specified by separating with commas: `,`.
     164  * Must be the `slug` of the taxonomy.
     165* `terms`: sets the taxonomy terms to include in the listing.
     166  * Default value: `unset`.
     167  * The taxonomy must also be specified in `taxonomy`.
     168  * Multiple terms may be specified by separating with commas: `,`.
     169  * Must be the `ID` of the term(s).
     170  * Cannot be used with `exclude-terms=""`.
     171* `exclude-terms`: sets the terms to exclude from display.
     172  * Default value: `unset`.
     173  * The taxonomy must also be specified in `taxonomy`.
     174  * Multiple terms may be specified by separating with commas: `,`.
     175  * Must be the `ID` of the term(s).
     176  * Cannot be used with `terms=""`.
     177* `parent-term`: set the parent that all displayed terms must be descended from.
     178  * Default value: `unset`.
     179  * May only contain one value.
     180  * Must be the `slug` of the parent term.
     181  * Add `get-all-children="yes"` to also include all descendants of any depth below the parent term.
     182* `get-all-children`: when a parent term is chosen this option is used to show all children of any depth or only direct children.
     183  * Default value: `false`.
     184  * May only contain one value.
     185  * Must be set to `true`, `yes`, `on`, or `1` to include all children of any depth. Any value other will use the default behaviour of only showing direct children.
     186* `hide-empty-terms`: hide terms that have no posts associated.
     187  * Default value: `false`.
     188  * May only contain one value.
     189  * Must be set to `true`, `yes`, `on`, or `1` to hide the empty terms. Any other value will use the default behaviour of showing all terms.
     190
     191= Internal-use options for completeness =
     192
     193** You should not need to touch these, as they are meant for internal use by the plugin only**
     194
     195* `target`: the default target for a listing that doesn't show any items.
     196  * Default value: `unset`.
     197  * May only contain one value.
     198  * Must be set to a URL which will be used as the target for the letters' hyperlinks.
     199* `return`: what type of listing to show, either `listing` or `letters`.
     200  * Default value: `listing`.
     201  * May only contain one value.
     202  * Must be set to either `listing` to display the default view, or `letters` to show only the letters without any items (posts or terms).
    144203
    145204== PHP ==
     
    165224Full API documentation is available at [A-Z-Listing Reference](https://a-z-listing.com/reference/)
    166225
    167 == Multi Column Output ==
    168 
    169 If you want the multi-column output support, you need to copy the file `a-z-listing-multi-column.example.php` from the plugin inside the `templates` directory to your theme. The file needs to also be renamed to `a-z-listing.php` when copied to your theme. The **Templates and Theming** section of this Document details the functions used within templates and The Loop process this plugin follows.
     226== Multiple Column Output ==
     227
     228Multiple column layout is the default on wide screens. A letter's group of items must contain at least 15 items to create two or more columns. This is to provide a more aesthetically pleasing view when a list is short with only a few items.
    170229
    171230== Templates and Theming ==
     
    185244* `$a_z_query->the_letters()` prints the full alphabet, and links the letters that have posts to their section within the index page.
    186245* `$a_z_query->have_letters()` returns true or false depending on whether there are any letters left to loop-through. This is part of the Letter Loop.
    187 * `$a_z_query->have_items()` this behaves very similarly to Core's `have_posts()` function. It is part of the Item Loop.
     246* `$a_z_query->have_items()` behaves very similarly to Core's `have_posts()` function. It is part of the Item Loop.
    188247* `$a_z_query->the_letter()` similar to Core's `the_post()`, this will set-up the next iteration of the A-Z Listing's Letter Loop. This needs to wrap-around the Item Loop.
    189248* `$a_z_query->the_item()` similar to Core's `the_post()`, this will set-up the next iteration of the A-Z Listing's Item Loop, the same way the normal WordPress Loop works. This needs to be _within_ the Letter Loop.
     
    191250When you are within the Item Loop you may utilise all in-built WordPress Core post-related functions such as `the_content()`. Note that titles and permalinks have helper functions to cope with the A-Z Listing showing taxonomy terms (see the next section).
    192251
    193 I advise that you start with a copy of the default template or the multi-column template when customizing your own version. The supplied templates show the usage of most of the functions this plugin provides.
     252I advise that you start with a copy of the default template template when customizing your own version. The supplied templates show the usage of most of the functions this plugin provides.
    194253
    195254= Helper functions =
     
    210269= Why is the list layout completely broken? =
    211270
    212 If you are using a page-builder such as WPBakery or Elementor you need to ensure that you put the shortcode into a normal text area. Placing the shortcode into a preformatted text area will add `<pre>` tags around the listing output. These extra tags break the layout considerably.
     271If you are using a page-builder such as WPBakery or Elementor you need to ensure that you put the short-code into a normal text area. Placing the short-code into a preformatted text area will add `<pre>` tags around the listing output. These extra tags break the layout considerably.
    213272
    214273= Why is my list in a single column? =
    215274
    216 The list of items under each letter heading needs to have at least 11 items for a second column to be created. Once you hit the magic 11 items, the list will break into two columns with 6 items in the first column and 5 items in the second. When you get to 21 items a third column will be added if there is room on your page; and so-on up to a maximum of 15 columns if there is enough space, though it is unexpected that any webpage be wide enough for more than a few columns to fit. The columns will fill-up evenly once you have more than one column on the page.
    217 
    218 = How do I show posts of a different post-type (not pages) or multiple post-types (e.g. posts AND pages) =
    219 
    220 This can be achieved using the shortcode or PHP. In these examples the generic phrase `post-type-slug` is used to describe the concept. The default post types provided by WordPress are called "Posts" and "Pages". Their slugs are `post` and `page` respectively. You need to use these names in place of the examples (i.e. `your-post-type-slug`, `type1-slug`, and `type1-slug`).
    221 
    222 **Shortcode method**
     275The list of items under each letter heading needs to have at least 11 items for a second column to be created. Once you hit the magic 11 items, the list will break into two columns with 6 items in the first column and 5 items in the second. When you get to 21 items a third column will be added if there is room on your page; and so-on up to a maximum of 15 columns if there is enough space, though it is unexpected that any web-page be wide enough for more than a few columns to fit. The columns will fill-up evenly once you have more than one column on the page.
     276
     277= How do I show posts of a different post-type (not pages) or multiple post-types (e.g. posts AND pages)? =
     278
     279This can be achieved using the short-code or PHP. In these examples the generic phrase `post-type-slug` is used to describe the concept. The default post types provided by WordPress are called "Posts" and "Pages". Their slugs are `post` and `page` respectively. You need to use these names in place of the examples (i.e. `your-post-type-slug`, `type1-slug`, and `type1-slug`).
     280
     281**short-code method**
    223282
    224283*Single post-type*
     
    234293**PHP method**
    235294
    236 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     295PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    237296
    238297*Single post-type*
     
    260319The code above needs to be within a php block which is denoted by the `<?php` and `?>` pair. Depending on your theme, you might not need the opening and closing php tags shown in the above snippet; if that is the case, you are free to omit them in your code.
    261320
    262 = How do I show posts from a specific category only =
    263 
    264 This can be achieved using the shortcode or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. Each Category and Tag are then known as "terms". You need to use the slug for each individual category or tag in place of the example slugs (i.e. `term-slug`, `term1-slug`, and `term1-slug`).
    265 
    266 **Shortcode method**
     321= How do I show posts from a specific category only? =
     322
     323This can be achieved using the short-code or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. Each Category and Tag are then known as "terms". You need to use the slug for each individual category or tag in place of the example slugs (i.e. `term-slug`, `term1-slug`, and `term1-slug`).
     324
     325**short-code method**
    267326
    268327*Single term*
     
    278337**PHP method**
    279338
    280 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     339PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    281340
    282341`
     
    298357The code above needs to be within a php block which is denoted by the `<?php` and `?>` pair. Depending on your theme, you might not need the opening and closing php tags shown in the above snippet; if that is the case, you are free to omit them in your code.
    299358
    300 = How do I show terms from a taxonomy instead of posts =
    301 
    302 This can be achieved using the shortcode or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. You need to use the slug for the taxonomy in place of the example slugs (i.e. `taxonomy-slug`).
    303 
    304 **Shortcode method**
     359= How do I show terms from a taxonomy instead of posts? =
     360
     361This can be achieved using the short-code or PHP. In these examples the generic phrase `taxonomy` and `term` are used to describe the concept. The default taxonomies provided by WordPress are called "Categories" and "Tags". Their slugs are `category` and `post_tag` respectively. You need to use the slug for the taxonomy in place of the example slugs (i.e. `taxonomy-slug`).
     362
     363**short-code method**
    305364
    306365    [a-z-listing taxonomy="taxonomy-slug" display="terms"]
     
    312371**PHP method**
    313372
    314 PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a shortcode can.
     373PHP code needs to be added to your theme files, and cannot be used as post or page content in the way that a short-code can.
    315374
    316375`
     
    326385= How do I remove section targeting or limit which sections are available? =
    327386
    328 In your theme's functions.php add the following code:
     387In your theme's `functions.php` file add the following code:
    329388
    330389`
     
    340399= I am not using the short-code so the styles are not working, can I still use the in-built styles without the short-code? =
    341400
    342 Yes you can. This needs the following code added to your theme's functions.php. We purposely only display the stylesheet on pages where the short-code is active.
     401Yes you can. This needs the following code added to your theme's `functions.php` file. We purposely only display the stylesheet on pages where the short-code is active.
    343402
    344403`
     
    348407`
    349408
    350 If there is code already in your functions.php then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
     409If there is code already in your theme's `functions.php` file then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
    351410
    352411The sidebar widget styling also works in a similar manner, and will also respond to the same code above to forcibly enable it.
     
    366425`
    367426
    368 If there is code already in your functions.php then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
     427If there is code already in your theme's `functions.php` file then add just the lines between `<?php` and `?>` on the line directly after the very first instance of `<?php`.
    369428
    370429= How do I disable the in-built styling? =
     
    399458== Changelog ==
    400459
     460= 2.3.0 =
     461
     462* Add multiple taxonomy support to taxonomy terms listing.
     463* Add site health-check feature compatibility.
     464* Fix `hide-empty-terms` in a taxonomy terms listing. Previously completely broken.
     465* Fix hard-coded `admin-ajax.php` URL in widget configuration javascript.
     466* Improve documentation in the readme.txt file, which is shown on the plugin page at WordPress.org.
     467
    401468= 2.2.0 =
    402469
    403470* Add `get_the_item_post_count` and `the_item_post_count` template methods to get or display the number of posts associated with a term.
    404471* Add support for `get-all-children` when specifying a `parent-term`.
    405 * Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the shortcode.
     472* Add extra filename for template matching: `a-z-listing-$slug.php` where `$slug` is the slug of the post containing the short-code.
    406473* Deprecate PHP 5.3-5.5. Please ensure you are running at least PHP 5.6. The plugin may work on older PHP versions, but compatibility is not guaranteed.
    407 * Bugfix for incorrect behaviour of `exclude-terms` in the shortcode. Thanks go to Chris Skrzypchak for finding this.
    408 
    409 = 2.1.4 =
    410 
    411 **Bug Fix**
    412 
    413 * Fixed a spurious `NOTICE` message (shown below) when error logging is output to the browser. Thanks to the discovery by @npiper.
    414   * If your site is not showing the message below then you do not need to upgrade with any urgency.
    415 
    416 `Notice: Trying to get property of non-object in [Path-to-WordPress]/wp-content/plugins/a-z-listing/classes/class-a-z-listing.php on line 215`
    417 
    418 = 2.1.3 =
    419 
    420 **Bug Fix**
    421 
    422 * Fixed the bug reported by @ighosts22 where the letter for non-alphabetic items was not pointing at the list of items.
    423 * Fixed incorrect behaviour discovered after adding tests to the automated testing to verify that I correctly fixed the above bug.
    424 
    425 = 2.1.2 =
    426 
    427 **Bug Fix**
    428 
    429 * Post links in 2.1.0 and 2.1.1 included a series of `%09` which caused visitors' clicks to return a 404 Not Found error. Thanks to @forestpump for their effort in finding the problem and highlighting the fix.
    430 
    431 = 2.1.1 =
    432 
    433 **Bug Fix**
    434 
    435 * Replace hardcoded path to `admin-ajax.php` in widget administration javascript.
    436   * This release fixes the widget administration form for sites running in a path similar to https://example.com/wp/. You should install this fix if your site is a configured in a subfolder to be able to successfully configure the widget.
    437   * Sites running in the top-level, e.g. https://example.com/, already work correctly and their behaviour is unchanged by this fix. You do not need to hurry to update if your site is configured at the top-level without a subfolder.
    438 
    439 = 2.1.0 =
    440 
    441 **Bug Fixes**
    442 
    443 * Fix widget configuration autocomplete fields for target post and parent post in the theme customizer
    444 * Fix taxonomy-term-filtered listings displaying all posts (e.g. shortcodes of the form `[a-z-listing taxonomy="category" terms="term"])
    445 * Fix `get_the_item_object()` to work with old-style overridden indices
    446 * Fix `get_the_item_object()` to correctly extract the item ID and load the correct item
    447 * Improve javascript on the widget configuration
    448 * Clarified the examples with explanations about "post types", "taxonomies", and "terms" to explain what each of these mean.
    449 
    450 **New Features**
    451 
    452 * Add parent-page attribute to the shortcode
    453 * Add simpler and safer filter for overriding the index letter for an item
    454 * Add simpler and safer filter for overriding the title for an item
    455 * Add new function for fetching meta data in a template: `$a_z_listing->get_item_meta()`
    456 * Allow exclude-terms to be used with display="posts"
    457 * Moved template loading function outside of the `A_Z_Query` class to prevent accidental access to the plugin internal structure
    458 
    459 = 2.0.6 =
    460 
    461 * Fix widget target post support
    462 * Fix filtering posts by multiple taxonomy terms
    463 * Fix styling error causing two or more posts to sometimes appear on the same line
    464 * Minor style tweak to fix short listings, and long titles
    465 * Fix broken styling in 2.0.0
    466 * Fix javascript error on widgets screen
    467 
    468 = 2.0.0 =
    469 
    470 * Improved widget configuration.
    471 * New attribute added to the shortcode when `display="posts"`:
    472   * `exclude-posts`: remove specific posts from the list
    473 * New attributes added to the shortcode when `display="terms"`:
    474   * `exclude-terms`: sets the terms to exclude from display
    475   * `parent-term`: set the parent that all displayed terms must be organised under
    476   * `hide-empty-terms`: hide terms that have no posts associated
    477 * Fix the stylesheet to better cope with variances in font-size and text length in the alphabet links list and widget.
    478 * Introduce PHP classes for adding numbers and grouping to the alphabet. Allows unhooking from the filters to undo the changes, where previously you could not unhook these modifications once they'd been applied.
    479 
    480 **BREAKING CHANGES**
     474* Bugfix for incorrect behaviour of `exclude-terms` in the short-code. Thanks go to Chris Skrzypchak for finding this.
     475
     476= BREAKING CHANGES in 2.0.0+ =
    481477
    482478*Multi column example*
  • a-z-listing/trunk/scripts/a-z-listing-tabs.js

    r2003543 r2092139  
    33    const tabs = document.getElementById( 'az-tabs' );
    44    if ( tabs ) {
    5         let link;
    6         const letters = tabs.getElementById( 'letters' );
    7         if ( letters ) {
    8             link = letters.querySelector( `a[href="${window.location.hash}"]` );
    9         }
     5        const link = tabs.querySelector( `#letters a[href="${window.location.hash}"]` );
    106
    117        if ( window.location.hash && link ) {
  • a-z-listing/trunk/scripts/a-z-listing-widget-admin.js

    r2004405 r2092139  
    5656                source: function( post_title, response ) {
    5757                    jQuery.ajax( {
    58                         url:      a_z_listing_widget_admin.ajax_url || 'admin-ajax.php',
     58                        url:      a_z_listing_widget_admin.ajax_url || '/wp-admin/admin-ajax.php',
    5959                        type:     'POST',
    6060                        dataType: 'json',
     
    8585                source: function( post_title, response ) {
    8686                    jQuery.ajax( {
    87                         url:      '/wp-admin/admin-ajax.php',
     87                        url:      a_z_listing_widget_admin.ajax_url || '/wp-admin/admin-ajax.php',
    8888                        type:     'POST',
    8989                        dataType: 'json',
  • a-z-listing/trunk/widgets/class-a-z-listing-widget.php

    r2056348 r2092139  
    6666        $widget_title_name = $this->get_field_name( 'title' );
    6767
    68         $display_type      = ( 'terms' === $instance['type'] ) ? 'terms' : 'posts';
     68        $display_type      = ( isset( $instance['type'] ) && 'terms' === $instance['type'] ) ? 'terms' : 'posts';
    6969        $display_type_id   = $this->get_field_id( 'type' );
    7070        $display_type_name = $this->get_field_name( 'type' );
Note: See TracChangeset for help on using the changeset viewer.