// 管理サイドバーメニューの非表示 function remove_menus(){ $user = wp_get_current_user(); if( $user-> get(‘user_login’) !== “admin_99”) { remove_menu_page( ‘edit.php?post_type=cta’ ); // CTA管理 remove_menu_page( ‘edit.php?post_type=aftag’ ); // タグ管理 remove_menu_page( ‘edit.php?post_type=afranking’ ); // タグランキング remove_menu_page( ‘siteguard’ ); remove_menu_page( ‘snippets’ ); remove_menu_page( ‘pmxe-admin-export’ ); remove_menu_page( ‘pmxi-admin-import’ );…Continue reading
//デフォルトブロックのパターン削除 add_action(‘init’, function() { remove_theme_support(‘core-block-patterns’); });Continue reading
//投稿一覧にスラッグ表示 function add_posts_columns_slug($columns) { $columns[‘slug’] = ‘スラッグ’; return $columns; } function add_posts_columns_slug_row($column_name, $post_id) { if( ‘slug’ == $column_name ) { $slug = get_post($post_id) -> post_name; echo $slug; } } add_filter( ‘manage_edit-post_sortable_columns’, ‘add_posts_columns_slug’ ); add_filter( ‘manage_posts_columns’, ‘add_posts_columns_slug’ ); add_action( ‘manage_posts_custom_column’, ‘add_posts_columns_slug_row’,…Continue reading
add_action( ‘admin_init’, function() { if ( ! current_user_can( ‘administrator’ ) ) { wp_redirect( home_url() ); exit; } } );Continue reading
function add_hubspot_embed_code() { echo ‘ ‘; } add_action(‘admin_footer’, ‘add_hubspot_embed_code’) ?>Continue reading
add_action( ‘shutdown’, ‘advads_schedule_order_notes_to_set_actions_run’ ); /** * Schedule the order notes to set actions run cron event. * * @return void */ function prefix_schedule_order_notes_to_set_actions_run() { // This option is added when no more notes can be found. if ( get_option( ‘prefix_use_order_notes_to_set_actions_run’…Continue reading
add_action( ‘admin_footer’, ‘prefix_mailchimp_stop_sync’ ); /** * Stop the Mailchimp sync from running. * This is a temporary function to stop the sync from running and can be deleted once the sync is stopped. * * @return void */ function prefix_mailchimp_stop_sync()…Continue reading
function disable_all_admin_notices() { remove_all_actions(‘admin_notices’); } add_action(‘admin_init’, ‘disable_all_admin_notices’);Continue reading
# BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPressContinue reading
add_action( ‘admin_head’, function () { if ( current_user_can( ‘update_core’ ) ) { return; } remove_action( ‘admin_notices’, ‘update_nag’, 3 ); }, 1 );Continue reading