Action
uncanny-automator
automator_settings_premium_integration_before_output
Fires before the premium integration settings output in the Automator core, allowing for modifications.
add_action( 'automator_settings_premium_integration_before_output', $callback, 10, 1 );
Description
Fires before the premium integration settings are outputted. Developers can use this hook to add custom content, modify the output, or perform actions just before the integration settings are rendered on the page. It provides access to the integration object for further customization.
Usage
add_action( 'automator_settings_premium_integration_before_output', 'your_function_name', 10, 1 );
Parameters
-
$this(mixed) - This parameter represents the instance of the premium integration settings class, providing access to its methods and properties.
Examples
<?php
/**
* Example function to add a custom notice before the premium integration settings are output.
*
* This function checks if the current user has a specific capability and, if so,
* displays a notice indicating that they are viewing the premium integrations.
*
* @param object $settings_instance The instance of the premium integration settings class.
*/
function my_custom_automator_premium_integration_notice( $settings_instance ) {
// Check if the user has the capability to manage WordPress plugins.
if ( current_user_can( 'manage_options' ) ) {
// Display a simple notice using WordPress's built-in notice system.
// In a real-world scenario, you might use WP_Screen::add_notice or a more sophisticated method.
echo '<div class="notice notice-info is-dismissible"><p>' . esc_html__( 'You are currently viewing the premium integrations settings. Some features may require a premium license.', 'your-text-domain' ) . '</p></div>';
}
}
// Hook the function to the 'automator_settings_premium_integration_before_output' action.
// The '10' is the default priority, and '1' indicates that the function accepts one argument ($this).
add_action( 'automator_settings_premium_integration_before_output', 'my_custom_automator_premium_integration_notice', 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/lib/settings/premium-integration-settings.php:432
src/core/lib/settings/trait-premium-integration-templating.php:48
final public function output_wrapper() {
do_action( 'automator_settings_premium_integration_before_output', $this );
$this->output();
do_action( 'automator_settings_premium_integration_after_output', $this );
}
Internal Usage
Found in src/core/classes/class-usage-reports.php:88:
add_action( 'automator_settings_premium_integration_before_output', array( $this, 'count_premium_integration_view' ) );