WC_Admin_Addons::output_button( string $url, string $text, string $style, string $plugin = '' )
Outputs a button.
Description Description
Parameters Parameters
- $url
-
(Required) Destination URL.
- $text
-
(Required) Button label text.
- $style
-
(Required) Button style class.
- $plugin
-
(Optional) The plugin the button is promoting.
Default value: ''
Source Source
File: includes/admin/class-wc-admin-addons.php
public static function output_button( $url, $text, $style, $plugin = '' ) { $style = __( 'Free', 'woocommerce' ) === $text ? 'addons-button-outline-green' : $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 }