And for displaying result for Filter then try this code
add_filter( 'parse_query', 'prefix_parse_filter' );
function prefix_parse_filter($query) {
global $pagenow;
$current_page = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';
if ( is_admin() &&
'competition' == $current_page &&
'edit.php' == $pagenow &&
isset( $_GET['competition-name'] ) &&
$_GET['competition-name'] != '' ) {
$competition_name = $_GET['competition-name'];
$query->query_vars['meta_key'] = 'competition_name';
$query->query_vars['meta_value'] = $competition_name;
$query->query_vars['meta_compare'] = '=';
}
}
Change the meta key and meta value as required.
I have taken “competition name as meta_key and “competition-name” as select drop down name.
Related Posts:
- Media library – Limit images to custom post type
- How can I filter posts by post_parent in the admin?
- Filter by custom Field for Custom post type Admin Listing
- Unable to filter on field on edit.php page
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- How can I add a column in the wp_list_table of the admin area?
- Archive filter disappears on no results?
- Add html to cpt main page / admin edit.php
- How to add a post slug to a url?
- Filtering posts list table
- sortable columns for multiple custom post types not working
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- Query filter by value in meta_value array
- Is there any filter to add a custom attribute to the tag in admin panel?
- Filter posts by their related field’s custom field
- Help Adding filter to Add Media button for custom post type
- Grouping and paging CPT events by month with custom field date
- Filter Content on all Post Types
- using ACF datepicker to filter posts on a page
- Collection of fields in a single post
- Filter page ID outside the loop and order
- How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- Filtering a WP_Query meta_query by numeric values isn’t working
- Filter admin columns by custom post field value
- Populate a ACF Select Dropdown from Custom Post Type
- WP Admin default view mode for Custom Post Type
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- How to get search results in the backend admin on a custom post type?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Exclude custom function content from certain pages
- Filter get_categories() for taxonomy term in WordPress
- Count custom post types with a specific meta value
- Change admin post thumbnail size for custom post type only
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- WordPress User Roles, Custom Post Types, and Admin views
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Add $more_link_text parameter to the_excerpt()
- ACF simple text field value not showing
- Filter categories of posts with checkboxes
- Post Object Filter by Custom Field, not title (ACF)
- Remove rows in the manage post/page view
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Access $post object when adding custom columns to list table
- Setting proper query for multiple custom admin filters
- Custom fields vs. Custom post types for a Portfolio Website
- How can I see a list of my Custom Post Types of the last term I was in?
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Add custom ID to CPT posts only create not update
- How to filter wp_list_categories output with some custom post type meta query?
- WP_Query order by custom field, then randomly order some of results
- creat filter with wp_query
- How to render a custom post type template with custom fields using shortcode
- How to query WordPress posts bycustom field with a max characters’ length
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Categories filtering in new post
- Specific routing for CPT
- How To Import CPT With Only Few TEXT ACF Fields From Front End?
- wordpress remove views from action links in a custom post
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- List of users that clicked a ‘Join’ button at single post
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- set_query_params using custom params defined in functions file?
- How to define the template for custom posts?
- Query entries from custom post type in an ACF flexible content field
- How to export custom post type with ACF to individual file with automation?
- Filter posts of custom post type by meta key in (List All Section)
- Limit search field to just search a custom post type with custom fields
- Require custom post type if is_admin() – template doesn’t show up?
- Custom field with Types: get custom field’s value label (of type select)
- using the loop in custom meta is messing up ‘add new’ post type
- Show posts associated with ACF post object and custom post type
- Display custom post front end filter by ACF equals current user
- Create if else for post types in WP_Query ‘post__in’ values
- Best way to fix bad count on All | Mine | Published
- CPT email notification including only new value custom fields
- Save_post acf data not updating category of post type
- Display Specific Posts at Start of Loop
- How to display custom post type pagination buttons when processing AJAX request
- Adding specific custom fields (images) to post excerpt
- filter using custom fields
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- CPT: execute code after load if parameter is set
- ACF Post Content Not Being Searched
- Fixed custom fields depending on posttype/category
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Exclude Custom Post Type from shared Custom Taxonomy
- How to filter posts by categories?
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- How to I add count of custom posts listed in a post as a prefix to its title
- Admin menu link with variable
- Display custom post type attached media file sizes
- Custom post type template not loading from plugin
- Code output help please! WordPress> ACF > Relationship > Post Object
- Modify wp_title for custom post types using custom fields data?
- ACF Custom post type name changing issue