a_z_shortcode_handler( array $attributes )
Handle the a-z-listing shortcode
Advertisements
Description
Parameters
- $attributes
(array) (Required) Provided by WordPress core. Contains the shortcode attributes.
Return
(string) The A-Z Listing HTML.
Source
File: functions/shortcode.php
function a_z_shortcode_handler( $attributes ) { $attributes = shortcode_atts( array( 'column-count' => 1, 'minimum-per-column' => 10, 'heading-level' => 2, 'post-type' => 'page', ), $attributes, 'a-z-listing' ); $post_types = explode( ',', $attributes['post-type'] ); $post_types = array_unique( $post_types ); $post_types = array_map( function( $item ) { return trim( $item ); }, $post_types ); $query = array( 'post_type' => $post_types ); $a_z_query = new A_Z_Listing( $query ); return $a_z_query->get_the_listing(); }
Changelog
Version | Description |
---|---|
2.0.0 | Add parent-term and hide-empty parameters. |
1.8.0 | Fix numbers attribute when selecting to display terms. Add grouping to numbers via attribute. Add alphabet override via new attribute. |
1.7.0 | Add numbers attribute to append or prepend numerics to the listing. |
1.0.0 | Introduced. |
More Information
You are currently logged out. To view tickets you must first login.
Advertisements