add these lines in your ‘functions.php’, it will work
//if not gutenberg reapprove posts
add_filter( 'wp_insert_post_data', 're_aprove', '99', 2 );
function re_aprove( $data, $postarr ) {
//check if current user is not admin
if ( ! current_user_can( 'manage_options' ) ) {
if ( 'publish' === $data['post_status'] ) {
$data['post_status'] = 'pending';
}
}
return $data;
}
Related Posts:
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Allow Editors to edit pending posts but not draft ones
- Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?
- Editor role cannot save custom theme options
- How do you add customer capability after Woocommerce purchase?
- Add class to group inner container
- Shortcode for Listing Users from Meta Value?
- Query for user roles
- Execute PHP code only with specific user role
- Add Block Before Entry Title Using PHP
- Edit and delete permissions pages and posts
- How to Add a cutsom slug to my custom author role
- Execute function only for specific user roles
- Gutenberg block don’t save rich text content
- Hide payment method based on user role AND minimum cart value
- Is there a PHP function that will return the block ID generated by WordPress?
- register_block_type is not working properly
- Edit a function to take different actions based on user role
- How to give custom roles the capability to edit one Menu instead of every Menu
- Add another role to a user when they click a button?
- Allow BBPress participant role to trash topics
- Get author meta of all writers
- How to add different menu items on different menus?
- Replace block content with an array
- Custom Admin Menu Report for Specific User ID
- Hide ID for WordPress User Role Subscriber
- Add a class to the anchor tag on HTML5 gallery
- Conditional Header in wordpress
- Remove meta description on certain pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Use menu link or onClick to set a variable
- How to give new users two specific user role options upon WordPress user registration
- Swapping wp_dropdown_categories function with wp_category_checklist
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Automatically remove a canceled order in Woocommerce
- Display fields as values in array from external SQL DB
- Only Show Link If div Exists
- How to put a variable in a instance in the widget
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Trying to establish connection to External Database
- add_action shortcut?
- Passing the custom field values in the wp_get_current_user array function
- Using fwrite() and “a” appends multiple times instead of once
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- How to style options page in dashboard?
- How to insert a single row to WP database table?
- Get date numerical and separate?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- WSoD being caused by this piece of code
- Converting HTML Template to WordPress Theme
- Set the background to a default image if there isn’t a specified “featured image”
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Add a variable in functions.php and call it in single.php
- How to access global variable $menu inside a class function
- Calling directories to load in wordpress
- WordPress add post format support not working
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- How to remove the cufon script from Dzonia Lite theme [closed]
- How to remove or change the “W” icon in “My Sites”?
- get a simple array of all of the term names that exist in all taxonomies
- Login/logout in header
- How to display posts by current user in a drop down
- Logged in user ID as post ID
- How does WordPress insert Paragraphs in posts
- WordPress Access allowed to fewer pages till user logs in
- Linking text within textarea of custom meta box
- Show css depending on activity type in BuddyPress activity-loop [closed]
- only show container with next/prev links if they exist?
- How to combine wordpress_logged_in cookies in one cookie?
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- Change the WP Video Shortcode Output
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- remove wp floating submenu in wp dashboard
- How to put “Read more” link in Custom Excerpt inside p tag?
- Two Different Links for Same Product – WooCommerce [closed]
- ACF: how do I get the fields and its values of a specific group?
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- How to add seperate classes to no-search-result and found-search-result pages on wordrpess search – is_search()
- Get value from shortcode to do something
- PHP 8, AJAX mail form to function.php doesn’t work
- How do I add custom bulk actions to multiple custom post types?
- Displaying admin notices inside the block editor from rest_after_insert_{$this->post_type} hook
- How to programmatically add Gallery Block to Existing Post Content
- Best way to add more options to Gutenberg “More Rich” text controls drop down
- Error when adding excerpt to the content through functions.php
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- Get post id in a function when edit/add a post
- Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
- How to check if a meta value has already been assigned to any user?
- How to complete two other input fields, completed the first
- Prev/Next child navigation for current page modifications?
- Adding rel tag to all external links
- How can I apply_filters from inside a function?
- function to assign user role based on a field from usermeta