I can’t use is_singular( 'my_post_type' )
in pre_get_posts because the queried object is not set at this point.
I can use instead the post_type query parameter.
Related Posts:
- How to set up a private custom post type that is accessible in the administrative dashboard?
- Load a script just to custom post type in admin
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- New post status for custom post type
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Customize Edit Post screen for Custom Post Types?
- Filter by custom field in custom post type on admin page
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Merge two custom post types into one admin page?
- Remove the “View” Link in Post Admin
- Multiple custom post types under one admin menu
- How can I change the admin search posts fields?
- Prevent pre_get_posts filter on specific post type
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Add “Last Edited by” column to custom post type list table
- How can I filter posts by post_parent in the admin?
- $query->set in pre_get_posts is unintentionally affecting the backend
- Filter custom post types in admin not working
- Custom post type admin search
- Ordering posts by custom taxonomy in admin area
- Create a dropdown with Custom Post Types as option in admin
- How to put custom post types on front page
- How to add custom columns to Custom Post Type admin screen
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Filter admin columns by custom post field value
- Is it OK to move admin menu items?
- Add Custom Post Type to Current Query
- How to show more posts on an archive page?
- Restrict a Post Types Post Status
- Custom post status and preview
- Include post id[s] into WP_Query()
- Pre get posts for single post
- Prevent reload confirmation after AJAX save
- Filter by custom Field for Custom post type Admin Listing
- jQuery UI in Admin (Best Practice?)
- Admin Post Update Redirection to Posts Screen
- Exclude add_filter from the admin
- How to get my Custom Post Type to display in Recent Posts using “pre_get_posts”
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Custom Post type sort order not working in the admin area
- Pre_get_posts Gives 404 on Custom Post Type
- Custom Post Status not showing in Custom Post Type ALL view
- Custom admin columns for ALL custom post types
- How to get search results in the backend admin on a custom post type?
- filter search result with custom post type meta key
- Order posts by (hierarchical custom) taxonomy terms and term children
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Add custom column to custom post type overview in backend
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Setting a title on a Custom Post Type that doesn’t support titles
- Limiting number of custom posts shown on taxonomy page
- Include custom post type in “all posts”
- Unable to filter on field on edit.php page
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- Can’t sort order of wp_query with 2 meta keys
- Sort custom post types by last name in the backend
- Displaying custom post type on category pages but not on blog listings
- delete custom post based on custom field date
- No results searching custom post type in admin panel
- Custom post type with tags
- How do I check if a posts status is set to draft or pending?
- How to add post_author column to custom post type
- Adding help information to custom post edit page
- Only Show an Author Their Custom Post Types
- pre get posts changing the query
- Error after deleting Custom Post Type with a function (no trash used)
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Custom Post Type and taxonomies’s labels localization not working
- How to change post status link order(priority) on cpt listing page
- Exclude categories For Custom post types
- pre_get_posts not firing at all
- Admin menu post type
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Fetch post meta in the same query as the main loop
- Problem to show custom post type in archive page category wise
- Redirect preview single post link to a page
- Custom Post Type Causing Admin Sidebar UI Issue
- Using $seed on a custom post type for randomly displayed posts
- Adding custom post types to the default loop, yet only posts that has terms from the core taxonomies
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- How do I sort post listing by child post count?
- pre_get_posts action doesn’t work
- How to change the default orderby from “Date” to e.g. “Title” or my custom column in content type records list in admin?
- custom post types, pre_get_posts, wp_list_categories
- Change column of row action (Quick Edit) links in WP_List_Table
- Collection of fields in a single post
- Prevent users from changing post status
- Display read only info on admin, custom post page
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- How to set the Screen Options for Users in the Admin Panel?
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Issue displaying multiple TinyMCE editors with WPAlchemy
- Comments not working (error not allowed) on posts with custom post status
- Admin menu link with variable
- Sorting by Title for Post Archive Categories for Custom Post Type
- How can I incldue a “private” post type in a loop for public users?
- Search for portfolio tags & mixing portfoliotags and post tags
- Can’t publish custom type posts that don’t support title and editor, instead they’re saved as draft