• Resolved 360fun

    (@360fun)


    Hi, thank you for this amazing plugin!

    Sadly without this feature I cannot use your plugin right now, because who’s in charge of Instagram needs to change frequently links (like in linktree) without having access to all Linky settings and especially without the entire access to the WP admin area. That would be very dangerous.

    Would be really nice to give access to Linky admin pages to Editors or other users. Restricting the access just to some pages/functions, like the “edit links” page for example, and not everything.

    With Roles Editor normally I can find capabilities to add or remove. Do you have a code snippet that I can add in order to be able to make appear these permissions? That would be enough!

    • This topic was modified 3 years, 6 months ago by 360fun.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author undefinedfr

    (@undefinedfr)

    Hi @360fun,

    Sorry for response delay.

    I prepared new version (1.2.1) with specific hook tag for every setting page.

    You can add this code snippet code into functions.php :

    
    add_filter('linky_submenu_links_page_capalibilty', function($capability) {
        return 'editor';
    });
    
    • This reply was modified 3 years, 5 months ago by undefinedfr.
    Thread Starter 360fun

    (@360fun)

    Awesome, thank you! 🥳

    Thread Starter 360fun

    (@360fun)

    Too fast 😛 There’s a bug: in this way admins cannot see “links” page 🙄

    I fixed it with:

    if ( !current_user_can( ‘manage_options’ ) ) {
    add_filter(‘linky_submenu_links_page_capalibilty’, function($capability) {
    return ‘editor’;
    });
    }

    Plugin Author undefinedfr

    (@undefinedfr)

    Well seen!

    Have a good day !

    Thread Starter 360fun

    (@360fun)

    I updated the code, so I can add ‘manage_links’ capability to any user, but the code is a bit dirty:

    $user = wp_get_current_user();
    $caps = $user->allcaps;

    //if( $user->has_cap(‘manage_links’) ) { // doesn’t work…no idea why
    if( !empty( $caps[‘manage_links’] ) ) {
    add_filter(‘linky_submenu_links_page_capalibilty’, function($capability) {
    $user = wp_get_current_user();
    $roles = ( array ) $user->roles;
    return $roles[0];
    });
    }

    If you could clean it and implement it in the next release, would be great! 😀

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Extended (partial) access to Editors’ is closed to new replies.