Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: quick edit and permalink disable for role #3132
    digitaliway
    Participant

    I was able to get this working with the below code. The code you posted does not contain “page_row_actions” and the code on https://www.role-editor.com/block-permalink-edit-button/ does not seem to work so I changed it to the filter “get_sample_permalink_html” below which seems more efficient unless you see a better solution?

    
    //remove quick edit functions for page and post
    function remove_quick_edit( $actions ) {
        unset($actions['inline hide-if-no-js']);
        return $actions;
    }
    if ( current_user_can('page-editor') ) {
        add_filter('page_row_actions','remove_quick_edit',10,1);
        add_filter('post_row_actions','remove_quick_edit',10,1);
    }
    
    //hide permalink edit buton on page for role
    function hide_permalink() {
        return '';
    }
    
    if ( current_user_can('page-editor') ) {
    	add_filter( 'get_sample_permalink_html', 'hide_permalink' );
    }
    
    
    
    
    in reply to: quick edit and permalink disable for role #3122
    digitaliway
    Participant

    This did not work. can you please provide specific code or update plugin to have capability?

    I have a role called: page-editor

    I added this exact code to the functions file and QUICKEDIT and PERMALINK EDIT still remain.

    if (current_user_can(‘page-editor’)) {
    add_filter(‘post_row_actions’,’remove_quick_edit’,10,1);
    }
    function remove_quick_edit( $actions ) {

    unset($actions[‘inline hide-if-no-js’]);

    return $actions;
    }

Viewing 2 posts - 1 through 2 (of 2 total)