Filter
uncanny-automator
automator_log_pages
Filters the list of log pages available within Uncanny Automator.
add_filter( 'automator_log_pages', $callback, 10, 1 );
Description
Filters the list of admin page slugs considered "log pages" by Uncanny Automator. Developers can add or remove slugs to customize which pages trigger log-specific functionalities, such as automatic log cleanup or specific display settings. This hook fires during admin menu initialization.
Usage
add_filter( 'automator_log_pages', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
// Add a new custom log page slug to the list of recognized log pages.
function my_custom_automator_log_pages( $log_pages ) {
$log_pages[] = 'my-custom-automator-logs'; // Replace with your actual custom log page slug
return $log_pages;
}
add_filter( 'automator_log_pages', 'my_custom_automator_log_pages', 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/admin/class-admin-menu.php:235
public function is_a_log( $hook ) {
$log_pages = apply_filters(
'automator_log_pages',
array(
'uncanny-automator-recipe-activity',
'uncanny-automator-recipe-activity-details',
'admin_page_uncanny-automator-recipe-activity-details',
'uncanny-automator-debug-log',
'uncanny-automator-recipe-log',
'uncanny-automator-trigger-log',
'uncanny-automator-action-log',
'uncanny-automator-admin-logs',
)
);
foreach ( $log_pages as $page ) {
if ( strpos( $hook, $page ) ) {
return true;
}
}
return false;
}
Internal Usage
Found in src/core/admin/api-log/class-api-log.php:25:
add_filter( 'automator_log_pages', array( $this, 'add_log_page' ) );