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
- Edit password change email text or disable it
- Using send_password_email filter after wp_update_user
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- Add htaccess rules with insert_with_markers at beginning of htaccess
- custom shortcode will not display the wrapped content
- Multiple choice in a custom taxonomy
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Insert array data on plugin activation
- Will simple function names in a class structure conflict with other plugins?
- Do my defines need to be unique?
- Get all user meta by meta key instead of ID
- Problem adding class to body_class
- Run a filter when a walker runs
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins
- Why is variable not working on custom sql query using wpdb?
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- How to get a list of all possible values of a specific user meta key?
- Custom query to filter posts that have current post as a taxonomy [closed]
- WP add_action factory
- Combine two filters into a single call
- wp_loaded hook block script enquequing
- Remove a filter added by a plugin
- Change the site tagline (or similar) based on current page
- WP nonce invalid
- Get stock by custom meta field on all Woocommerce variable products
- woocommerce subscriptions – get expiration date [closed]
- Same log message keeps on printing to debug.log file thousand of times
- Handling Body class based on Template
- Any possible way to make $wpdb->get_results() return anything else than array?
- Get_avatar filter?
- WooCommerce Related Products by Attribute
- Adding Default Settings to Theme My Login plugin
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Add a class to the anchor tag on HTML5 gallery
- Nesting if statements to echo only one string based on what tag was filtered?
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Input type search in Menu
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Echo a hierarchical list of post data from custom fields
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP Query with custom Shortcode
- add_action shortcut?
- Storing Array from returned database query and using the array in a new query
- Is it acceptable to treat a filter like an action?
- How to access global variable $menu inside a class function
- mysql query from wordpress page using custom table
- WordPress 3.2 query_posts and pagination, permalinks issue
- only show container with next/prev links if they exist?
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- What query string parameter is available for index.php, that works for both pages and blog articles?
- ACF: how do I get the fields and its values of a specific group?
- How to sanitize any integer input field in wordpress?
- How to control WordPress image metadata (using Imagick)?
- Edit incorrect password message WordPress
- How do I add custom bulk actions to multiple custom post types?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Add data attribute to each li in menu
- Show prices with tax in Woocommerce Mini Cart [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- Ajax category filtering products default show all
- Custom user login page by creating a plugin
- Add a specific part of current category page url to shortcode
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- Why does my callback function not work with this custom filter hook?
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- How to upload a file to a folder named after the user_id via plugin
- Reprinting tags with all attributes
- Set WP_query ‘order’ option by another tables value
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?