2014-07-28 14:50:11 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Admin View: Settings
|
2017-10-25 11:51:19 +00:00
|
|
|
*
|
|
|
|
* @package WooCommerce
|
2014-07-28 14:50:11 +00:00
|
|
|
*/
|
2017-10-25 11:51:19 +00:00
|
|
|
|
2014-07-28 15:16:35 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2016-01-05 11:23:15 +00:00
|
|
|
exit;
|
2014-07-28 15:16:35 +00:00
|
|
|
}
|
2016-02-23 09:11:02 +00:00
|
|
|
|
2017-10-25 11:51:19 +00:00
|
|
|
$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'woocommerce_sections_' . $current_tab ) || has_action( 'woocommerce_settings_' . $current_tab ) || has_action( 'woocommerce_settings_tabs_' . $current_tab );
|
|
|
|
$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
|
|
|
|
|
|
|
|
if ( ! $tab_exists ) {
|
|
|
|
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
|
|
|
|
exit;
|
|
|
|
}
|
2014-07-28 14:50:11 +00:00
|
|
|
?>
|
2013-07-26 14:36:28 +00:00
|
|
|
<div class="wrap woocommerce">
|
2015-01-06 19:24:32 +00:00
|
|
|
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
|
2016-03-10 12:52:20 +00:00
|
|
|
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
2013-07-26 14:36:28 +00:00
|
|
|
<?php
|
2017-10-25 11:51:19 +00:00
|
|
|
|
|
|
|
foreach ( $tabs as $slug => $label ) {
|
|
|
|
echo '<a href="' . esc_html( admin_url( 'admin.php?page=wc-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
do_action( 'woocommerce_settings_tabs' );
|
|
|
|
|
2013-07-26 14:36:28 +00:00
|
|
|
?>
|
2016-03-10 12:52:20 +00:00
|
|
|
</nav>
|
2017-10-25 11:51:19 +00:00
|
|
|
<h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
|
2013-07-26 14:36:28 +00:00
|
|
|
<?php
|
2016-01-05 11:23:15 +00:00
|
|
|
do_action( 'woocommerce_sections_' . $current_tab );
|
|
|
|
|
2015-11-11 14:18:26 +00:00
|
|
|
self::show_messages();
|
|
|
|
|
2013-07-26 14:36:28 +00:00
|
|
|
do_action( 'woocommerce_settings_' . $current_tab );
|
2018-04-16 13:27:03 +00:00
|
|
|
do_action( 'woocommerce_settings_tabs_' . $current_tab ); // @deprecated hook. @todo remove in 4.0.
|
2013-07-26 14:36:28 +00:00
|
|
|
?>
|
2014-11-30 06:52:32 +00:00
|
|
|
<p class="submit">
|
2016-03-15 16:21:57 +00:00
|
|
|
<?php if ( empty( $GLOBALS['hide_save_button'] ) ) : ?>
|
2017-11-07 08:32:12 +00:00
|
|
|
<button name="save" class="button-primary woocommerce-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
|
2014-11-30 06:52:32 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php wp_nonce_field( 'woocommerce-settings' ); ?>
|
|
|
|
</p>
|
2013-07-26 14:36:28 +00:00
|
|
|
</form>
|
2014-11-30 06:52:32 +00:00
|
|
|
</div>
|