管理者以外はクイック編集とパーマリンク編集を非表示にする
add_filter( 'post_row_actions', 'hide_quickedit' );
add_filter( 'page_row_actions', 'hide_quickedit' );

function hide_quickedit( $actions ) {
    if ( !current_user_can( 'administrator' ) ) {
        unset( $actions[ 'inline hide-if-no-js' ] );
    }
    return $actions;
} /*クイック編集非表示*/

add_filter( 'get_sample_permalink_html', 'hide_permalinkedit' );

function hide_permalinkedit( $permalink_html ) {
    if ( !current_user_can( 'administrator' ) ) {
        $permalink_html = preg_replace( "/<span id=\"editable-post-name\" title=\"(.*)\">(.*)<\/span>/", "$2", $permalink_html );
        $permalink_html = preg_replace( "/<span id=\"edit-slug-buttons\">(.*)<\/span>/", "", $permalink_html );
    }
    return $permalink_html;
} /*パーマリンク編集ボタン非表示*/

参考記事
https://tech.kurojica.com/archives/27515/

Conoha Wing

爆速で表示されるこのブログのサーバーはConoha Wingです。
詳細は下記!!

おすすめの記事