#profile-page h3,
#profile-page table:nth-of-type(1) tr:nth-child(1),
#profile-page table:nth-of-type(1) tr:nth-child(2),
#profile-page table:nth-of-type(1) tr:nth-child(3),
#profile-page table:nth-of-type(2) tr:nth-child(2),
#profile-page table:nth-of-type(2) tr:nth-child(3),
#profile-page table:nth-of-type(2) tr:nth-child(4),
#profile-page table:nth-of-type(2) tr:nth-child(5),
#profile-page table:nth-of-type(3) tr:nth-child(2),
#profile-page table:nth-of-type(4) tr:nth-child(1)
{
display: none;
}
ファンクション
//プロフィール画面でビジュアルエディターのチェックボックスを隠す
function hide_richeditor_checkbox() {
global $wp_rich_edit_exists;
if ( ! current_user_can( 10 ) && defined( 'IS_PROFILE_PAGE' ) && IS_PROFILE_PAGE ) {
$wp_rich_edit_exists = false;
}
}
add_action( 'admin_head', 'hide_richeditor_checkbox' );
//ユーザープロフィールの「管理画面の配色」を削除
remove_filter( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
//管理画面の配色を強制的に青
function admin_color_force_fresh() {
return 'classic';
}
add_filter( 'get_user_option_admin_color', 'admin_color_force_fresh' );
//管理画面文字変更
add_filter('gettext', 'change_post_to_article');
add_filter('gettext_with_context', 'change_post_to_article');
add_filter('ngettext', 'change_post_to_article');
add_filter('ngettext_with_context', 'change_post_to_article');
function change_post_to_article($translated) {
$translated = str_ireplace(
'プロフィール',
'パスワードの変更',
$translated
);
return $translated;
}
//このcssでCSS3を使って項目見えなくする
//CSSで管理画面内のサイドメニューを非表示にする 権限指定
function custom_admin_styles(){
$current_user = wp_get_current_user(); //現在のユーザー情報を取得
if(check_user_role($current_user,'shop_owner')){ //編集者(editor)かチェック
echo '<link rel="stylesheet" type="text/css" href="' .get_bloginfo('template_directory'). '/custom-admin-css2.css" />';
}
if(check_user_role($current_user,'editor')){ //編集者(editor)かチェック
echo '<link rel="stylesheet" type="text/css" href="' .get_bloginfo('template_directory'). '/custom-admin-css2.css" />';
}
}
add_action('admin_print_styles', 'custom_admin_styles', 21);
/*
* ユーザーの権限をチェックする
* @param $user ユーザーオブジェクト
* @param $role ユーザー権限の文字列
* (administrator, editor, author, contributor, subscriber)
*/
function check_user_role($user,$role){
foreach($user->roles as $user_role){
if($user_role === $role){
return true;
}
}
return false;
}
http://qiita.com/koh-taka@github/items/79309c1f367f00c425d8