Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #4333

Merged
merged 7 commits into from
Nov 22, 2024
Merged

Release #4333

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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();
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
@@ -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(
1 change: 0 additions & 1 deletion inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
@@ -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' ] );
2 changes: 1 addition & 1 deletion inc/compatibility/web_stories.php
Original file line number Diff line number Diff line change
@@ -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' ) );
}

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