$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 );
}
// Save tax
} elseif ( $current_tab == 'tax' ) {
include_once('settings/settings-tax-rates.php');
woocommerce_tax_rates_setting_save();
} 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 ) . '"';
// Description handling
if ( $value['desc_tip'] === true ) {
$description = '';
$tip = $value['desc'];
} elseif ( ! empty( $value['desc_tip'] ) ) {
$description = $value['desc'];
$tip = $value['desc_tip'];
} elseif ( ! empty( $value['desc'] ) ) {
$description = $value['desc'];
$tip = '';
} else {
$description = $tip = '';
}
if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {
$description = '' . wp_kses_post( $description ) . '
';
} elseif ( $description ) {
$description = '' . wp_kses_post( $description ) . '';
}
if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) {
$tip = '[?]';
} elseif ( $tip ) {
$tip = '';
}
// Switch based on type
switch( $value['type'] ) {
// Section Titles
case 'title':
if ( ! empty( $value['title'] ) ) echo '' . esc_html( $value['title'] ) . '
';
if ( ! empty( $value['desc'] ) ) echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
echo '';
if ( ! empty( $value['id'] ) ) do_action( 'woocommerce_settings_' . sanitize_title( $value['id'] ) . '_after' );
break;
// Standard text inputs and subtypes like 'number'
case 'text':
case 'email':
case 'number':
case 'color' :
$type = $value['type'];
$class = '';
$option_value = woocommerce_settings_get_option( $value['id'], $value['default'] );
if ( $value['type'] == 'color' ) {
$type = 'text';
$value['class'] .= 'colorpick';
$description .= '';
}
?>
|
/>
|
|
|
|
|
|
|
|
|
|
|
$value['id'],
'id' => $value['id'],
'sort_column' => 'menu_order',
'sort_order' => 'ASC',
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => absint( woocommerce_settings_get_option( $value['id'] ) )
);
if( isset( $value['args'] ) )
$args = wp_parse_args( $value['args'], $args );
?>
|
|
countries->countries;
if (strstr($country_setting, ':')) :
$country = current(explode(':', $country_setting));
$state = end(explode(':', $country_setting));
else :
$country = $country_setting;
$state = '*';
endif;
?>
|
|
countries->countries;
asort( $countries );
?>
|
|