WC_Admin_Addons::output_button()public staticWC 1.0

Outputs a button.

Method of the class: WC_Admin_Addons{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Addons::output_button( $url, $text, $style, $plugin );
$url(string) (required)
Destination URL.
$text(string) (required)
Button label text.
$style(string) (required)
Button style class.
$plugin(string)
The plugin the button is promoting.
Default: ''

WC_Admin_Addons::output_button() code WC 8.6.1

<?php
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
}