uo_pro_after_license_details
Fires after license details are displayed, providing access to license data for further customization.
add_action( 'uo_pro_after_license_details', $callback, 10, 1 );
Description
Fires after license details are displayed on the Uncanny Owl Pro Toolkit admin page. Developers can use this hook to inject custom content or modify the displayed license information. The `$license_data` object is passed, containing license specifics. This hook is intended for internal use by the Uncanny Owl Pro Toolkit.
Usage
add_action( 'uo_pro_after_license_details', 'your_function_name', 10, 1 );
Parameters
-
$license_data(mixed) - The `$license_data` parameter contains an object that holds all relevant information about the Uncanny Owl Pro license.
Examples
/**
* Example function to hook into uo_pro_after_license_details.
* This function will add an extra line displaying the license status.
*
* @param object $license_data The license data object passed by the hook.
*/
function my_uncanny_pro_toolkit_license_status_display( $license_data ) {
// Ensure $license_data is an object and has the 'status' property.
if ( is_object( $license_data ) && isset( $license_data->status ) ) {
$status_text = '';
switch ( $license_data->status ) {
case 'valid':
$status_text = esc_html__( 'Active', 'uncanny-pro-toolkit' );
break;
case 'expired':
$status_text = esc_html__( 'Expired', 'uncanny-pro-toolkit' );
break;
case 'invalid':
$status_text = esc_html__( 'Invalid', 'uncanny-pro-toolkit' );
break;
default:
$status_text = esc_html__( 'Unknown', 'uncanny-pro-toolkit' );
break;
}
// Output the additional license status information.
echo '<div class="license-status-extra">';
echo '<strong>' . esc_html__( 'Status', 'uncanny-pro-toolkit' ) . ':</strong> ';
echo '<span class="license-status-value">' . $status_text . '</span>';
echo '</div>';
}
}
add_action( 'uo_pro_after_license_details', 'my_uncanny_pro_toolkit_license_status_display', 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/includes/admin-license.php:154
<strong><?php esc_attr_e( 'Expires', 'uncanny-pro-toolkit' ); ?>:</strong> <span class="license-expires-value"><?php echo $license_data->expires; ?></span>
</div>
<?php
}
?>
<?php
if ( ! empty( $license_data ) ) {
do_action( 'uo_pro_after_license_details', $license_data );
}
?>
<?php } else { ?>
<div class="uncannyowl-license-content-title"><?php esc_attr_e( 'Your license is not active', 'uncanny-pro-toolkit' ); ?></div>
<div class="uncannyowl-license-content-description"><?php esc_attr_e( 'Please enter a valid license code and click "Activate now".', 'uncanny-pro-toolkit' ); ?></div>
<input id="uncannyowl-license-field"