optionName, $default ); } function update_slider_settings( $settings = array() ) { $return = false; if( !empty( $settings ) ) { $return = update_option( $this->optionName, $settings ); } return $return; } /** * Register the admin settings * * @author Fabian Wolf * @author Sven Lehnert * @package cc2 * @since 2.0 */ function register_admin_settings() { $strSettingsGroup = $this->classPrefix . 'options'; $strSettingsPage = $strSettingsGroup; //new __debug('cc2 slider: register_admin_settings fires'); register_setting( $strSettingsGroup, $strSettingsGroup ); // Settings fields and sections /*add_settings_section( 'section_general', '', array( $this, 'admin_setting_general' ), // method callback $strSettingsPage );*/ add_settings_section( 'section_general', '', '', $strSettingsPage ); add_settings_field( $this->classPrefix . 'add', 'Create A New Slideshow', array( $this, 'admin_setting_add_slideshow' ), /** method callback */ $strSettingsPage, 'section_general' ); add_settings_field( $this->classPrefix . 'edit', 'Manage Your Slides', array( $this, 'admin_setting_edit_slideshow' ), /** method callback */ $strSettingsPage, 'section_general' ); } /** * Important notice on top of the screen * * @author Sven Lehnert * @package cc2 * @since 2.0 */ function admin_setting_general() { } function admin_setting_add_slideshow() { // fetch required data //new __debug('add slideshow template fires'); // include template require_once( get_template_directory() . '/includes/admin/templates/slideshow-add.php' ); } function admin_setting_edit_slideshow() { // fetch required data $arrBackwardsCompat = get_option('cc_slider_options', array() ); $cc_slider_options = get_option($this->classPrefix . 'options', $arrBackwardsCompat ); // include template require_once( get_template_directory() . '/includes/admin/templates/slideshow-edit.php' ); } /** * Adds a box to the main column on the Post and Page edit screens. */ function add_custom_box() { add_meta_box( 'cc_slider_sectionid', __( 'SlideShow Settings', 'cc2' ), array( $this, 'admin_custom_box' ), 'attachment' ); } /** * Prints the box content. * * @param WP_Post $post The object for the current post/page. */ function admin_custom_box( $post ) { // fetch required data $cc_slider_options = get_option( $this->classPrefix . 'options', array() ); // Add an nonce field so we can check for it later. wp_nonce_field( $this->classPrefix . 'custom_box', $this->classPrefix . 'custom_box_nonce' ); ?>