This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Astra_Addon_License_Notice::build_notice_html( string $heading, string $body, string $primary_label, string $primary_url, bool $primary_external = true, string $secondary_label = '', string $secondary_url = '' )
Build the shared HTML template for all license notices.
Description
Parameters
- $heading
-
(string) (Required) Notice heading.
- $body
-
(string) (Required) Notice body text.
- $primary_label
-
(string) (Required) Primary CTA button label.
- $primary_url
-
(string) (Required) Primary CTA button URL.
- $primary_external
-
(bool) (Optional) Whether the primary CTA opens in a new tab.
Default value: true
- $secondary_label
-
(string) (Optional) secondary link label (e.g. "Learn More").
Default value: ''
- $secondary_url
-
(string) (Optional) secondary link URL.
Default value: ''
Return
(string) HTML markup.
Source
File: admin/core/includes/class-astra-addon-license-notice.php
private function build_notice_html( $heading, $body, $primary_label, $primary_url, $primary_external = true, $secondary_label = '', $secondary_url = '' ) {
$logo_url = ASTRA_THEME_URI . 'inc/assets/images/astra-logo.svg';
$primary_target = $primary_external ? ' target="_blank" rel="noopener noreferrer"' : '';
$secondary_html = $secondary_label && $secondary_url
? sprintf(
'<a href="%s" target="_blank" rel="noopener noreferrer" class="button">%s</a>',
esc_url( $secondary_url ),
$secondary_label
)
: '';
return sprintf(
'<div class="astra-addon-license-notice-content" style="padding: 12px 0;">
<div class="astra-addon-license-notice-logo">
<img src="%1$s" alt="Astra Logo" />
</div>
<div class="astra-addon-license-notice-body-wrapper">
<div class="astra-addon-license-notice-header">
<strong>%2$s</strong>
</div>
<div class="astra-addon-license-notice-body">
<p>%3$s</p>
</div>
<div class="astra-addon-license-notice-actions">
<a href="%4$s"%5$s class="button button-primary" style="margin-right: 10px;">%6$s</a>
%7$s
</div>
</div>
</div>',
esc_url( $logo_url ),
$heading,
$body,
esc_url( $primary_url ),
$primary_target,
$primary_label,
$secondary_html
);
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.13.4 | Introduced. |