The uixpress/core/stop filter allows plugins and themes to programmatically stop UiXpress from initializing and running. This is useful when you need to disable UiXpress on specific pages, in certain contexts, or based on custom conditions.
When the filter returns true, UiXpress will stop early and only load minimal styles, preventing the full admin interface from loading.
uixpress/core/stop
WordPress Filter Hook - Modifies the stop condition
add_filter('uixpress/core/stop', function($should_stop, $action) {
// Modify stop condition
return $should_stop;
}, 10, 2);
$should_stop (bool): Current stop condition. true stops UiXpress, false allows it to run.$action (string): Current action from $_GET['action'] parameter (sanitized)Returns a boolean:
true - Stop UiXpress from runningfalse - Allow UiXpress to run normallyDefault priority is 10. Lower numbers run first.
By default, UiXpress will stop running in the following scenarios:
action=update-selected-themesaction=update-selectedbreakdance_wpuiforbuilder_tinymce=trueadd_filter('uixpress/core/stop', '__return_true');
add_filter('uixpress/core/stop', function($should_stop, $action) {
$screen = get_current_screen();
if ($screen && $screen->id === 'my-custom-page') {
return true; // Stop UiXpress on this page
}
return $should_stop; // Keep default behavior
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
$current_user = wp_get_current_user();
// Stop UiXpress for subscribers
if (in_array('subscriber', $current_user->roles)) {
return true;
}
return $should_stop;
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
// Stop UiXpress when a specific parameter is present
if (isset($_GET['disable_uixpress']) && $_GET['disable_uixpress'] === '1') {
return true;
}
return $should_stop;
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
global $post_type;
// Stop UiXpress when editing specific post types
$disabled_types = ['product', 'order'];
if (isset($post_type) && in_array($post_type, $disabled_types)) {
return true;
}
return $should_stop;
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
// Stop UiXpress if another plugin is active
if (is_plugin_active('conflicting-plugin/conflicting-plugin.php')) {
return true;
}
return $should_stop;
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
// Stop UiXpress if site is in maintenance mode
if (defined('WP_MAINTENANCE_MODE') && WP_MAINTENANCE_MODE) {
return true;
}
return $should_stop;
}, 10, 2);
add_filter('uixpress/core/stop', function($should_stop, $action) {
$screen = get_current_screen();
$current_user = wp_get_current_user();
// Stop UiXpress if:
// 1. On a specific screen, OR
// 2. User has a specific role, OR
// 3. A custom option is enabled
if (
($screen && $screen->id === 'my-custom-page') ||
in_array('subscriber', $current_user->roles) ||
get_option('my_plugin_disable_uixpress', false)
) {
return true;
}
return $should_stop;
}, 10, 2);
Unless you want to override the default behavior, always return the original $should_stop value:
// Good - preserves default behavior
add_filter('uixpress/core/stop', function($should_stop, $action) {
if (your_condition()) {
return true;
}
return $should_stop; // Preserve default
}, 10, 2);
// Bad - ignores default behavior
add_filter('uixpress/core/stop', function($should_stop, $action) {
return your_condition(); // Ignores default conditions
}, 10, 2);
Use priority to control when your filter runs:
// High priority - runs early, before other filters
add_filter('uixpress/core/stop', 'my_stop_function', 5, 2);
// Low priority - runs late, after other filters
add_filter('uixpress/core/stop', 'my_stop_function', 20, 2);
Always check if variables exist before using them:
add_filter('uixpress/core/stop', function($should_stop, $action) {
$screen = get_current_screen();
// Safe check
if ($screen && isset($screen->id) && $screen->id === 'my-page') {
return true;
}
return $should_stop;
}, 10, 2);
When using this filter in a plugin, document why you're disabling UiXpress:
/**
* Disable UiXpress on our custom admin page
*
* Our custom page uses its own UI that conflicts with UiXpress
*/
add_filter('uixpress/core/stop', function($should_stop, $action) {
$screen = get_current_screen();
if ($screen && $screen->id === 'my-plugin-page') {
return true;
}
return $should_stop;
}, 10, 2);
If creating a reusable function, use a namespaced function name:
function my_plugin_should_stop_uixpress($should_stop, $action) {
// Your logic here
return $should_stop;
}
add_filter('uixpress/core/stop', 'my_plugin_should_stop_uixpress', 10, 2);
true (not a truthy value)plugins_loaded or earlier)// Ensure filter is added early
add_action('plugins_loaded', function() {
add_filter('uixpress/core/stop', 'my_stop_function', 10, 2);
});
You can debug filter execution by logging:
add_filter('uixpress/core/stop', function($should_stop, $action) {
error_log('UiXpress stop check - Current: ' . ($should_stop ? 'true' : 'false'));
error_log('UiXpress stop check - Action: ' . $action);
// Your logic here
$new_stop = your_condition() ? true : $should_stop;
error_log('UiXpress stop check - New: ' . ($new_stop ? 'true' : 'false'));
return $new_stop;
}, 10, 2);
Name: uixpress/core/stop
Type: WordPress Filter Hook
Parameters:
$should_stop (bool): Current stop condition$action (string): Current action from $_GET['action']Returns: Boolean (true to stop UiXpress, false to allow)
Priority: Default 10 (lower runs first)
Since: Version 1.0.6