From 26e9255450ef70ed122c596424f4d662cbd6a46d Mon Sep 17 00:00:00 2001 From: selul Date: Fri, 22 Nov 2024 20:54:37 +0200 Subject: [PATCH 1/3] revert changes --- inc/compatibility/web_stories.php | 2 +- inc/core/core_loader.php | 2 +- start.php | 10 ++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/inc/compatibility/web_stories.php b/inc/compatibility/web_stories.php index e287645e5f..430c67c42d 100644 --- a/inc/compatibility/web_stories.php +++ b/inc/compatibility/web_stories.php @@ -37,7 +37,7 @@ private function should_load() { * Load hooks. */ private function load_hooks() { - add_action( 'init', array( $this, 'setup' ) ); + add_action( 'after_setup_theme', array( $this, 'setup' ) ); add_action( 'wp_body_open', array( $this, 'embed' ) ); } diff --git a/inc/core/core_loader.php b/inc/core/core_loader.php index b35be758dc..6db32b3578 100644 --- a/inc/core/core_loader.php +++ b/inc/core/core_loader.php @@ -174,7 +174,7 @@ function () { ); $front_end = new Front_End(); add_action( 'wp_enqueue_scripts', array( $front_end, 'enqueue_scripts' ) ); - add_action( 'init', array( $front_end, 'setup_theme' ) ); + add_action( 'after_setup_theme', array( $front_end, 'setup_theme' ) ); add_action( 'widgets_init', array( $front_end, 'register_sidebars' ) ); add_filter( 'load_script_translation_file', array( $front_end, 'fix_script_translation_files' ), 10, 3 ); } diff --git a/start.php b/start.php index 1e2e26eb27..00f352ddf1 100644 --- a/start.php +++ b/start.php @@ -53,14 +53,7 @@ function neve_run() { } $autoloader->register(); -} - -neve_run(); -/** - * Load core modules. - */ -function neve_core_loader() { if ( class_exists( '\\Neve\\Core\\Core_Loader' ) ) { new \Neve\Core\Core_Loader(); } @@ -78,4 +71,5 @@ function neve_core_loader() { \Neve_Pro\Core\Loader::instance(); } } -add_action( 'after_setup_theme', 'neve_core_loader' ); + +neve_run(); From 04f22770f7a6d84a1928d889ec65bfd979068631 Mon Sep 17 00:00:00 2001 From: selul Date: Fri, 22 Nov 2024 21:27:52 +0200 Subject: [PATCH 2/3] fix early translation --- inc/admin/dashboard/main.php | 1 - inc/customizer/options/layout_sidebar.php | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/inc/admin/dashboard/main.php b/inc/admin/dashboard/main.php index 1f06563171..ccd65b8f8f 100755 --- a/inc/admin/dashboard/main.php +++ b/inc/admin/dashboard/main.php @@ -81,7 +81,6 @@ public function __construct() { */ public function init() { - $this->setup_config(); add_action( 'init', [ $this, 'setup_config' ] ); add_action( 'admin_menu', [ $this, 'register' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); diff --git a/inc/customizer/options/layout_sidebar.php b/inc/customizer/options/layout_sidebar.php index f2cf054d6f..0ac6a54954 100644 --- a/inc/customizer/options/layout_sidebar.php +++ b/inc/customizer/options/layout_sidebar.php @@ -36,14 +36,7 @@ class Layout_Sidebar extends Base_Customizer { */ public function __construct() { - $this->advanced_controls = [ - 'blog_archive' => __( 'Blog / Archive', 'neve' ), - 'single_post' => __( 'Single Post', 'neve' ), - ]; - $this->add_woocommerce_controls(); - - $this->advanced_controls['other_pages'] = __( 'Others', 'neve' ); } /** @@ -190,6 +183,17 @@ private function sidebar_layout_choices( $control_id ) { return $options; } + public function get_advanced_controls() { + if ( empty( $this->advanced_controls ) ) { + $this->advanced_controls = [ + 'blog_archive' => __( 'Blog / Archive', 'neve' ), + 'single_post' => __( 'Single Post', 'neve' ), + ]; + $this->add_woocommerce_controls(); + $this->advanced_controls['other_pages'] = __( 'Others', 'neve' ); + } + return $this->advanced_controls; + } /** * Advanced controls. */ @@ -203,8 +207,8 @@ private function add_advanced_controls() { * * @since 3.1.0 */ - $this->advanced_controls = apply_filters( 'neve_sidebar_controls_filter', $this->advanced_controls ); - foreach ( $this->advanced_controls as $id => $heading_label ) { + $advanced_controls = apply_filters( 'neve_sidebar_controls_filter', $this->get_advanced_controls() ); + foreach ( $advanced_controls as $id => $heading_label ) { $heading_id = 'neve_' . $id . '_heading'; $layout_id = 'neve_' . $id . '_sidebar_layout'; $width_id = 'neve_' . $id . '_content_width'; From 12196f32d09c7c285a533c5325f604fff487623b Mon Sep 17 00:00:00 2001 From: selul Date: Fri, 22 Nov 2024 21:31:14 +0200 Subject: [PATCH 3/3] revert test changes --- .../general/custom-global-colors.spec.ts | 7 +---- .../hfg/hfg-menu-item-description.spec.ts | 30 ++++--------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts b/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts index 755f74b20a..6a71257c4a 100644 --- a/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts +++ b/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts @@ -33,12 +33,7 @@ test.describe('Custom Global Color Control', () => { ); await clearWelcome(page); - const iframeElement = await page.waitForSelector('iframe'); - const frame = await iframeElement.contentFrame(); - if (frame) { - await frame.waitForSelector('.block-editor-rich-text__editable'); - await frame.locator('.block-editor-rich-text__editable').first().click(); - } + await page.locator('.block-editor-rich-text__editable').first().click(); // use Background color control to open the color picker, available since WP 6.1 await page.getByRole('button', { name: 'Background' }).click(); await page.getByRole('option', { name: 'Color: Custom 1' }).click(); diff --git a/e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts b/e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts index ae9514f310..afbf8c701c 100644 --- a/e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts +++ b/e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts @@ -28,36 +28,16 @@ test.describe('Menu item description', function () { await page.getByRole('button', { name: 'Add New Category' }).click(); await page.goto('wp-admin/nav-menus.php'); - await page.waitForSelector('.menu-name'); - await page.locator('.menu-name').fill('My New Menu'); - await page.getByLabel('Primary Menu').check(); - await page.locator('#save_menu_footer ').click(); - - await page.locator('#add-category h3').click(); await page - .locator('#taxonomy-category-tabs') - .getByRole('link', { name: 'View All' }) + .getByRole('heading', { + name: 'Categories Press return or enter to open this section ', + }) .click(); - await page.getByLabel('ADescriptionCat').check(); - - await Promise.all([ - page.waitForResponse( - (res) => - res.url().includes('wp-admin/admin-ajax.php') && - res.status() === 200 - ), - page.getByRole('button', { name: 'Add to Menu' }).click(), - ]); - - await page.keyboard.press('End'); - await page.waitForTimeout(500); - - await page.locator('#add-post-type-page h3').click(); await page - .locator('#posttype-page-tabs') + .locator('#taxonomy-category-tabs') .getByRole('link', { name: 'View All' }) .click(); - await page.getByLabel('Sample Page').last().check(); + await page.getByLabel('ADescriptionCat').check(); await Promise.all([ page.waitForResponse(