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-beta.1 10.0.2 5.2.0-rc.1 10.0.3 5.2.0-rc.2 10.0.4 5.2.1 10.0.5 5.2.2 10.0.6 5.2.3 10.1.0 5.2.4 10.1.0-rc.1 5.2.5 10.1.0-rc.2 5.3.0 10.1.0-rc.3 5.3.0-beta.1 10.1.0-rc.4 5.3.0-rc.1 10.1.1 5.3.0-rc.2 10.1.2 5.3.1 10.1.3 5.3.2 10.1.4 5.3.3 10.2.0 5.4.0 10.2.0-beta.1 5.4.0-beta.1 10.2.0-beta.2 5.4.0-rc.1 10.2.0-rc.1 5.4.1 10.2.1 5.4.2 10.2.2 5.4.3 10.2.3 5.4.4 10.2.4 5.4.5 10.3.0 5.5.0 10.3.0-beta.1 5.5.0-beta.1 10.3.0-beta.2 5.5.0-rc.1 10.3.0-rc.1 5.5.0-rc.2 10.3.0-rc.2 5.5.1 10.3.1 5.5.2 10.3.2 5.5.3 10.3.3 5.5.4 10.3.4 5.5.5 10.3.5 5.6.0 10.3.6 5.6.0-beta.1 10.3.7 5.6.0-rc.1 10.3.8 5.6.0-rc.2 10.4.0 5.6.1 10.4.0-beta.1 5.6.2 10.4.0-beta.2 5.6.3 10.4.0-rc.1 5.7.0 10.4.1 5.7.0-beta.1 10.4.2 5.7.0-rc.1 10.4.3 5.7.1 10.4.4 5.7.2 10.5.0 5.7.3 10.5.0-beta.1 5.8.0 10.5.0-beta.2 5.8.0-beta.1 10.5.0-rc.1 5.8.0-beta.2 10.5.0-rc.2 5.8.0-rc.1 10.5.0-rc.3 5.8.1 10.5.1 5.8.2 10.5.2 5.9.0 10.5.3 5.9.0-beta.1 10.6.0 5.9.0-rc.1 10.6.0-beta.1 5.9.0-rc.2 10.6.0-beta.2 5.9.1 10.6.0-rc.1 5.9.2 10.6.1 6.0.0 10.6.2 6.0.0-beta.1 10.7.0 6.0.0-rc.1 10.7.0-beta.1 6.0.1 10.7.0-beta.2 6.0.2 10.7.0-rc.1 6.1.0 3.0.0 6.1.0-beta.1 3.0.1 6.1.0-rc.1 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rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / includes / admin / views / html-admin-settings.php
woocommerce / includes / admin / views Last commit date
html-admin-dashboard-setup.php 1 month ago html-admin-page-addons-category-nav.php 4 years ago html-admin-page-product-export.php 1 year ago html-admin-page-reports.php 2 years ago html-admin-page-status-logs-db.php 2 years ago html-admin-page-status-logs.php 2 years ago html-admin-page-status-report.php 2 months ago html-admin-page-status-tools.php 1 month ago html-admin-page-status.php 8 years ago html-admin-settings.php 1 month ago html-bulk-edit-product.php 1 year ago html-email-template-preview.php 1 year ago html-notice-custom.php 8 years ago html-notice-update.php 6 months ago html-notice-updated.php 7 years ago html-notice-updating.php 6 years ago html-quick-edit-product.php 1 year ago html-report-by-date.php 5 years ago
html-admin-settings.php
206 lines
1 <?php
2 /**
3 * Admin View: Settings
4 *
5 * This file is included in WC_Admin_Settings::output().
6 *
7 * @package WooCommerce
8 */
9
10 // phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
11
12 use Automattic\WooCommerce\Internal\Admin\Settings\SettingsUIRequestContext;
13 use Automattic\WooCommerce\Utilities\FeaturesUtil;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * The current WC admin settings tab ID.
21 *
22 * @var string $current_tab
23 */
24
25 /**
26 * The current WC admin settings section ID.
27 *
28 * @var string $current_section
29 */
30
31 $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 );
32 $current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
33
34 if ( ! $tab_exists ) {
35 wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
36 exit;
37 }
38
39 // Resolve the Settings UI context for this request, falling back to legacy
40 // rendering when the settings SDK classes are unavailable or stale. The class
41 // can be missing or outdated mid-update, when this file has been replaced on
42 // disk but the cached autoloader has not refreshed yet.
43 $settings_ui_context = null;
44 $settings_ui_settings_page = null;
45 $is_rendering_settings_ui_drill_down = false;
46 try {
47 if ( class_exists( SettingsUIRequestContext::class ) ) {
48 $settings_ui_context = SettingsUIRequestContext::get_current();
49 }
50
51 if ( $settings_ui_context ) {
52 $settings_ui_settings_page = $settings_ui_context->get_settings_page();
53 $is_rendering_settings_ui_drill_down = $settings_ui_context->is_rendering_enabled()
54 && $settings_ui_context->is_drill_down()
55 && ! $settings_ui_context->has_schema_failed()
56 && ! $settings_ui_context->has_script_handles_failed();
57 }
58 } catch ( \Throwable $e ) {
59 $settings_ui_context = null;
60 $settings_ui_settings_page = null;
61 $is_rendering_settings_ui_drill_down = false;
62 }
63
64 // Drill-down pages replace the top-level settings tabs with their own header when the shell can render.
65 $hide_nav = ( 'checkout' === $current_tab && in_array( $current_section, array( 'offline', 'bacs', 'cheque', 'cod' ), true ) )
66 || $is_rendering_settings_ui_drill_down;
67
68 $is_settings_ui_page = null !== $settings_ui_settings_page;
69
70 // Drill-down pages replace the section links with header breadcrumbs when the shell can render.
71 if ( $settings_ui_settings_page instanceof WC_Settings_Page && $is_rendering_settings_ui_drill_down ) {
72 remove_action( 'woocommerce_sections_' . $current_tab, array( $settings_ui_settings_page, 'output_sections' ) );
73 }
74
75 // Move 'Advanced' to the last.
76 if ( array_key_exists( 'advanced', $tabs ) ) {
77 $advanced = $tabs['advanced'];
78 unset( $tabs['advanced'] );
79 // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
80 $tabs['advanced'] = $advanced;
81 }
82
83 $marketplace_base_url = trailingslashit(
84 esc_url_raw( apply_filters( 'woo_com_base_url', 'https://woocommerce.com/' ) )
85 ) . 'product-category/woocommerce-extensions/';
86
87 $marketplace_links = array(
88 'products' => array(
89 'url' => $marketplace_base_url . 'merchandising/',
90 'is_external' => true,
91 /* translators: %1$s: opening link tag, %2$s: closing link tag */
92 'message' => __( '%1$sExplore solutions%2$s that help highlight products and drive more sales.', 'woocommerce' ),
93 ),
94 'tax' => array(
95 'url' => $marketplace_base_url . 'operations/sales-tax-and-duties/',
96 'is_external' => true,
97 /* translators: %1$s: opening link tag, %2$s: closing link tag */
98 'message' => __( '%1$sExplore solutions%2$s that help with tax calculations, compliance, and regional requirements.', 'woocommerce' ),
99 ),
100 'shipping' => array(
101 'url' => $marketplace_base_url . 'shipping-delivery-and-fulfillment/',
102 'is_external' => true,
103 /* translators: %1$s: opening link tag, %2$s: closing link tag */
104 'message' => __( '%1$sExplore solutions%2$s that enhance shipping, delivery, and fulfillment workflows.', 'woocommerce' ),
105 ),
106 'account' => array(
107 'url' => $marketplace_base_url . 'store-content-and-customizations/cart-and-checkout-features/',
108 'is_external' => true,
109 /* translators: %1$s: opening link tag, %2$s: closing link tag */
110 'message' => __( '%1$sExplore solutions%2$s that help customize cart and checkout flows.', 'woocommerce' ),
111 ),
112 'email' => array(
113 'url' => $marketplace_base_url . 'marketing-extensions/email-marketing-extensions/',
114 'is_external' => true,
115 /* translators: %1$s: opening link tag, %2$s: closing link tag */
116 'message' => __( '%1$sExplore solutions%2$s that help automate and improve customer email communication.', 'woocommerce' ),
117 ),
118 'general' => array(
119 'url' => admin_url( 'admin.php?page=wc-admin&path=%2Fextensions' ),
120 'is_external' => false,
121 /* translators: %1$s: opening link tag, %2$s: closing link tag */
122 'message' => __( '%1$sDiscover additional solutions%2$s to boost your business and expand what your store can do.', 'woocommerce' ),
123 ),
124 );
125
126 ?>
127
128 <div class="wrap woocommerce">
129 <?php do_action( 'woocommerce_before_settings_' . $current_tab ); ?>
130 <form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
131 <?php if ( ! $hide_nav ) : ?>
132 <nav class="nav-tab-wrapper woo-nav-tab-wrapper">
133 <?php
134
135 foreach ( $tabs as $slug => $label ) {
136 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>';
137 }
138
139 /**
140 * Hook for adding additional settings tabs.
141 *
142 * @since 1.0.0
143 */
144 do_action( 'woocommerce_settings_tabs' );
145
146 ?>
147 </nav>
148 <?php endif; ?>
149 <h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
150 <?php
151 do_action( 'woocommerce_sections_' . $current_tab );
152
153 WC_Admin_Settings::show_messages();
154
155 do_action( 'woocommerce_settings_' . $current_tab );
156 do_action( 'woocommerce_settings_tabs_' . $current_tab );
157 ?>
158 <p class="submit">
159 <?php if ( empty( $GLOBALS['hide_save_button'] ) ) : ?>
160 <button name="save" disabled class="woocommerce-save-button components-button is-primary" type="submit" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
161 <?php endif; ?>
162 <?php wp_nonce_field( 'woocommerce-settings' ); ?>
163 </p>
164 <?php if ( isset( $marketplace_links[ $current_tab ] ) ) : ?>
165 <?php
166 $link_config = $marketplace_links[ $current_tab ];
167
168 if ( $link_config['is_external'] ) {
169 $utm_source = 'settings_' . $current_tab . ( $current_section ? '_' . $current_section : '' );
170 $link_url = add_query_arg( 'utm_source', $utm_source, $link_config['url'] );
171 $icon_url = WC()->plugin_url() . '/assets/images/icons/external-link.svg';
172 $external_icon = '<img src="' . esc_url( $icon_url ) . '" alt="" />';
173 $screen_reader = '<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'woocommerce' ) . '</span>';
174 $link_open = '<a href="' . esc_url( $link_url ) . '" target="_blank" rel="noopener noreferrer">' . $external_icon;
175 $link_close = $screen_reader . '</a>';
176 } else {
177 $link_open = '<a href="' . esc_url( $link_config['url'] ) . '">';
178 $link_close = '</a>';
179 }
180 ?>
181 <p class="wc-settings-marketplace-link" data-settings-tab="<?php echo esc_attr( $current_tab ); ?>"<?php echo $current_section ? ' data-settings-section="' . esc_attr( $current_section ) . '"' : ''; ?>>
182 <?php
183 echo wp_kses(
184 sprintf( $link_config['message'], $link_open, $link_close ),
185 array(
186 'a' => array(
187 'href' => array(),
188 'target' => array(),
189 'rel' => array(),
190 ),
191 'img' => array(
192 'src' => array(),
193 'alt' => array(),
194 ),
195 'span' => array(
196 'class' => array(),
197 ),
198 )
199 );
200 ?>
201 </p>
202 <?php endif; ?>
203 </form>
204 <?php do_action( 'woocommerce_after_settings_' . $current_tab ); ?>
205 </div>
206