Skip to content

Commit

Permalink
ClassicPressで「パターン」メニューが表示されないように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yhira committed May 16, 2024
1 parent bff5d78 commit 86e27ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ function fix_img_v63( $block_content, $block ) {
add_action('admin_menu', 'add_reuse_block_menu_page');
if ( !function_exists( 'add_reuse_block_menu_page' ) ):
function add_reuse_block_menu_page() {
if (is_admin() && !is_wp_6_5_or_over()) {
if (is_admin() && !is_wp_6_5_or_over() && !is_classicpress()) {
add_menu_page(
__( 'パターン', THEME_NAME ),
__( 'パターン', THEME_NAME ),
Expand Down
16 changes: 9 additions & 7 deletions lib/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,15 @@ function customize_admin_bar_menu($wp_admin_bar){
'title' => __( 'テーマ', THEME_NAME ), // ラベル
'href' => admin_url('themes.php') // ページURL
));
$wp_admin_bar->add_menu(array(
'parent' => 'dashboard_menu', // 親メニューID
'id' => 'dashboard_menu-patterns', // 子メニューID
'meta' => array(),
'title' => __( 'パターン', THEME_NAME ), // ラベル
'href' => admin_url('edit.php?post_type=wp_block') // ページURL
));
if (!is_classicpress()) {
$wp_admin_bar->add_menu(array(
'parent' => 'dashboard_menu', // 親メニューID
'id' => 'dashboard_menu-patterns', // 子メニューID
'meta' => array(),
'title' => __( 'パターン', THEME_NAME ), // ラベル
'href' => admin_url('edit.php?post_type=wp_block') // ページURL
));
}
$wp_admin_bar->add_menu(array(
'parent' => 'dashboard_menu', // 親メニューID
'id' => 'dashboard_menu-customize', // 子メニューID
Expand Down

0 comments on commit 86e27ef

Please sign in to comment.