Forums

[resolved] WP-Sticky for admins only (7 posts)

  1. unseenmortal
    Member
    Posted 3 years ago #

    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

  2. Lester Chan
    Member
    Posted 3 years ago #

    If you author can manage options, they can manage WP-Sticky and as far as I know Author cannot manage options, check out http://codex.wordpress.org/Roles_and_Capabilities

  3. unseenmortal
    Member
    Posted 3 years ago #

    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

  4. Lester Chan
    Member
    Posted 3 years ago #

    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

  5. unseenmortal
    Member
    Posted 3 years ago #

    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..

  6. MichaelH
    Volunteer
    Posted 3 years ago #

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

  7. Lester Chan
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic