Filter
uncanny-automator
automator_run_automator_actions
Filters the actions that are run by the automator, allowing modification of the action queue.
add_filter( 'automator_run_automator_actions', $callback, 10, 1 );
Description
Allows developers to conditionally prevent or modify the execution of automator actions. This filter fires after core initializations, enabling control over whether actions are queued and processed. Use it to disable automator functionality or introduce custom logic before actions are added to the queue.
Usage
add_filter( 'automator_run_automator_actions', 'your_function_name', 10, 1 );
Parameters
-
$run_automator_actions(mixed) - This parameter controls whether automator actions should be executed.
Return Value
The filtered value.
Examples
// This filter allows controlling whether automator actions should run.
// For example, you might want to disable automator actions during maintenance.
add_filter( 'automator_run_automator_actions', function( $run_actions ) {
// Check if a specific maintenance mode option is active in WordPress options.
// Replace 'my_plugin_maintenance_mode' with your actual option name.
$is_maintenance_mode = get_option( 'my_plugin_maintenance_mode', false );
// If maintenance mode is active, prevent automator actions from running.
if ( $is_maintenance_mode ) {
return false; // Prevent automator actions
}
// Otherwise, allow automator actions to run.
return $run_actions;
}, 10, 1 );
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/core/classes/class-actionify-triggers.php:46
public function __construct() {
$run_automator_actions = true;
$run_automator_actions = apply_filters_deprecated(
'uap_run_automator_actions',
array( $run_automator_actions ),
'3.0',
'automator_run_automator_actions'
);
$run_automator_actions = apply_filters( 'automator_run_automator_actions', $run_automator_actions );
if ( $run_automator_actions ) {
add_action( 'plugins_loaded', array( $this, 'actionify_triggers' ), AUTOMATOR_ACTIONIFY_TRIGGERS_PRIORITY );
}
}