woocommerce/includes/admin/views/html-notice-wootenberg.php

34 lines
1.9 KiB
PHP
Raw Normal View History

2018-06-13 18:36:36 +00:00
<?php
/**
* Admin View: Notice - Wootenberg Feature Plugin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div id="message" class="updated woocommerce-message woocommerce-wootenberg-promo-messages">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'wootenberg' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<p>
2018-11-15 18:19:51 +00:00
<?php echo wp_kses_post( __( "We noticed you have the block editor available: Try the WooCommerce Products Block for a powerful new way to feature products in posts.", 'woocommerce' ) ); ?>
</p>
<?php if ( file_exists( WP_PLUGIN_DIR . '/woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) && ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) && current_user_can( 'activate_plugin', 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) : ?>
<p>
2018-11-15 18:19:51 +00:00
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php&plugin_status=active' ), 'activate-plugin_woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate the Products Block', 'woocommerce' ); ?></a>
</p>
<?php else : ?>
2018-06-13 18:36:36 +00:00
<?php
if ( current_user_can( 'install_plugins' ) ) {
$url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woo-gutenberg-products-block' ), 'install-plugin_woo-gutenberg-products-block' );
} else {
$url = 'https://wordpress.org/plugins/woo-gutenberg-products-block/';
}
2018-06-13 18:36:36 +00:00
?>
<p>
2018-11-15 18:19:51 +00:00
<a href="<?php echo esc_url( $url ); ?>" class="button button-primary"><?php esc_html_e( 'Install the WooCommerce Products Block', 'woocommerce' ); ?></a>
</p>
<?php endif; ?>
2018-06-13 18:36:36 +00:00
</div>