I am also get the issue same as you and finally I got the solution.
We have to add $query->is_main_query() in IF CONDITION.
if( 'trip' == $type && is_admin() && $pagenow=='edit.php' && isset($_GET['tripstatus']) && $_GET['tripstatus'] != '' && $query->is_main_query()) {
$value = $_GET['tripstatus'];
$query->query_vars['meta_key'] = 'trip_status';
$query->query_vars['meta_value'] = $value;
}
I hope it will help you to get the answer.
Related Posts:
- How to set a custom path, for ajax image upload folder in admin?
- How to call function at the bottom of post using plugin?
- WordPress php filter admin_body_class not working
- Accessing the database from a plugin outside of action hooks
- How can I remove a function that has been added to wordpress with add_filter?
- Can I remove or edit an include() from a function with a filter?
- How can I modify this code to make the search box include tags and meta
- How to Create custom block for displaying information in content section which act like shortcode
- using filter and hook inside class
- Add custom filter to register data in array
- Custom Filtering date with newsletter
- Display featured posts first, then display all others within a specific category in WordPress
- Query multiple custom post types in single loop
- error_log() output for print_r() appearing on page
- Apply class to every paragraph that holds image?
- Allow only 1 taxonomy per custom post type [duplicate]
- Do I require the use of nonce?
- Retrieve multiple values passed to a single attribute in a shortcode
- How can I hook into and edit the text of a wp_nav_menu tag?
- How to change date language without changing the entire site language?
- Check if page parent has certain template
- Delete post revisions on post publish
- How to sort results from a custom database table
- OOP Plugin Development. Including external object
- Authenticating to WordPress, using my own authentication two-factor system
- Why do filters/actions require an argument count?
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- Create table in database when activating plugin
- Problem with WordPress Ajax form
- Getting my head round WordPress filter
- allow user to select pages from dropdown in my plugin
- Using Font Awesome as post thumbnail
- admin-ajax.php responding with 0
- How to use return in my custom function instead of echo
- WordPress – query 5 posts with a specific post in top
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- custom shortcode will not display the wrapped content
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- Common abstract class for plugins
- How to get a list of all possible values of a specific user meta key?
- Remove a filter added by a plugin
- Same log message keeps on printing to debug.log file thousand of times
- How can i upload images in an admin page?
- Create WP_Query to search for posts by their categories or their parent/child categories
- add_action shortcut?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- Set WP_query ‘order’ option by another tables value
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Remove the first 5 characters of the_title and orderby that
- Update results, Before deleting the related category [closed]
- Adding function to Genesis genesis_header [closed]
- Redirect to another page using contact form 7? [closed]
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- How to hook code to show after the_content?
- Using and saving custom dropdown boxes on user profiles
- Problem with AJAX in wordpress plugin
- Add meta tags to a custom header
- Ajax filter button display all posts
- Can a plugin redirect product page based on IF condition?
- Save html content of a widget textarea
- Why does my settings form redirect to the homepage?
- Custom query vars filters problem with pagination
- How to override a plugins script
- WordPress PHP syntax doesn’t seem to be working correctly
- Woocommerce custom Plugin in wordpress [closed]
- Must filter functions receive all arguments passed to them?
- Variation prices breakdown only for single product page
- array wordpress when get is null
- Plugin won’t output characters with diacritics properly
- WP Hook Before a post is created
- ACF relationship on user profile page used for allowed access
- Store user form submitted information in post type
- Problem with my Login Plugin
- How to return html as a string from php for WordPress
- Taxonomy Child Term, Counter is staying on 0
- How to disable sub menu items from being created?
- Why does a header location on admin_head remove the query var I’m setting in the location?
- Need help with format of nested array in MySQL
- Offset with ajax load more posts duplicates
- How to add delete, approve, spam Links to Comments
- Setting at job with shortcode not working
- Run code before WordPress loads and insert data into WP if need be
- PHP: Why does my code work in index.php but not a widget?
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- How to add custom checkout field in user details mail template
- Keeping the previous get value and add another value when submitted
- How to insert a variable into a query parameter?
- WP_Query not returning results
- I’m not able to get access $wpdb in my php file in wordpress
- Assign new post author IF another user in custom field on post transition
- How do I change the Go To Categories link in the term_updated_messages
- How to change wp-admin and wp-login urls
- Woocommerce Convert existing order to the cart
- Redirect posts to post editor page based on query string
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end
- Issue with WordPress Plugin Activation Hook and Table Creation
- Too few arguments – wp_login action
- How to allow searching a custom meta key in admin list table?