Yes, you’re right. There is a clever way. post_row_actions filter can accept also second param $post from which you can get it’s post_type. See the code:
add_filter( 'post_row_actions', array( $this, 'remove_row_actions' ), 10, 2);
public function remove_row_actions( $action, $post ) {
if ( 'slider' === get_post_type( $post ) ) {
unset $action['view'];
return $action;
}
return $action;
}
Related Posts:
- What does this PHP function code mean? [closed]
- Restrict custom post type to only site administrator role
- Linking Two Post Types
- How to force one column layout on custom post type edit page?
- modify all posts of a category to “no comments allowed”
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Showing current taxonomy terms
- automatically create taxonomy with same name as post title
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Custom Post Type by user
- saving custom post type data to different table in wordpress
- Query post types with multiple keys
- [Plugin: Posts 2 Posts] Changing display order of connections
- same archive template for different custom post
- Get all posts WHERE custom_field is LIKE value
- Get the post children count of a post
- How to delete all posts from a custom post type?
- Check Title Unique Or Not and If not error message and dont save
- Remove All, Published and Trashed Post Views in Custom Post Type
- How to post twitter like updates on wordpress
- Show Two custom Post type and their posts on category page
- Custom post type and body_class: Remove “blog” class
- Deleting Custom Post type data using mySQL command
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Display only one post each WEEK
- List custom taxonomy specific to one custom post type
- Meta query for custom post type ignored in main query
- Show titles, date of all posts on single category page
- Update postmeta Parent when post_status child change
- Allow users to create posts without logging in?
- How to sort posts in a custom post type by title in ascending order by default?
- Get_the_terms restrict output
- Custom post type menu
- YOAST SEO won’t work on custom post type archive [closed]
- Separate Content from gallery (custom post type)
- WordPress Count posts within a custom post type
- Custom post type tags not showing in search
- How set template for “custom post type” individual post
- Why is my custom post content only viewable when signed into WordPress?
- Adding specific custom fields (images) to post excerpt
- Limit posts per page depending on the size of a div?
- Delete Post by User
- creating a custom post template
- Problem to get the link of the default ‘post’ post type like the orther custom types
- One Post with different content, depending on a Page
- Custom Post Type
- Display all post types together
- Turn post into simple slideshow
- Query multiple post of which one by taxonomy
- How to make a template for a specific post of a custom post type?
- How to delete unnecessary custom post types in the UI
- How to create a job post by email parsing? [closed]
- show posts under custom post type with same autj
- How to automate the creation of advanced layout article/post
- display posts, pages and custom post types from another wordpress site
- is therer any wordpress function to retrieve a specific html element from post content
- How to develop Knowledge center in WordPress Website
- Submit post and upload image from front-end
- Custom Post Types on Category Pages
- How do I filter the excerpt metabox description in admin?
- Setting up custom post type archives in WP3.1? Any luck?
- TV Show database – Best way for structuring it?
- Query posts by custom post type and custom taxonomy
- How to let custom post type posts show in standard post archive (like in homepage)?
- Rewrite custom post & taxonomy to share same URL path
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- get_template_part for custom post type content not working
- count_many_users_posts except current logged in user?
- Shortcode for display posts on home page show only one post
- Remove rows in the manage post/page view
- How to allow visitors to enter custom post type?
- delete_published_posts does not work
- Limit the post for differents custom post type in the same wp_query
- WP the_posts() on single-cars.php get category link
- how to check if custom post title exists or not?
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- How can I have different content for different countries?
- List Categories (wp_terms) and count posts
- How to insert data into meta box from another plugin?
- Generate new post from email
- List All Custom Post Types Posts in Nav Menu Dynamically
- post_content is stripping HTML when adding a new post? [closed]
- how to get options to choose post format in add new post
- Use post in multiple places on a page with multiple posts
- How to keep a record of changes to a custom field?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Admin slow on Postlist (over 30k Posts in Database)
- WordPress – display relationship between blog posts and custom posts
- Get queried object for custom post type count
- edit.php all post not working
- How can I get the last 5 element of this tax query?
- How can i order my posts by post type?
- How to mark posts as visited
- Adding Information To All Posts Screen
- Different post types arranged on one page
- How to add custom column to Custom post page list?
- Get post from custom post type that title is like custom string [closed]
- Delete old thumbnail when updating new