finally found the solution when i enter all the custom post status to public it declare the post_type to default post as global so applied filter to change the global post_type based what type request get in URL
function publishPress_allPost_pre_get_posts( &$wp_query )
{
if ( is_admin() && array_key_exists( 'post_type', $_GET ) ) {
$wp_query->set( 'post_type', $_GET['post_type'] );
add_filter( 'the_posts', 'publishPress_allPost_the_posts', 10, 2 );
}
}
function publishPress_allPost_the_posts( $posts, &$wp_query )
{
$wp_query->set( 'post_type', $GLOBALS['post_type'] );
return $posts;
}
Related Posts:
- How do I check if a posts status is set to draft or pending?
- Auto-generated posts not showing in backend (but being counted!)
- Update postmeta Parent when post_status child change
- How to define which register_post_status goes to which register_post_type?
- Published post auto change status to pending after 90 days
- Custom Post type to Woocommerce Product type
- How to display custom field in product description?
- Show custom post status when logged out
- Custom Post Status & Taxonomies
- I am having a problem with fetching product data in the Gutenberg block editor
- Show the same Article Available in Other Categories
- Getting posts under the custom post type ui category
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Get post from custom post type order by two taxonomies
- Display only one post each WEEK
- List children on child post
- Restrict custom post type from appearing with ?post_types=
- Show custom post type filtered by category
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- Display random posts, but omit the post it is on?
- How do I do this with WordPress? Taxonomies?
- Disable block with taxonomies at post page
- I would like to have different styles for my posts based on the content of each post
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- Custom date changer post_date => future – missed schedule error
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- Post image in WordPress not appearing on home page
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Meta query for custom post type ignored in main query
- Changing custom type name hides the posts
- Display Ad on Specific Categories
- Hiding posts by other users and non-logged in
- changing meta value and meta key of price field
- Update Post Meta for a logged in user
- Add custom field to Posts and sort by it
- Add custom post type settings to wordress default posts
- Featured image overlay when changing post status
- Get related posts of child term of custom post type
- Two Custom Post Types Many to Many Relationship
- Problem with displaying posts in the CPT category
- JS innerhtml changing style when using AJAX
- Custom post type suppress transition from future to publish
- Show titles, date of all posts on single category page
- Woocommerce search pagination not working
- WooCommerce Customer Role Delete Custom Post Type
- Side effects of Script and Iframe in post
- WooCommerce sort products by the actual product width(not the shipping width)
- Manage custom post type in woocommerce /my-account/ page
- How to change the post type a theme shows by default?
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- Woocommerce custom field search in custom post type [closed]
- No Permission to add new Page, Post or CPT with Admin role
- custom post type category count shortcode
- Portfolio Page for Classic Posts
- Add post location with mile radius allowing search
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Modifying custom post type created by WooCommerce
- Set up post page like JAMA articles
- Hide a widget inside a div on specific type of post
- Custom Post Slug same as Parents Category Slug
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Admin Column does not populate with data
- Allow add new post access to custom post but not wp post for some role
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Removing all post statuses from a Custom Post Type
- Display Woocommerce Orders for specific author [closed]
- Allow users to create posts without logging in?
- How to get all tags of a custom post type by id
- Add custom post type drafts to RSS feed
- Load Next Posts With AJAX not working with custom post type
- Limit the post for differents custom post type in the same wp_query
- 2 Different Custom Post Types in Submenu
- How to assign classes to all elements?
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Some posts from custom post type to subdomains
- How can i create an custom post template for an specific post category? [closed]
- How to sort posts in a custom post type by title in ascending order by default?
- Redirect to another page using contact form 7? [closed]
- WP the_posts() on single-cars.php get category link
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- Permalink misbehaving in Custom Post Types
- Sort posts in loop by the WooCommerce Membership of the author
- Check post on publish for blank title
- how to check if custom post title exists or not?
- Different Limit number of post on different archive page
- How to change “post_class()” for a custom post type?