在“函数”中添加这些行。php’,它会工作的
//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;
}