コード例 #1
0
function sb_do_settings_sections($page)
{
    global $wp_settings_sections, $wp_settings_fields;
    if (!isset($wp_settings_sections[$page])) {
        return;
    }
    $count = 0;
    foreach ((array) $wp_settings_sections[$page] as $section) {
        $section_id = $section['id'];
        $class = 'sbtheme-option-section';
        echo '<div id="' . $section_id . '" class="' . $class . '">';
        if ($section['title']) {
            echo "<h3 class=\"setting-title\">{$section['title']}</h3>\n";
        }
        if ($section['callback']) {
            call_user_func($section['callback'], $section);
        }
        $has_field = true;
        if (!isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section_id])) {
            $has_field = false;
        }
        echo '<table class="form-table">';
        if ($has_field && 'sb_options_section' != $section_id) {
            do_settings_fields($page, $section_id);
        } elseif ('sb_options_section' == $section_id) {
            sb_core_get_content('sb-about');
        }
        echo '</table>';
        echo '</div>';
        $count++;
    }
}
コード例 #2
0
 public function print_section_info($args)
 {
     if ($args['id'] == 'sb_plugins_section') {
         sb_core_get_content('sb-plugins');
     } elseif ($args['id'] == 'sb_options_section') {
         _e('Short description about SB Options.', 'sb-core');
     } else {
         _e('Change your settings below:', 'sb-core');
     }
 }
コード例 #3
0
 public static function setting_page_callback()
 {
     sb_core_get_content('sb-setting-page');
 }