Capability to read user’s own draft post of CPT
Capability to read user’s own draft post of CPT
Capability to read user’s own draft post of CPT
You cannot assign capabilities to unknown users. If you want to make a post visible for everyone, create a separate URL for these posts and add a control element to the post editor to enable the preview on selected posts only. When such an URL is called, check if a preview is allowed for the … Read more
One really simple way is to just insert another “save draft” button wherever you want in your post editor page. <input type=”submit” name=”save” value=”Save Draft” class=”button”> You essentially just want to make sure it’s got “save” as it’s name attribute and “Save Draft” as it’s value.
wp_insert_post hook not being called with wp_publish_post or wp_insert_post?
A good place to start with an issue like this is using debug mode in WP. https://codex.wordpress.org/Debugging_in_WordPress If you know exactly which action triggers the creation of a draft post, then it is repeatable and you have a basis for a solution. Based on your question, “whenever I load the posts page” is what creates … Read more
CPT unsaved draft gives error 404 – when Post Formats support enabled
Users can only save their draft once before saving for revision
I found my answer: change their role to author ann define in the settings that new users are automatically authors.
Auto draft posts when scheduled date is reached
Sure it is – you can use the wp_insert_post_data filter: function no_going_back_to_draft($slashed_data , $post_data) { if($slashed_data[‘post_status’] == ‘draft’) { // we’re only interested in posts being saved as “drafts” $user = wp_get_current_user(); if ( in_array( ‘no-going-back-to-draft-role’, (array) $user->roles ) ) { // we’re only interested in users with that special, restricted role $post = get_post($post_data[‘ID’]); … Read more