-
-
Save searchwpgists/0257877e06a1bd3527b2673aaaa67a90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// UNCOMMENT THIS IF YOU WANT TO USE SHORTCODES IN WIDGETS | |
// add_filter( 'widget_text', 'do_shortcode' ); | |
// output the categories dropdown | |
function my_searchwp_shortcodes_inject_categories() { | |
echo '<p class="searchwp-shortcodes-categories">'; | |
// for more information see http://codex.wordpress.org/Function_Reference/wp_dropdown_categories | |
$swp_cat_dropdown_args = array( | |
'show_option_all' => __( 'Any Category' ), | |
'name' => 'swp_category_limiter', | |
); | |
wp_dropdown_categories( $swp_cat_dropdown_args ); | |
echo '</p>'; | |
} | |
add_action( 'searchwp_shortcodes_after_input', 'my_searchwp_shortcodes_inject_categories' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment