Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'jnews_account_page_endpoint', 'restrict_frontend_submit_menu', 99 );
- add_filter( 'jnews_frontend_submit_user_subscription', 'restrict_frontend_submit' );
- function restrict_frontend_submit( $value ) {
- $value = current_user_can( 'edit_posts' );
- return $value;
- }
- function restrict_frontend_submit_menu( $endpoint ) {
- if ( ! current_user_can( 'edit_posts' ) ) {
- if ( $endpoint['post_view_stats'] ) {
- unset( $endpoint['post_view_stats'] );
- }
- if ( $endpoint['my_post'] ) {
- unset( $endpoint['my_post'] );
- }
- }
- return $endpoint;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement