Well…
If it helps, I’ve been back to your shortcode, but with some changes on the shortcode handler (which is not nice, I know, unless you add this to a future version ?? ):
###################
function a_z_shortcode_handler( $attributes ) {
$attributes = shortcode_atts(
array(
'column-count' => 1,
'minimum-per-column' => 10,
'heading-level' => 2,
'display' => 'posts',
'post-type' => 'page',
'taxonomy' => '',
'terms' => '',
'numbers' => 'none',
//<XXX
'category-not-in' => '',
//XXX>
), $attributes, 'a-z-listing'
);
if ( ! empty( $attributes['taxonomy'] ) && 'terms' === $attributes['display'] ) {
$a_z_query = new A_Z_Listing( $attributes['taxonomy'] );
return $a_z_query->get_the_listing();
}
//<XXX
$excludecat = explode( ',', $attributes['category-not-in'] );
$excludecat = array_map( 'trim', $excludecat );
$excludecat = array_unique( $excludecat );
//XXX>
$post_types = explode( ',', $attributes['post-type'] );
$post_types = array_map( 'trim', $post_types );
$post_types = array_unique( $post_types );
$query = array(
'post_type' => $post_types,
//<XXX
'category__not_in' => $excludecat,
//XXX>
);
###################
and the shortcode example:
[a-z-listing post-type="post" taxonomy="category" terms="horses" orderby="postname" category-not-in="1,53"]
My other concern now is to index the listing based on slug and not title…
Meaning I want my posts to be sorted and grouped by letters based on slug (postname), but with titles displayed below the letters
example:
A
Mickael Andrew
D
Katie Douglas
(and the slugs being andrew-mickael, douglas-katie)
The “orderby” I used before seems not to work on “tax_query” and I don’t want to go too deep into your class ??
Thanks!