Action Since x.x.x uncanny-automator-pro

post_edd_sl_plugin_updater_setup

Fires after the $edd_plugin_data is setup. Fires after Easy Digital Downloads Software Licensing plugin data is fully set up.

add_action( 'post_edd_sl_plugin_updater_setup', $callback, 10, 1 );

Description

Fires after EDD Software Licensing plugin data is prepared for an update check. Developers can use this hook to modify the plugin data array before the update process begins, potentially influencing which version is detected or how the update is handled. This hook is called internally during Uncanny Automator's EDD SL update initialization.


Usage

add_action( 'post_edd_sl_plugin_updater_setup', 'your_function_name', 10, 1 );

Parameters

$edd_plugin_data (array)
Array of EDD SL plugin data.

Examples

add_action( 'post_edd_sl_plugin_updater_setup', 'my_custom_edd_sl_updater_setup', 10, 1 );

/**
 * Example function to hook into the post_edd_sl_plugin_updater_setup action.
 * This function could be used to modify or log the EDD SL plugin data
 * after it has been initially set up.
 *
 * @param array $edd_plugin_data Array of EDD SL plugin data.
 */
function my_custom_edd_sl_updater_setup( $edd_plugin_data ) {
    // For demonstration, let's add a custom key to the plugin data.
    // In a real-world scenario, you might be checking specific plugin details.
    if ( isset( $edd_plugin_data['plugin_name'] ) && strpos( $edd_plugin_data['plugin_name'], 'My Awesome Plugin' ) !== false ) {
        $edd_plugin_data['custom_setup_timestamp'] = time();
        // You could also log this event:
        // error_log( 'My Awesome Plugin EDD SL updater setup complete at: ' . date('Y-m-d H:i:s') );
    }

    // If this were a filter, you would return the modified data like:
    // return $edd_plugin_data;
}

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

uncanny-automator-pro/src/core/admin/licensing/EDD_SL_Plugin_Updater.php:63

public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {

		global $edd_plugin_data;

		$this->api_url                  = trailingslashit( $_api_url );
		$this->api_data                 = $_api_data;
		$this->plugin_file              = $_plugin_file;
		$this->name                     = plugin_basename( $_plugin_file );
		$this->slug                     = basename( dirname( $_plugin_file ) );
		$this->version                  = $_api_data['version'];
		$this->wp_override              = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
		$this->beta                     = ! empty( $this->api_data['beta'] ) ? true : false;
		$this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url );

		$edd_plugin_data[ $this->slug ] = $this->api_data;

		/**
		 * Fires after the $edd_plugin_data is setup.
		 *
		 * @since x.x.x
		 *
		 * @param array $edd_plugin_data Array of EDD SL plugin data.
		 */
		do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );

		// Set up hooks.
		$this->init();
	}

Scroll to Top