When using this hook, your function receives two parameters, onde of them is the slug of the current post_type;
<?php
function my_post_type_filter($post_type) {
$post_slug = $post_type;
if( $post_slug == 'the_post_type_slug') {
// Do something
}
}
add_action( 'restrict_manage_posts', 'my_post_type_filter' );
?>
To learn more about this hook check the Docs.
Related Posts:
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Add filter to wp_dropdown_pages() or wp_dropdown_categories() – no select container?
- Search results sorted by post types
- page_attributes_dropdown_pages_args filter does not work
- How to elect position of new item output in a dropdown when using add_filter
- Not able to change wp_title using add_filter
- How to hook a filter to catch get_post_meta when alternate a custom field output?
- Changing JPEG compression depending on image size
- How to add headers to outgoing email?
- LESS CSS enqueue_style with add_filter to change rel attribute
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- Remove description from on Home
- add_filter to youtube embeds?
- How can I detect if a user changes their password?
- SSL certificate for the host could not be verified
- Store source permalink on XMLRPC calls
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- Customise Jetpack Publicize text
- Can’t change a label in woocommerce with the normal filter
- WordPress RSS feed – filter RSS content by custom field value
- What is the filter hook for custom fields content?
- Filter keywords from search query
- Add class to woocommerce checkout body based on filter [closed]
- changing variable through filters or action hooks
- filter the_title problem in nav
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- How to replace any occurence of Gravatars with a local placeholder image?
- Ignore dots when searching in the media library?
- Explanation for remove_filter used in the below code [closed]
- How to change the blog title with add_filter? details below
- How To Get User Data in Callback Function for pre_user_nicename?
- What’s the best way to split admin-only functionality in the theme’s functions.php file?
- Where is this inline CSS code [closed]
- When to use actions and when to use filters
- Editing
- the_content filter – checking the post
- add_filter to apply_filters that exists within class
- Variables in post title
- Filtering post-formats from the loop using new WP-Query();
- How to edit dashboard search posts button texts for my CPT?
- Insert term when page is published – avoid duplicates after edits
- Filter Media by Featured on Admin
- When does a function assigned to the content_filtered_edit_pre filter hook fire?
- Capture post content before page renders
- Empty string supplied as input when parsing content
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- Remove_action does not work
- How to access plugin variables from theme templates without using globals?
- How to pass variables to custom filter from multiple functions
- WooCommerce Custom Product Validation [closed]
- Make WP not format code, not insert line breaks in between tags
- add img class to native wordpress galleries
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- How to get a single hook from wp_head()?
- WP filter to alter admin CSS styles?
- Detect when gutenberg editor title is available in Dom after editor load
- How to apply a filter to an ACF wysiwig editor field output?
- Why this filter hook is not working when passing parameters?
- Is it possible to bind a function to a filter hook via Ajax?
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Filter posts by meta data using custom query
- Remove tags without a specific meta key from “choose from the most used tags”
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Register users by e-mail
- automatic title through filter
- Filter causing loss of _wp_attachment_metadata
- Buddypress Filter Multiple Activities [closed]
- How can I tranlslate post date in italian?
- How do I check if I can use the allowed_block_types filter?
- Having wp-admin on different domain
- Use a functions in functions.php to remove a string for template theme
- oembed_dataparse filter not running at all for standard YouTube embed
- Action for opening attachment or manipulating all attachment links
- Filter wp_mail based on content type
- Add filter conditionally to a page
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- mu-plugins body_class filter not working
- Post filter Month dropdown at front-end like wordpress backend
- shortcode function outputs multiple anchor tags
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- Show child theme for users on specific IP
- Remove action added from class
- wp.getPosts with status = ‘trash’ using node.js
- Is there a way to overwrite a filter used in canonical.php?
- How do I remove certain HTML elements with specific classes from the feed?
- Adding an orderby filter, casting postmeta with multiple keys
- Identify admin/logout and more filters
- confusion with add_filter
- post->post_content filter
- How to create a list of terms who’s posts also have a predefined external term?
- How to change this WP logo and posts url in block editor?
- Limit total tags in the_content