• Resolved unseenmortal

    (@unseenmortal)


    I’m using a wp-sticky plugin, the problem is authors could also use it, are there any ways to disable the sticky options for authors by using the role management plugin or are there any other ways? Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • If you author can manage options, they can manage WP-Sticky and as far as I know Author cannot manage options, check out https://codex.www.ads-software.com/Roles_and_Capabilities

    Thread Starter unseenmortal

    (@unseenmortal)

    What I mean is I want to disable the Sticky Post option for authors when publishing a post, are there any ways to remove that and only admins could make a post sticky/announcement? thanks

    Oh, I get what you mean.

    In wp-sticky.php,

    Find:
    function sticky_add_meta_box() {
    add_meta_box('poststickystatusdiv', __('Post Sticky Status', 'wp-sticky'), 'sticky_metabox_admin', 'post', 'side');
    }

    Replace:
    function sticky_add_meta_box() {
    $current_user = wp_get_current_user();
    $user_level = intval($current_user->user_level);
    if($user_level == 10) {
    add_meta_box('poststickystatusdiv', __('Post Sticky Status', 'wp-sticky'), 'sticky_metabox_admin', 'post', 'side');
    }
    }

    The code is untested

    Thread Starter unseenmortal

    (@unseenmortal)

    Wow thanks man, it works, I tried to login as author and it doesn’t show the sticky option below the entries anymore.. thanks man.. hope to see more features for the wp-sticky plugin you’ve created.. peace..

    Don’t forget to use the Paypal button at https://lesterchan.net/ to help insure authors, such as Lester, can continue to provide quality plugins!

    @unseenmortal: No Problem
    @michaelh: As always, thank you for the compliments =D

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP-Sticky for admins only’ is closed to new replies.