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
- ACF – Tags not showing up in Custom Post Types
- Set posts of a custom post type to be private by default?
- Admin Post Update Redirection to Posts Screen
- How to show related posts by category or custom post type?
- Single Page WordPress CSS and JS links
- Display taxonomy term only if there’s a value
- Disable dragging of metaboxes in custom post types?
- Structure for projects and clients
- Update content of multiple pages/posts at once?
- Why is my custom loop not filtering correctly nor paginating?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Notice: Undefined index: suppress_filters
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- 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
- 2 Templates 1 custom post type according url
- changing meta value and meta key of price field
- Add post location with mile radius allowing search
- Adding the_content() in custom template email
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- How to handle new post from API request?
- Custom Post Types and Removing Slugs – should we do it?
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- WordPress post carousel
- Custom Content Type with No Page View
- How to list posts by term (custom taxonomy)
- How to setup different permlalinks for posts and pages?
- wp_post_delete is deleting all offices
- What is WordPress Way to Add Content Blocks to Post and Reference them as Many to One Relationship?
- Building Link List for Custom Tax
- WP_posts (Not meta) extra custom field column show and change it in a custom post type
- how to make custom post with “publish” default functionality not save in draft?
- Custom Post Type URL Rewriting
- How can I convert custom posts types into regular posts?
- Get All post that is in table
- Dynamically change post_parent in every page load?
- Top 30 Songs using Custom Post Type
- my custom_post_type does not appear in my web page…how?
- Wp-theme Development