CCCPaste

Frontend Submit Tanpa Review

add_filter( 'jnews_frontend_submit_create_post', 'jnews_frontend_post_status_change');
function jnews_frontend_post_status_change($args) {
    if( is_user_logged_in() ) {
        $roles = array( 'author', 'editor' );
        $user  = wp_get_current_user();
        foreach ( $roles as $role ) {
            if ( in_array( $role, $user->roles ) ) {
                $args['post_status'] = 'publish';
                return $args;
            }
        }
    }
}