WC_Admin_Settings::get_settings_pages PHP Method

get_settings_pages() public static method

Include the settings page classes.
public static get_settings_pages ( )
        public static function get_settings_pages()
        {
            if (empty(self::$settings)) {
                $settings = array();
                include_once dirname(__FILE__) . '/settings/class-wc-settings-page.php';
                $settings[] = (include 'settings/class-wc-settings-general.php');
                $settings[] = (include 'settings/class-wc-settings-products.php');
                $settings[] = (include 'settings/class-wc-settings-tax.php');
                $settings[] = (include 'settings/class-wc-settings-shipping.php');
                $settings[] = (include 'settings/class-wc-settings-checkout.php');
                $settings[] = (include 'settings/class-wc-settings-accounts.php');
                $settings[] = (include 'settings/class-wc-settings-emails.php');
                $settings[] = (include 'settings/class-wc-settings-integrations.php');
                $settings[] = (include 'settings/class-wc-settings-api.php');
                self::$settings = apply_filters('woocommerce_get_settings_pages', $settings);
            }
            return self::$settings;
        }

Usage Example

コード例 #1
0
 /**
  * Default options.
  *
  * Sets up the default options used on the settings page.
  */
 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');
                 }
             }
         }
     }
 }
All Usage Examples Of WC_Admin_Settings::get_settings_pages