• Resolved foots

    (@foots)


    Hi,

    I was wondering if it’s possible to show the edit link to Admin or a custom role only?

    I’ve tried disabling edit posts for all users except admin and custom role and set the override link to no.

    However, the lowest role can still see the edit button.

    Many thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @foots,

    Greetings from weDevs!

    You need to write some custom code for that. Currently this option is not available in the plugin.

    Thanks!

    How about something like

    <?php if (current_user_can('administrator')) 
    {
    edit_post_link( esc_html__( 'Edit', 'oria' ), '<span class="edit-link">', '</span>' ); 
    } ?>

    That’s what I do for my site pages. Because so far with this plugin, if pages are edited from the front-end, they turn into posts!

    • This reply was modified 7 years, 1 month ago by deepbevel.
    • This reply was modified 7 years, 1 month ago by deepbevel.
    Thread Starter foots

    (@foots)

    Hi Mushrit,

    Thanks for your response.

    @deepbevel

    Thanks for your solution, I tried it but it didn’t work with this setup.

    To solve it, I made a copy of the dashboard.php template and added the code below to the a link class:

    “classname <?php if ( current_user_can(‘subscriber’) ) {echo ‘logged’;}?>”

    As all the posters have a subscriber role, I hid the link for that role.

    Hello @foots,

    You are doing great!

    I just want to remind you, whatever you write, keep it as custom code inside a child theme. Otherwise, when the plugin will be updated, you will lose them.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Edit link for Admin only’ is closed to new replies.