ucec_after_license_details
Fires after license details are displayed, providing access to the license data array for further manipulation.
add_action( 'ucec_after_license_details', $callback, 10, 1 );
Description
Fires after the license details are displayed in the Uncanny CEU admin area. Developers can use this hook to append custom information or modify the license display. It passes the `$license_data` object containing license details.
Usage
add_action( 'ucec_after_license_details', 'your_function_name', 10, 1 );
Parameters
-
$license_data(mixed) - This parameter contains an object holding detailed information about the product license, including customer name and email.
Examples
/**
* Add additional information after the license details are displayed.
*
* This function demonstrates how to hook into the 'ucec_after_license_details'
* action hook to add custom content. In this example, we'll check if the
* license is expired and display a message if it is.
*
* @param object $license_data The license data object passed to the hook.
*/
add_action(
'ucec_after_license_details',
function( $license_data ) {
// Ensure we have valid license data and it's an object before proceeding.
if ( ! is_object( $license_data ) || ! isset( $license_data->expires ) ) {
return;
}
$current_time = time();
$expiration_timestamp = strtotime( $license_data->expires );
// Check if the license has expired.
if ( $expiration_timestamp !== false && $expiration_timestamp < $current_time ) {
echo '<p class="ucec-license-expired-notice">';
printf(
esc_html__( 'Your license key expired on %s. Please renew to continue receiving updates and support.', 'your-text-domain' ),
date( get_option( 'date_format' ), $expiration_timestamp )
);
echo '</p>';
}
},
10, // Priority: 10 is the default, meaning it runs after most other callbacks.
1 // Accepted args: This hook passes 1 argument: $license_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
src/templates/admin-license.php:152
<br/>
<?php
if ( isset( $license_data->customer_name ) ) {
printf( '<strong>%s:</strong> %s (%s)', __( 'Account', 'uncanny-ceu' ), $license_data->customer_name, $license_data->customer_email );
}
?>
</p>
<?php do_action( 'ucec_after_license_details', $license_data ); ?>
</div>
<?php } else { ?>
<input id="ucec-license-field"
name="ceu_license_key" type="password"
value="<?php esc_attr_e( $license ); ?>"
placeholder="<?php _e( 'Enter your license key', 'uncanny-ceu' ); ?>"