WC_Install::create_options() private WC 1.0
Default options.
Sets up the default options used on the settings page.
{} Это метод класса: WC_Install{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$result = WC_Install::create_options();
Код WC_Install::create_options() WC Install::create options WC 5.0.0
private static function create_options() {
// Include settings so that we can run through defaults.
include_once dirname( __FILE__ ) . '/admin/class-wc-admin-settings.php';
$settings = WC_Admin_Settings::get_settings_pages();
foreach ( $settings as $section ) {
if ( ! method_exists( $section, 'get_settings' ) ) {
continue;
}
$subsections = array_unique( array_merge( array( '' ), array_keys( $section->get_sections() ) ) );
foreach ( $subsections as $subsection ) {
foreach ( $section->get_settings( $subsection ) as $value ) {
if ( isset( $value['default'] ) && isset( $value['id'] ) ) {
$autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true;
add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) );
}
}
}
}
// Define other defaults if not in setting screens.
add_option( 'woocommerce_single_image_width', '600', '', 'yes' );
add_option( 'woocommerce_thumbnail_image_width', '300', '', 'yes' );
add_option( 'woocommerce_checkout_highlight_required_fields', 'yes', '', 'yes' );
add_option( 'woocommerce_demo_store', 'no', '', 'no' );
// Define initial tax classes.
WC_Tax::create_tax_class( __( 'Reduced rate', 'woocommerce' ) );
WC_Tax::create_tax_class( __( 'Zero rate', 'woocommerce' ) );
}