Skip to content

Commit

Permalink
Merge pull request #4331 from Codeinwp/revert-3813
Browse files Browse the repository at this point in the history
Revert 3813
  • Loading branch information
vytisbulkevicius authored Nov 22, 2024
2 parents 865d40d + 94cdf48 commit 6413ad5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
30 changes: 5 additions & 25 deletions e2e-tests/specs/customizer/hfg/hfg-menu-item-description.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] );
Expand Down
2 changes: 1 addition & 1 deletion inc/compatibility/web_stories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
}

Expand Down
2 changes: 1 addition & 1 deletion inc/core/core_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
22 changes: 13 additions & 9 deletions inc/customizer/options/layout_sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

/**
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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';
Expand Down
10 changes: 2 additions & 8 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -78,4 +71,5 @@ function neve_core_loader() {
\Neve_Pro\Core\Loader::instance();
}
}
add_action( 'after_setup_theme', 'neve_core_loader' );

neve_run();

0 comments on commit 6413ad5

Please sign in to comment.