No, the function current_user_can_for_blog
expects a blog ID to be passed to it, not a post ID. I would change it to be like this:
if( isset( $_POST['post_type'] ) && $_POST['post_type'] != 'portfolio' ) {
if ( !current_user_can( $post_id, 'edit_post' ) )
return;
}
Related Posts:
- How to force Authentication on REST API for Password protected page using custom table and fetch() without Plugin
- Pagination not working with custom loop
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- Breadcrumbs with Custom Post Types?
- order by meta_value serialized array
- bulk Update post_meta with default values
- Running a function on post content and CPT meta
- Get the post_type of current taxonomy or category page
- Output the slug and name of a CPT single post taxonomy term
- Slug for standard post post_type
- WordPress custom post type archive with description
- Custom post types – show specific posts
- Paginate_links links not working accordingly to how I do query the page
- Updating post title using wp_update_post
- Remove parent from custom post type
- Associate custom post types with normal posts
- Troubles with making a custom template for posts
- Custom Post Type and Labels
- related posts – pulling tags from a specific post type
- WP 3.0.5 – Custom posts matching 2 taxonomies
- Custom Post Type Loop within Shortcode
- How to add post_type=value when editing that post type in the WordPress admin?
- Change archive page template using pre_get_post
- Force documents to appear in Featured Image dialogue
- hide a certain custom field
- Query with no terms uses index.php template instead of archive.php
- Sort by alphabetical order archive.php page
- custom taxonamy and post type
- Custom post type archive page – Posts overview – with one modal for multiple posts?
- Getting categories of posts under a custom taxonomy
- Is it possible to to use custom post type types on a page with the same slug somehow?
- Custom Post Fields at the beginning of a Custom Permalink
- Add term to custom post type on draft
- When an unregistered user submits a form for a custom post type, send an email that lets them delete their post
- Different Category system needed for the Custom Post Type
- How do you get the full size url of an attachment image
- How to specify a template for a path like http://example.com/something?
- query_posts adding extra code to homepage
- Featured Image field not appearing in Custom post type
- Template to list categories in custom taxonomy
- how to remove pages loading with the archive templates
- Meta data (Tags and Categories) for Custom Posts not showing.
- How to display custom field value on page?
- Display different information of a custom post type
- Update post if exist from PHP
- How to add a sub directory to WordPress single posts without affecting other post types?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to get the post terms from a child taxonomy
- Before saving post hook
- Adding Template Post Content
- Is it possible to sort metabox teaxtarea values?
- orderby parameter not working in custom query
- Which is the neatest way to have homepage articles and a blog?
- foreach loop inside the loop creating duplicates in output
- Custom loop request based on custom field
- Content in WP Editor displayed below CPT shortcode [duplicate]
- Tag template not returning posts [closed]
- Do I need a loop to display an object that attached to posts?
- Remove filter and view options from custom post type edit screen
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Permalink with hierarchy of Custom Post Types
- How do I set a post slug automatically based on taxonomy?
- Get a list of custom post type (property) when clicked on custom taxonomy 1 (rent or sale) from custom taxonomy 2 (city) page
- How to divide Subcategories into pages of parent category wordpress
- Select custom post type do display from page editor
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- How to submit custom post type front end form when a user buy specific product
- Get Custom Post types data from the API
- meta query condition don’t work
- How to group custom posts in admin menu based off taxonomy/postmeta
- Custom post type category returns null
- publish_post action callback not executed, why?
- Parent and child categories with their id in drop_down in CPT
- Templating advice sub posts of a CTP
- Post display in separate page [duplicate]
- Two CPT: one is using part of the custom rewrite slug from the other
- Enable shortcodes on custom post type
- Only show current category post
- WordPress Contents Migration
- getting a blank login page :( any way I can fix this without having to do a clean install?
- Add a image to a post published on a CPT from the front-end
- Pulling in Related Posts based on Post Type array
- Custom Search not working
- Custom post type post taxonomies
- pre_get_posts action doesn’t work
- Query Posts From Multiple Post Types
- Bulk remove category from custom post type?
- Custom Post Types (Changing post style based on category)
- Page template anomaly
- Structure of custom post type / taxonomy?
- Notices when submitting custom post type from front-end
- Issue On Listing Woocommerce Parent Tag List
- show custom post’s post in two different divs [duplicate]
- Creating post custom field text area
- querying to custom field over ACF REST API
- the_post_navigation in single page with multiple taxonomies
- Url rewrite with custom post type and taxonomy
- display related posts based on the PAGE TITLE
- Custom Post Types Permalink