WC_Install::create_options PHP Метод

create_options() приватный статический Метод

Sets up the default options used on the settings page.
private static create_options ( )
    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');
                    }
                }
            }
        }
    }