Great idea. I added this to the latest release + fixed a few minor issues with WP_DEBUG set to true. As of version 0.3, you can now filter the text. Here are a few examples:
/**
* Filter dropdown text for all taxonomies.
*/
add_filter( 'taxonomy-widget-show-option-none', 'mytheme_show_options_none' );
function mytheme_show_options_none( $text ) {
return 'Custom text for all taxonomies.';
}
/**
* Filter dropdown text for the category taxonomy.
*/
add_filter( 'taxonomy-widget-show-option-none-category', 'mytheme_show_options_none_category' );
function mytheme_show_options_none_category( $text ) {
return 'Custom category text.';
}
/**
* Filter dropdown text for the post_tags taxonomy.
*/
add_filter( 'taxonomy-widget-show-option-none-post_tag', 'mytheme_show_options_none_tags' );
function mytheme_show_options_none_tags( $text ) {
return 'Custom tag text.';
}
Thread Starter
cjk
(@loomeinimene)
Sweet π
But if I am using 2 or more Taxonomy widgets on page, how to give each a different ‘Please Choose’ text?
Do you have 2 dropdowns for the same taxonomy on one page?
Thread Starter
cjk
(@loomeinimene)
No. I have 2 dropdowns for separate taxonomys.
Right on. Looks at the bottom two code snippets in my post above. One changes only categories while the other changes only tags. You can use the same type of filter for any custom taxonomy that you have set up. The filter slug is dynamic:
‘taxonomy-widget-show-option-none-taxonomy-name‘
Thread Starter
cjk
(@loomeinimene)
Oh, got it π
Thanks for fast responds!
No problem. Please mark thread as resolved if this solved your problem.