Action
uncanny-automator
automator_settings_debug
Fires when the Automator plugin's debug mode is activated, allowing custom actions during debugging.
add_action( 'automator_settings_debug', $callback, 10, 1 );
Description
Fires on the Debug settings tab to allow developers to add custom debug options or content. Use this hook to extend the Automator debug screen with additional information or controls.
Usage
add_action( 'automator_settings_debug', 'your_function_name', 10, 1 );
Examples
<?php
/**
* Example of how to hook into the 'automator_settings_debug' action.
* This function will add a custom debug setting section to the Uncanny Automator
* debug settings page.
*/
add_action( 'automator_settings_debug', 'my_custom_automator_debug_section' );
/**
* Adds a custom debug setting section to the Uncanny Automator debug settings.
*
* This function demonstrates how to inject content into the automator_settings_debug hook.
* It will output a simple HTML section with a checkbox to toggle a hypothetical
* custom debug mode for your plugin.
*/
function my_custom_automator_debug_section() {
// Get the current value of our custom debug setting.
// Assume this setting is stored in the WordPress options table or a custom user meta.
$custom_debug_enabled = get_option( 'my_plugin_custom_debug_mode', false );
?>
<div class="uap-settings-sub-block">
<h3><?php esc_html_e( 'My Custom Debug Settings', 'my-plugin-text-domain' ); ?></h3>
<div class="uap-settings-panel-content">
<div class="uap-settings-field">
<label for="my_plugin_custom_debug_mode">
<input type="checkbox" name="my_plugin_custom_debug_mode" id="my_plugin_custom_debug_mode" value="1" <?php checked( $custom_debug_enabled, true ); ?>>
<?php esc_html_e( 'Enable my custom plugin debug mode', 'my-plugin-text-domain' ); ?>
</label>
<p class="description"><?php esc_html_e( 'This will enable additional logging and diagnostic information for my custom plugin.', 'my-plugin-text-domain' ); ?></p>
</div>
</div>
</div>
<?php
}
/**
* Example of saving the custom debug setting when the Uncanny Automator settings page is saved.
*
* This assumes Uncanny Automator has a general settings save hook that fires after processing its own settings.
* You might need to adapt this based on Uncanny Automator's actual save mechanism or use a more generic WordPress save hook.
*/
add_action( 'automator_settings_save', 'save_my_custom_automator_debug_setting' );
function save_my_custom_automator_debug_setting( $posted_data ) {
// Check if our custom setting was posted.
if ( isset( $_POST['my_plugin_custom_debug_mode'] ) ) {
update_option( 'my_plugin_custom_debug_mode', true );
} else {
update_option( 'my_plugin_custom_debug_mode', false );
}
}
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/views/admin-tools/tab/debug/debug.php:74
<?php #esc_html_e( 'Enable or disable developer warnings and notices.', 'uncanny-automator' ); ?>
</div>
</div -->
<?php do_action( 'automator_settings_debug' ); ?>
</div>
</div>
<div class="uap-settings-panel-bottom">