When using save_post
you are usually add/updating user-inputted data from a metabox into the database. When do this you should check that your metabox’s nonce is valid.
You should also check permissions as save_post
is triggered inside wp_insert_post()
, and not just when the you create/edit a post admin side.
Related Posts:
- Allow member to have access to custom post type only. Permission to only edit their own posts
- With Rest V2 (WP4.7) how does one restrict certain RESTFUL verbs?
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Getting “The link you followed has expired” when adding custom post [closed]
- Allow User to Edit Page Based on their Email
- Allow Author role to publish one post type and not another
- Undefined index: at_nonce in custom post metabox
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Registration and Custom Post Types – How to synchronize information?
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- Roles for Custom Post Types
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- read_post meta capability for anonymous users
- No Permission to add new Page, Post or CPT with Admin role
- Filtering results for post_type tells me I don’t have permission
- Forms and WordPress Nonce
- Fix permission error for deleting custom post from front-end?
- get_delete_post_link() only works for administrator, even if other user has exactly the same permissions
- Preventing role reading others posts
- Why “Mine” is the default view when adding ‘capability_type’ in register_post_type
- Front-end submitted post is published with admin ID as author
- How to create new permission for custom post types for doing specific tasks
- check_admin_referer not working in custom meta box for custom post type
- Remove Custom Capability
- Get posts for custom post type with WP_Query
- Custom Post Type Data in Sidebar widgets?
- Custom Post Type Permalink / Rewrite not working immediately
- How to add custom content template part for a custom post type on main query using a plugin
- Unregister post type from child theme
- How to get term link that crosses different custom post types?
- Custom post type Admin Page
- Enforcing canonical URLs with multiple custom post types
- Set post title from two meta fields
- Where to put archive-{post-type}.php
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- WordPress custom post type category pagination 404 Error
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Custom Permalinks for Custom Post Types and Taxonomies
- how to group custom post type posts by custom taxonomy terms
- Custom Taxonomy order by Custom Field
- Custom post types – non-visible title and how it affects URL
- Limit search form to 4 custom post types only
- “More” span making trouble
- Single Post Pages for Custom Post Types
- Show ACF field from custom taxonomy and display on the single template
- Add Content Exclusively to a Custom Post Type Feed
- How to rename image at uploading on specific plugin or post-type in WordPress
- ‘Pages’ widget alternative for custom post types?
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Loop on front-page.php
- How to insert multiple images into a single post within a CPT
- Parent field missing from custom post type in the block editor
- Custom posts don’t work
- Pagination is not working in custom post type
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- allow BOTH post slug and meta key value in permalink for custom post type
- Associate users with Custom Post Type and list associated users
- Grouping metadatas into one
- How to display single post from custom post type loop?
- Define/declare new custom types with fields in plugin?
- How to Output which matched meta_keys were found from custom_type_posts?
- A page that shows a list of a specific custom post type
- pagination not working for category.php (custom post types in categories)
- previous_post_link in same taxonomy in custom post type
- How do I create a new post upon registration with the users first and last name as title
- Display both parent and child custom taxonomy / content
- Get id from metabox dropdown
- Dynamic pages for linked categories and content
- How do I replace the post title with a custom field?
- How can I make custom static widgets/areas on my homepage?
- Page template that uses lightbox to display post images
- How can I add custom fields in a custom post type? [duplicate]
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get List of Terms based on a given term (different taxonomy)
- Custom post type archive URLs with a single taxonomy
- How to get rewrited name of cusom taxonomy?
- How to access repeater field of a custom field?
- Custom Post Type 404 Error even after flushing rewrite rules
- custom post type section selector
- Update/publish custom post type with jQuery?
- Custom Post Type slug and WPML gets 404 error
- Previous/Next custom post links within custom taxonomy
- Custom post type: “transition_post_status” action get title and other fields
- Pretty permalink structure with multiple (AND OR) taxonomies
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Override “Parent” input for custom taxonomy
- How to develop custom URL redirection
- Custom post type with Filter and Page Nav
- Custom Post Type Archive Links Not Working
- Custom Post Type Categories Not Maintaining URL structure any more
- CPT unsaved draft gives error 404 – when Post Formats support enabled
- Custom Post Types and Child Themes!
- Check if taxonomy is attached to at least one post in a post-type
- How do I ensure custom post type information is displayed in correct order?
- Tag-post relationship problem
- Rewrite rules for using the same base slug for multiple content types
- Custom Post type as Taxonomy
- Getting 404.php instead of single-.php [duplicate]
- Display div based on Group metabox selection [closed]
- add_rewrite_rule not working in Custom Post Type UI Plugin