WC_Admin_Addons::output_button() public WC 1.0
Outputs a button.
{} Это метод класса: WC_Admin_Addons{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$result = WC_Admin_Addons::output_button( $url, $text, $style, $plugin );
- $url(строка) (обязательный)
- Destination URL.
- $text(строка) (обязательный)
- Button label text.
- $style(строка) (обязательный)
- Button style class.
- $plugin(строка)
- The plugin the button is promoting.
Код WC_Admin_Addons::output_button() WC Admin Addons::output button WC 5.0.0
public static function output_button( $url, $text, $style, $plugin = '' ) {
$style = __( 'Free', 'woocommerce' ) === $text ? 'addons-button-outline-purple' : $style;
$style = is_plugin_active( $plugin ) ? 'addons-button-installed' : $style;
$text = is_plugin_active( $plugin ) ? __( 'Installed', 'woocommerce' ) : $text;
$url = self::add_in_app_purchase_url_params( $url );
?>
<a
class="addons-button <?php echo esc_attr( $style ); ?>"
href="<?php echo esc_url( $url ); ?>">
<?php echo esc_html( $text ); ?>
</a>
<?php
}