Skip to content

Commit

Permalink
MU WPCOM: Ensure that ETK features have higher priority than the ETK …
Browse files Browse the repository at this point in the history
…plugin (#38230)
  • Loading branch information
taipeicoder authored Jul 8, 2024
1 parent e4b409b commit dea21ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Load ETK features with a higher priority to avoid the ETK plugin taking precedence.
18 changes: 14 additions & 4 deletions projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public static function init() {
// Load features that don't need any special loading considerations.
add_action( 'plugins_loaded', array( __CLASS__, 'load_features' ) );

// Load ETK features that need higher priority than the ETK plugin.
add_action( 'plugins_loaded', array( __CLASS__, 'load_etk_features' ), 0 );

/*
* Please double-check whether you really need to load your feature separately.
* Chances are you can just add it to the `load_features` method.
Expand Down Expand Up @@ -95,14 +98,10 @@ public static function load_features() {
if ( ! class_exists( 'A8C\FSE\Help_Center' ) ) {
require_once __DIR__ . '/features/help-center/class-help-center.php';
}
require_once __DIR__ . '/features/hide-homepage-title/hide-homepage-title.php';
require_once __DIR__ . '/features/import-customizations/import-customizations.php';
require_once __DIR__ . '/features/marketplace-products-updater/class-marketplace-products-updater.php';
require_once __DIR__ . '/features/media/heif-support.php';
require_once __DIR__ . '/features/override-preview-button-url/override-preview-button-url.php';
require_once __DIR__ . '/features/paragraph-block-placeholder/paragraph-block-placeholder.php';
require_once __DIR__ . '/features/site-editor-dashboard-link/site-editor-dashboard-link.php';
require_once __DIR__ . '/features/tags-education/tags-education.php';
require_once __DIR__ . '/features/wpcom-block-editor/class-jetpack-wpcom-block-editor.php';
require_once __DIR__ . '/features/wpcom-block-editor/functions.editor-type.php';
require_once __DIR__ . '/features/wpcom-site-menu/wpcom-site-menu.php';
Expand All @@ -124,6 +123,17 @@ public static function load_features() {
}
}

/**
* Laod ETK features that need higher priority than the ETK plugin.
* Can be moved back to load_features() once the feature no longer exists in the ETK plugin.
*/
public static function load_etk_features() {
require_once __DIR__ . '/features/hide-homepage-title/hide-homepage-title.php';
require_once __DIR__ . '/features/override-preview-button-url/override-preview-button-url.php';
require_once __DIR__ . '/features/paragraph-block-placeholder/paragraph-block-placeholder.php';
require_once __DIR__ . '/features/tags-education/tags-education.php';
}

/**
* Load the Coming Soon feature.
*/
Expand Down

0 comments on commit dea21ad

Please sign in to comment.