In your functions.php
:
add_action('publish_post', 'check_user_publish', 10, 2);
function check_user_publish ($post_id, $post) {
if($post_id == 1){
$query = array(
'ID' => $post_id,
'post_status' => 'draft',
);
wp_update_post( $query, true );
}
}
Related Posts:
- Action hook for new pending posts?
- Hide a specific category in admin All Posts page (WordPress)
- Updating post data on save (save_post vs wp_insert_post_data)
- Adding bootstrap classes to video shortcodes
- fire action when post is being edited as well as saved?
- save_post not working
- transition_post_status hook, works – but not if the post is new
- How to retrieve the postID in a “image_send_to_editor” hook function?
- get_current_screen() return null
- Register post status, exclude from searches
- Uppercase first sentence in every post
- Add icon/badge next to posttitle of specific category
- How can I set a Post’s default visibility to private and pending review checked
- Ajax posts filter by date, comments, top views, top likes
- Define a wordpress constant through plugin functions?
- Prepend or add an Image to the content of a Post
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- Why content_arr[‘extended’] removes paragraph tags?
- how to remove dash (-) post status from post title on posts listing page wordpress
- How to get post bulk edit action trigger and get edited post ids?
- Load post attached images on a single page site with fancybox
- How to modify post content?
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- How to change post status from frontend?
- Which WordPress hook fires after post content loaded?
- Display post lists in 2nd paragraph
- Using a post-signup hook to get user details
- Exclude category from
- What is the filter or hook to add admin controls to posts on the front end?
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- Adding buttons to Add New Post and Add New Page
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- How to display the link (title) and thumbnail post?
- updating a post doesn’t trigger a function
- Force the “Choose from the most used tags” meta box section to always be expanded
- Show the content that is after the excerpt using child theme
- Prevent Delete Attachment by URL or When Submit
- How to allow users to post only in certain category and hide elements from edit page?
- What hook do you use to update a post?
- How to access $post from a callback function
- How to do set post permalinks using 6 digit random unique function?
- Can’t get buddypress notifications in front-end; why do I get this error?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Posts and Attachments with “Published” status in Search
- Send post id through ajax and get the post content back
- Admin – create custom post status and display above table
- Display post x of y within category
- Force authors to Preview a post before publishing
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- WordPress Automatic Filename Changer
- Copy post to separate database with “add_action(….)”
- Hooking into the post editing screen for an existing page only
- Redirect to another page using contact form 7? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- Trying to alter the post_content through the_post
- Call Web Services on post first publish
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- How to dynamically parse and transform post/page content before displaying it?
- Change all author links in Blog roll
- $post->post_type not working
- disable Tab post on nav-menus page (Admin)
- how can i allow users to view their own pending posts in a front-end page
- What does WordPress do if I save a post without content/title? [duplicate]
- Every second post different class in blog view
- Format latest/newest post differently
- is_page Funtion for Posts ?
- Post type no single page
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- The_excerpt() doesn’t parse – how to change that?
- Divs appearing everywhere in post content
- How to only publish posts with image in it
- Modify posts listing at back end
- Isn’t the way posts are displayed very unefficient?
- Add custom text automatically on each post
- Call to undefined function is_home() or any conditional tags
- How to check in functions.php if there is data in a WP_Query?
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- restrict incrementation of post vies count when refreshing the page
- Filter Hook for post table (not columns)
- why str_replace targeting pages instead just targeting post?
- Defined function isn’t showed on page
- WordPress 302 Redirect to Random Product/Post/Page
- Automatically set post_parent value
- Getting Whitescreen when publishing a post [closed]
- Using system date format
- Get post by tag
- Add code to a specific post’s content
- Related Posts function not working
- Fixing the WP Post Object for Custom Route
- How to get the postID inside ‘content_save_pre’? Other hook?
- wp query custom orderby not custom field
- How to change number of posts shown on homepage vs other pages?