$cm_theme ) ); } /** * Settings Page * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API. */ static function admin_load() { wp_enqueue_style( 'sns-options' ); register_setting( SnS_Admin::OPTION_GROUP, 'SnS_options' ); add_settings_section( 'settings', __( 'Scripts n Styles Settings', 'scripts-n-styles' ), array( __CLASS__, 'settings_section' ), SnS_Admin::MENU_SLUG ); add_settings_field( 'metabox', __( 'Hide Metabox by default: ', 'scripts-n-styles' ), array( 'SnS_Form', 'radio' ), SnS_Admin::MENU_SLUG, 'settings', array( 'label_for' => 'metabox', 'setting' => 'SnS_options', 'choices' => array( 'yes', 'no' ), 'layout' => 'horizontal', 'default' => 'yes', 'legend' => __( 'Hide Metabox by default', 'scripts-n-styles' ), 'description' => __( 'This is overridable via Screen Options on each edit screen.', 'scripts-n-styles' ) ) ); add_settings_field( 'menu_position', __( 'Menu Position: ', 'scripts-n-styles' ), array( 'SnS_Form', 'radio' ), SnS_Admin::MENU_SLUG, 'settings', array( 'label_for' => 'menu_position', 'setting' => 'SnS_options', 'choices' => array( 'menu', 'object', 'utility', 'tools.php', 'options-general.php', 'themes.php' ), 'default' => 'tools.php', 'legend' => __( 'Theme', 'scripts-n-styles' ), 'layout' => 'vertical', 'description' => __( 'Some people are fussy about where the menu goes, so I made an option.', 'scripts-n-styles' ), ) ); add_settings_section( 'demo', __( 'Code Mirror Demo', 'scripts-n-styles' ), array( __CLASS__, 'demo_section' ), SnS_Admin::MENU_SLUG ); add_settings_field( 'cm_theme', __( 'Theme: ', 'scripts-n-styles' ), array( 'SnS_Form', 'radio' ), SnS_Admin::MENU_SLUG, 'demo', array( 'label_for' => 'cm_theme', 'setting' => 'SnS_options', 'choices' => Scripts_n_Styles::$cm_themes, 'default' => 'default', 'legend' => __( 'Theme', 'scripts-n-styles' ), 'layout' => 'horizontal', 'description' => '', ) ); add_settings_field( 'hoops_widget', __( 'Hoops Widgets: ', 'scripts-n-styles' ), array( 'SnS_Form', 'radio' ), SnS_Admin::MENU_SLUG, 'settings', array( 'label_for' => 'hoops_widget', 'setting' => 'SnS_options', 'choices' => array( 'yes', 'no' ), 'layout' => 'horizontal', 'default' => 'no', 'legend' => __( 'Shortcode Widgets', 'scripts-n-styles' ), 'description' => __( 'This enables Hoops shortcodes to be used via a "Hoops" Text Widget.', 'scripts-n-styles' ) ) ); add_settings_field( 'delete_data_uninstall', __( 'Delete Data When Uninstalling: ', 'scripts-n-styles' ), array( 'SnS_Form', 'radio' ), SnS_Admin::MENU_SLUG, 'settings', array( 'label_for' => 'delete_data_uninstall', 'setting' => 'SnS_options', 'choices' => array( 'yes', 'no' ), 'layout' => 'horizontal', 'default' => 'no', 'legend' => __( 'Delete Data When Uninstalling', 'scripts-n-styles' ), 'description' => __( 'Should the plugin clean up after itself and delete all of its saved data.', 'scripts-n-styles' ) ) ); } /** * Settings Page * Outputs Description text for the Global Section. */ static function settings_section() { ?>