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
- When to use Exceptions vs Error Objects vs just plain false/null
- The correct method to pass query vars in AJAX using ajaxurl
- WordPress URL Rewrite not working
- How to overwrite youtube embed?
- How to find objects by terms
- simple wordpress ajax plugin not working when not logged in
- Filter the blog title displayed in the header
- How to get user by display_name with WP_User_Query
- Saving metabox repeatable fields
- how to create and show sessions in word press?
- body_class filter – Is there a better way to write this code?
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- How to get to a specific position in wp_query?
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Get all user meta by meta key instead of ID
- Custom query to filter posts that have current post as a taxonomy [closed]
- Delete a WordPress transient from a shortcode on Page/Post update
- Plugin CSS not enqueing
- Is it acceptable to treat a filter like an action?
- mysql query from wordpress page using custom table
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- Edit incorrect password message WordPress
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- How to call plugin function per site in a multisite?
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- How wp-cron can run in background if PHP is single threaded?
- Options API get_option() and update_option() Not Correctly Updating or Returning
- Unique icons next to each WordPress menu item
- How to pre populate a form field with a link of a current user’s author profile?
- wp_head function not outputting
- How to make own crop image function for WordPress plugin
- Check if variable is set in filter
- wp_insert_post: array only. wp_update_post: array|object (?)
- Content filter won’t work
- working with term_relationships table
- Building a REST API for your web app exposes primary keys of DB records?
- Warning: in_array() null given in PHP function
- How do I add custom HTML to the content of an archive page’s posts?
- How do I create a secondary version of the_content
- Custom Registration username_exists / email_exists
- How can I search all plugins for composer’s vendor/autoload.php?
- Action Hook Inside WordPress Plugin Shortcode
- Submit form to db
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- WordPress doesn’t load HTML
- WordPress Conditional / Multiple Taxonomy Query
- PHP using external anonymous function inside class
- Show related products by attribute based and certain conditions
- Add Pre-Defined Value to Click Counter in WordPress
- Change the “Show All” button in a WordPress Portfolio Filter
- Drop down question
- code that I can run, or a plug in to show what sql tables something pulls information from
- Automatic email message after manual user approval
- custom mailchimp form using HTTP API
- How to override theme’s public static function inside of a trait?
- pass datetime using wp_localize_script to frontend from settings page
- add custom metabox to media library custom widget
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Enqueue sripts and styles only if function is called
- Add widget area from visual editor
- Register/enqueue scripts only on certain admin pages
- Looping through custom data in a custom table to display all items in a post
- not able to access $_POST on backend profile update
- Let user select the number of posts shown per page jquery error
- dynamically change content of div with php
- Custom Plugin Develoment, Form Action
- WordPress Query Crashes Browser
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- Plugin Modification Change Functionality For Logged User Only
- INCOMING: Wall of code for form and $_POST, not updating custom field’s value
- add shortcode heading showing multiple time
- Check if values exists DB
- Trying to exclude posts from a category on the home page
- Search box background on a different page template
- WP multisite network plugin fails to see classes loaded with spl autoload
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- What is this mark for “? function()” [closed]
- Query Concatenation
- using a shortcode in a hyperlink
- 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