Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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', 'administrator' );
- $user = wp_get_current_user();
- foreach ( $roles as $role ) {
- if ( in_array( $role, $user->roles ) ) {
- $args['post_status'] = 'publish';
- return $args;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement