Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* restrict post submit by roles */
- function jnews_post_submit_access() {
- $roles = array( 'administrator', 'editor', 'author', 'contributor' ); /* list roles */
- $user_role = (array) wp_get_current_user()->roles; /* Get user role */
- if ( in_array($user_role[0], $roles) ) {
- $button =
- '<div class="frontend-submit-button">
- <a class="button" href="' . home_url( '/editor' ) . '"><i class="fa fa-file-text-o"></i> ' . esc_html__( 'Submit Post', 'jnews-frontend-submit' ) . '</a>
- </div>';
- echo jnews_sanitize_output( $button );
- }
- }
- remove_all_actions('jnews_after_account_nav' );
- add_action( 'jnews_after_account_nav', 'jnews_post_submit_access' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement