Ad Sharing won't allow Editor or Admin roles to place their codes

I'm trying to allow my Editors and other Admin users the ability to add their AdSense code (because they also post on my site) but those roles do not have access to even see where to place their code.

On my test user profile, I can only see "Advertising" under "Profile" on the wp-admin screen for Contributors and Authors. When I change to other roles, it disappears from my dashboard.

Any way to change this?

  • Vaughan
    • Support/SLS MockingJay

    Hi Gregory,

    Hope you're well?

    As far as I can see from the plugin code, the users must have edit_posts capability, but must not have the capability of edit_others_posts.

    Which would limit it to authors pretty much which is what it is designed for.

    You can probably change this by editing the plugin code directly.

    Open ad-sharing.php

    Find the following line (139);

    if ( ! current_user_can( 'edit_others_posts' ) )

    If you want editors to also have the right, then change edit_other_posts to manage_options

    if ( ! current_user_can( 'manage_options' ) )

    Though this wouldn't allow administrators to do it just editors, contributors & authors

    If you wish for admins, editors, contributors & authors, then simply delete that entire line.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.