register_post_status is used for creating a custom post status. The protected argument, if true, specifies that a user must be logged in and have edit permissions on the post to view (preview) it.
For example, you said that the “draft” post status has protected set to true. This means that you can only view (preview) the draft post if you have permission to edit the post. Once the post is published, the protected parameter is turned off and anyone can view it.
If you are creating your own custom status, you might want it to be protected. For example, you could have a post status called “on_hold”, and when you set a post to that status, it would no longer be visible to the public, but still visible to the administrators of your site.
Related Posts:
- Is it possible to have more “levels” of draft/published statuses?
- how to assign a status/mark to post?
- Why doesn’t wp_update_post() update the post_status field?
- register_post_status and show_in_admin_all_list
- Changing post status in one click
- How can I run custom function when post status is changed?
- WP_Post_List_Table::get_views – Have post counts account for filters?
- Creating/editing custom ‘post-state’
- Using arbitrary post status without registering it
- Get a list of ALL Statuses both registered and built-in
- Adding custom post status to visibility in publish meta box
- Changing post status
- Change scheduled posts to published
- Include Drafts or Future posts with count_user_posts?
- Remove ‘private’ and ‘pending review’ options from post status dropdown
- Can not get future_to_publish to work
- Which is the better way to get the status of a post?
- “Publish immediately” with custom post status
- Modify Post Status Arguments
- Additional page and post status types
- Add a simple JS Alert Box on Post Submission
- Function to change post status IF current user and post author are the same
- Schedule future post to custom post status instead of publish?
- Why does get_post_status display published when attachment is in trash?
- Force Custom Post Type Status to ‘Future’ on first Save or Publish
- Workflow for attachments in WordPress
- how to transition to custom post status on post save
- How to change custom post type status when non-admin updates post?
- Custom post status filter links always show a count of all posts in the site with that status, not the logged in users count
- wordpress post status inquery
- Multiple Post Status
- retrieve post details in loop
- Any way to change post/page status when editing page?
- How to change post status from “draft” to “publish”?
- transition_post_status doesn’t work with bulk updates
- Submitted for Review back to a Draft page
- How to Add Custom Post Status in WordPress Admin
- Auto draft posts when scheduled date is reached
- Changing a post status name
- How to update post status to draft if user role is “pending’
- How to create posts with a specific date in bulk
- What is socket, core, threads, CPU?
- What is the role and history of the $content_width global variable?
- How to Display a List of Users Who Have Made at Least 1 Post?
- Turn Off Automatic Trash Deletion?
- Understanding SHORTINIT with WordPress 5
- WordPress get_posts function, 1300 lines long
- Let private posts stay in status “private” after edit through “editors”
- Custom post status and preview
- get_terms(); show private posts when logged in
- Updating WordPress – the best approach (updating wp core, plugins and db)
- featuring old articles without messing up with the archive
- Show scheduled posts in archive page
- How to Modify a Widgets UL and/or LI Classes
- Enable commenting on front-end preview page for pending posts
- Error after deleting Custom Post Type with a function (no trash used)
- Question about the template-loader.php file
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- How to start a script from cli within wordpress
- wp_transition_post_status does not change the status of the post
- stop login if user_status equal zero
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Automatically remove a canceled order in Woocommerce
- All, published and pending order
- error: An Unexpected HTTP Error occurred during the API request
- How to change post status from frontend?
- Use register_setting() in a loop
- Featured image overlay when changing post status
- Does get_the_content_feed strip invalid tags?
- Add custom post type drafts to RSS feed
- WordPress and a secondary database?
- Get publish post link?
- WordPress capabilities on pending post status
- Does the WP_Query ‘private’ argument for post status only apply to privately published content?
- Timezone is wrong when picking city (Copenhagen)
- How to edit the Tags within the image file URLs?
- Location of core code for database connection and get_header
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php
- Published post auto change status to pending after 90 days
- Where’s the explanation of the TinyMCE’s vars in the WP core?
- How to add custom status to quick edit
- Change status of page after an event (Looking for best practice advice)
- wp-cli core install –skip-email and –skip-config flags not working on MAMP unknown parameter
- WordPress post_status and meta_query
- Sql Update CPT from publish to draft and particular custom field
- Why does DROP TABLE-ing the `wp_options` reset my user session?
- wp.getPosts with status = ‘trash’ using node.js
- Check if post was modified by editor different than post author
- Do something when user creates post (that’s pending)
- Change Post status based on custom field date +1 day
- After a while attachment meta data is missing “sizes” data
- Remote database access on another wordpress site’s custom post type
- Critical Error when editing menu
- Is there any resource to explain all decisions made on WordPress?
- is_embed and is_search called incorrectly by wp_robots filter
- getEntityRecords/useEntityRecords: How to use CPT metadata?
- How to schedule Automatic WordPress Core and specifics Plugins updates for specific time a day
- Allowed blocks for core/column
- What triggers WordPress automatic updates? (revisited)
- How to restore post to pending status (no draft)