Merge branch 'master' of github.com:woothemes/woocommerce
This commit is contained in:
commit
84f91cad76
File diff suppressed because one or more lines are too long
|
@ -5036,6 +5036,7 @@ table.bar_chart {
|
|||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
padding: 3px 5px;
|
||||
width: 100% !important;
|
||||
}
|
||||
.select2-container {
|
||||
line-height: 1.85em;
|
||||
|
|
|
@ -24,6 +24,7 @@ class WC_Admin {
|
|||
public function __construct() {
|
||||
add_action( 'init', array( $this, 'includes' ) );
|
||||
add_action( 'current_screen', array( $this, 'conditional_includes' ) );
|
||||
add_action( 'admin_init', array( $this, 'buffer' ), 1 );
|
||||
add_action( 'admin_init', array( $this, 'preview_emails' ) );
|
||||
add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
|
||||
add_action( 'admin_init', array( $this, 'admin_redirects' ) );
|
||||
|
@ -31,6 +32,13 @@ class WC_Admin {
|
|||
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Output buffering allows admin screens to make redirects later on.
|
||||
*/
|
||||
public function buffer() {
|
||||
ob_start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Include any classes we need within admin.
|
||||
*/
|
||||
|
|
|
@ -127,7 +127,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
|
|||
// Load shipping methods so we can show any global options they may have
|
||||
$shipping_methods = WC()->shipping->load_shipping_methods();
|
||||
|
||||
if ( '' == $current_section ) {
|
||||
if ( '' === $current_section ) {
|
||||
$this->output_zones_screen();
|
||||
} elseif ( 'options' === $current_section ) {
|
||||
$settings = $this->get_settings();
|
||||
|
|
|
@ -18,6 +18,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php if ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) : ?>
|
||||
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>"><?php _e( 'Setup shipping zones', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?>
|
||||
<a class="button-secondary" href="<?php echo esc_url( 'https://docs.woothemes.com/document/setting-up-shipping-zones/' ); ?>"><?php _e( 'Lean more about shipping zones', 'woocommerce' ); ?></a>
|
||||
<a class="button-secondary" href="<?php echo esc_url( 'https://docs.woothemes.com/document/setting-up-shipping-zones/' ); ?>"><?php _e( 'Learn more about shipping zones', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -16,6 +16,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<p class="submit">
|
||||
<a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping' ) ); ?>"><?php _e( 'Setup shipping zones', 'woocommerce' ); ?></a>
|
||||
<a class="button-secondary" href="<?php echo esc_url( 'https://docs.woothemes.com/document/setting-up-shipping-zones/' ); ?>"><?php _e( 'Lean more about shipping zones', 'woocommerce' ); ?></a>
|
||||
<a class="button-secondary" href="<?php echo esc_url( 'https://docs.woothemes.com/document/setting-up-shipping-zones/' ); ?>"><?php _e( 'Learn more about shipping zones', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -31,6 +31,18 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
|
|||
add_action( 'woocommerce_flat_rate_shipping_add_rate', array( $this, 'calculate_extra_shipping' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process and redirect if disabled.
|
||||
*/
|
||||
public function process_admin_options() {
|
||||
parent::process_admin_options();
|
||||
|
||||
if ( 'no' === $this->settings[ 'enabled' ] ) {
|
||||
wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=options' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the option in the WP DB.
|
||||
* @since 2.6.0
|
||||
|
|
|
@ -32,6 +32,18 @@ class WC_Shipping_Legacy_Free_Shipping extends WC_Shipping_Method {
|
|||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process and redirect if disabled.
|
||||
*/
|
||||
public function process_admin_options() {
|
||||
parent::process_admin_options();
|
||||
|
||||
if ( 'no' === $this->settings[ 'enabled' ] ) {
|
||||
wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=options' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the option in the WP DB.
|
||||
* @since 2.6.0
|
||||
|
|
|
@ -26,6 +26,18 @@ class WC_Shipping_Legacy_Local_Delivery extends WC_Shipping_Local_Pickup {
|
|||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process and redirect if disabled.
|
||||
*/
|
||||
public function process_admin_options() {
|
||||
parent::process_admin_options();
|
||||
|
||||
if ( 'no' === $this->settings[ 'enabled' ] ) {
|
||||
wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=options' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the option in the WP DB.
|
||||
* @since 2.6.0
|
||||
|
|
|
@ -26,6 +26,18 @@ class WC_Shipping_Legacy_Local_Pickup extends WC_Shipping_Method {
|
|||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process and redirect if disabled.
|
||||
*/
|
||||
public function process_admin_options() {
|
||||
parent::process_admin_options();
|
||||
|
||||
if ( 'no' === $this->settings[ 'enabled' ] ) {
|
||||
wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=options' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the option in the WP DB.
|
||||
* @since 2.6.0
|
||||
|
|
Loading…
Reference in New Issue