Filter uncanny-automator

automator_admin_tools_tools_tabs

Filters the list of available admin tools tabs before they are displayed in the Automator admin section.

add_filter( 'automator_admin_tools_tools_tabs', $callback, 10, 1 );

Description

Fires when the Tools tab menu is being built. Developers can add or modify the existing tabs, allowing for custom tool integrations within the Automator admin area. This hook is applied to an empty array, so all tabs must be added programmatically.


Usage

add_filter( 'automator_admin_tools_tools_tabs', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

/**
 * Add a custom tool tab to the Automator Admin Tools.
 *
 * This function hooks into the 'automator_admin_tools_tools_tabs' filter
 * to add a new tab for managing custom post type sync settings.
 *
 * @param array $tabs An array of existing tool tabs.
 * @return array The updated array of tool tabs.
 */
function my_custom_automator_tool_tabs( $tabs ) {
    // Define the new tab's information.
    $new_tab = array(
        'id'    => 'custom_sync_settings',
        'title' => __( 'Custom Sync Settings', 'your-text-domain' ),
        'link'  => admin_url( 'admin.php?page=automator-tools&tab=custom_sync_settings' ),
    );

    // Add the new tab to the existing tabs array.
    $tabs[] = $new_tab;

    return $tabs;
}
add_filter( 'automator_admin_tools_tools_tabs', 'my_custom_automator_tool_tabs', 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/admin-tools/tabs/tools.php:104

public function get_status_tabs() {

		return apply_filters( 'automator_admin_tools_tools_tabs', array() );
	}

Scroll to Top