Astra_Addon_License_Notice::register_license_notice()
Register license activation notice
Description
Return
(void)
Source
File: admin/core/includes/class-astra-addon-license-notice.php
public function register_license_notice() {
// Check if Astra_Notices class is available.
if ( ! class_exists( 'Astra_Notices' ) ) {
return;
}
// Check if license is active.
$is_license_active = ASTRA_ADDON_BSF_PACKAGE && is_callable( 'BSF_License_Manager::bsf_is_active_license' ) ?
call_user_func( 'BSF_License_Manager::bsf_is_active_license', $this->get_product_id() ) : false;
// Only show notice if license is not active and it's a BSF package.
if ( $is_license_active || ! ASTRA_ADDON_BSF_PACKAGE ) {
return;
}
// Generate the notice HTML.
$notice_html = $this->get_notice_html();
// Add the notice using Astra_Notices library.
Astra_Notices::add_notice(
array(
'id' => 'astra-addon-license-inactive',
'type' => 'error',
'message' => $notice_html,
'show_if' => true,
'repeat-notice-after' => false,
'display-with-other-notices' => true,
'is_dismissible' => true,
'capability' => 'manage_options',
'priority' => 8,
'class' => 'astra-addon-license-notice',
)
);
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.12.0 | Introduced. |