$primary,
'secondary' => $secondary,
'highlight' => $highlight,
'content_bg' => $content_bg,
'subtext' => $subtext
);
$old_colors = get_option( 'woocommerce_frontend_css_colors' );
update_option( 'woocommerce_frontend_css_colors', $colors );
if ( $old_colors != $colors )
woocommerce_compile_less_styles();
}
} else {
// If saving a shipping methods options, load 'er up
if ( $current_tab == 'shipping' && class_exists( $current_section ) ) {
$current_section_class = new $current_section();
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id );
// If saving an email's options, load theme
} elseif ( $current_tab == 'email' ) {
// Load mailer
$mailer = $woocommerce->mailer();
if ( class_exists( $current_section ) ) {
$current_section_class = new $current_section();
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id );
} else {
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section );
}
} else {
// Save section only
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section );
}
}
// Clear any unwanted data
$woocommerce->clear_product_transients();
// Redirect back to the settings page
$redirect = add_query_arg( 'saved', 'true' );
if ( ! empty( $_POST['subtab'] ) ) $redirect = add_query_arg( 'subtab', esc_attr( str_replace( '#', '', $_POST['subtab'] ) ), $redirect );
wp_safe_redirect( $redirect );
exit;
}
// Get any returned messages
$error = ( empty( $_GET['wc_error'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_error'] ) );
$message = ( empty( $_GET['wc_message'] ) ) ? '' : urldecode( stripslashes( $_GET['wc_message'] ) );
if ( $error || $message ) {
if ( $error ) {
echo '
' . esc_html( $error ) . '
';
} else {
echo '' . esc_html( $message ) . '
';
}
} elseif ( ! empty( $_GET['saved'] ) ) {
echo '' . __( 'Your settings have been saved.', 'woocommerce' ) . '
';
}
// Were the settings saved?
if ( ! empty( $_GET['saved'] ) ) {
do_action('woocommerce_settings_saved');
}
// Hide WC Link
if (isset($_GET['hide-wc-extensions-message']))
update_option('hide-wc-extensions-message', 1);
// Install/page installer
$install_complete = false;
// Add pages button
if (isset($_GET['install_woocommerce_pages']) && $_GET['install_woocommerce_pages']) {
require_once( 'woocommerce-admin-install.php' );
woocommerce_create_pages();
update_option('skip_install_woocommerce_pages', 1);
$install_complete = true;
// Skip button
} elseif (isset($_GET['skip_install_woocommerce_pages']) && $_GET['skip_install_woocommerce_pages']) {
update_option('skip_install_woocommerce_pages', 1);
$install_complete = true;
}
if ($install_complete) {
?>
Congratulations! – WooCommerce has been installed and setup. Enjoy :)', 'woocommerce' ); ?>
$attribute_value )
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
if ( $value['desc_tip'] === true ) {
$description = '';
} elseif ( $value['desc_tip'] ) {
$description = '';
} else {
$description = '' . wp_kses_post( $value['desc'] ) . '';
}
switch( $value['type'] ) {
case 'title':
if ( isset($value['name'] ) && $value['name'] ) echo '' . esc_html( $value['name'] ) . '
';
if ( isset($value['desc'] ) && $value['desc'] ) echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
echo '';
if ( isset($value['id'] ) && $value['id'] ) do_action( 'woocommerce_settings_' . sanitize_title( $value['id'] ) . '_after' );
break;
case 'text':
case 'email':
case 'number':
?>
|
/> |
|
/> |
|
|
|
|
|
|
|
' . wp_kses_post( $value['desc'] ) . ''; ?>
|
$value['id'],
'id' => $value['id'],
'sort_column' => 'menu_order',
'sort_order' => 'ASC',
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => $page_setting);
if( isset($value['args']) ) $args = wp_parse_args($value['args'], $args);
?>
|
|
countries->countries;
$country_setting = (string) get_option($value['id']);
if (strstr($country_setting, ':')) :
$country = current(explode(':', $country_setting));
$state = end(explode(':', $country_setting));
else :
$country = $country_setting;
$state = '*';
endif;
?>
|
|
countries->countries;
asort($countries);
$selections = (array) get_option($value['id']);
?>
|
|