Skip to content

Commit ca0eee1

Browse files
authored
feat: put Template Library behind WU_TEMPLATE_LIBRARY_ENABLED feature flag (#599)
* Revert "feat: rename Primary Domain to Main WP Multisite WaaS Domain with red toggle and confirmation (#438)" This reverts commit a205ea8. * feat: put Template Library behind WU_TEMPLATE_LIBRARY_ENABLED feature flag The Template Library admin page is now hidden by default since server-side functionality is not complete. Developers can enable it by defining: define('WU_TEMPLATE_LIBRARY_ENABLED', true); in wp-config.php before the plugin loads. - Add WU_TEMPLATE_LIBRARY_ENABLED constant to constants.php (defaults to false) - Wrap Template_Library_Admin_Page instantiation with feature flag check - Include inline documentation explaining the feature flag purpose
1 parent c25a33a commit ca0eee1

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

constants.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@
2323
if ( ! defined('WP_ULTIMO_PLUGIN_BASENAME')) {
2424
define('WP_ULTIMO_PLUGIN_BASENAME', plugin_basename(WP_ULTIMO_PLUGIN_FILE));
2525
}
26+
27+
/**
28+
* Feature flag: Enable Template Library.
29+
*
30+
* When set to true, enables the Template Library admin page.
31+
* Server-side functionality is not complete, so this defaults to false.
32+
* Developers can enable this by defining WU_TEMPLATE_LIBRARY_ENABLED as true
33+
* in wp-config.php before the plugin loads.
34+
*
35+
* @since 2.5.0
36+
*/
37+
if ( ! defined('WU_TEMPLATE_LIBRARY_ENABLED')) {
38+
define('WU_TEMPLATE_LIBRARY_ENABLED', false);
39+
}

inc/class-wp-ultimo.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,18 @@ protected function load_admin_only_pages(): void {
855855

856856
new WP_Ultimo\Admin_Pages\Setup_Wizard_Admin_Page();
857857

858-
new WP_Ultimo\Admin_Pages\Template_Library_Admin_Page();
858+
/**
859+
* Template Library Admin Page.
860+
*
861+
* This is behind a feature flag as server-side functionality
862+
* is not yet complete. Define WU_TEMPLATE_LIBRARY_ENABLED as true
863+
* in wp-config.php to enable for development/testing.
864+
*
865+
* @since 2.5.0
866+
*/
867+
if (defined('WU_TEMPLATE_LIBRARY_ENABLED') && WU_TEMPLATE_LIBRARY_ENABLED) {
868+
new WP_Ultimo\Admin_Pages\Template_Library_Admin_Page();
869+
}
859870

860871
do_action('wp_ultimo_admin_pages');
861872
}

0 commit comments

Comments
 (0)