wp_dropdown_categories
has a filter applied to the output that is called right before the function returns or echos the output.
With this you can add a filter to your funtions.php file that manipulates the select field and adds a multiple attribute to it.
The filter below would search for the select opening tag and add the multiple attribute to it. You can also add the size attribute to control the number of items displayed at a time.
add_filter( 'wp_dropdown_cats', 'dropdown_filter', 10, 2);
function dropdown_filter( $output, $r ) {
$output = preg_replace( '/<select (.*?) >/', '<select $1 size="5" multiple>', $output);
return $output;
}
Related Posts:
- Form and custom query problem
- How to Optimize WP site for millions of posts
- Differences between wpdb->get_results() and wpdb->query()
- Get Terms by IDs with IDs order
- wpdb get posts by taxonomy SQL
- How many WordPress SQL Queries per page?
- Slow wp_enqueue_media()
- query multiple taxonomy and show post count
- Get a user’s most recent post title
- Categories and products in random order
- $query->query_var[‘post_type’] not set for pages
- Different Main Navigation per category
- Show recent products first but “sold out last” in query
- Show All Posts Insert Edit Link
- Get IDs of posts currently visible on archive
- Get posts by category with pure SQL query
- can’t get query to order posts by acf datepicker
- Custom query to get terms from post ids
- Help with wordpress custom query and advanced custom fields plugin
- WordPress query by category, sorted by custom field
- Mysql / WordPress killing my server with 80k users [closed]
- Query all posts and not repeat the same tag
- Deleting data from a custom table in WordPress
- How many queries are normal to execute on a WP site?
- How to optimize my query filtering out unwanted data?
- Remove posts from query for events whose start date has passed
- Change searched term
- Insert static element only once in query archive
- How to run a mysql query when admin updates user role?
- Error when using setup_postdata()
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- Query Posts By Post Publish Date, but sort by Custom Meta Key
- Getting post data from private page
- How to execute a SQL-query which contains multiple queries using $wpdb->query?
- Missing posts in a query
- Alter a specific query on WordPress
- Only show upcoming event or current events
- SQL query to select posts from multiple categories
- Why a URL with a query is always slower than that without a query?
- Maintaining Queries in URL
- Protect sequence of pages with same password for each of two groups of users
- How is it possible to get top comment from all children?
- How to orderby multiple meta fields with another meta query
- Select Query demand excesive resources [closed]
- Create Indexes for Slow Queries
- Query to get number of posts last week
- Query posts using meta_key
- wpdb query problem to access previous 3 days posts
- I want to create a filter for the query string is this possible?
- Exclude categories from the_category();
- How can i show all categories using wp query?
- All in One Calendar Plugin Custom Post Type Query [closed]
- Get Posts from Last 24 hours and Sort them via GD Star Rating
- Query returning same results even though the ID changes
- How to get events using multiple custom meta fields?
- Why my query ‘REPLACE INTO…’ does not work?
- Restrict query to last day with posts
- Custom query object with Simple-Fields custom date field
- How to read the value of a WordPress $query associative array (hash) key
- Query posts based on previous query
- Waypoints + infinite scroll with custom query
- Customizing the_tags output?
- Querying with WP query using meta key price
- Re-sort get_posts query results
- How do I get all results from my query
- Taxonomy filter under Polylang
- How to create an overview of posts with the same tag?
- create a link to a random post within the current category
- Pagination not working on custom post types with rewrite slug
- JetEngine Query Builder – order by value from repeater
- Change pure SQL database query to WordPress post query?
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- custom sorting media with multiple filters – error: not unique table/alias: wp_postmeta
- How can I get posts by 2 meta keys, prioritising one of them?
- Heavy meta query causing SQL crash
- SQL query to list all posts of specific post type with a specific set of associated postmeta values as a column
- Sort by postmeta on when searching
- Pulling an ACF into a query
- Speed up search query that searches in post meta?
- implementing my wp_query using $wpdb class
- Problem on wpdb queries, wp_insert_post, wp_insert_user etc. The query runs twice
- Using cron for multiple queries
- very slow wordpress query with default query
- Sort loop with query in the link
- About WP’s save_post action
- Multilingual WordPress page – using URL to determine language?
- Custom Query problem access the values
- Set posts per page for parent category and it’s all children
- Exclude sticky posts from query
- list or get meta_key where meta_value is ‘something’
- If more than 1 image show post link?
- WP_Query with checkbox meta_query – WordPress [duplicate]
- Rewrite Query_Var URL Parameter with Slug
- How to query different categories on index?
- How to specify what kind of is_single post?
- Can’t See Media Queries with Inspect Tool [closed]
- Print data from wordpress sql query
- Can I create my own query in wordpress with traditional methods?
- How to show sticky posts on all pages of the pagination, not just the first page?