WC_Admin_Addons::output_button()
Outputs a button.
Метод класса: WC_Admin_Addons{}
Хуков нет.
Возвращает
null
. Ничего (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 8.7.0
<?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 }