'http://twitter.com/', ); var $stuff_boxes = array( ); function init ( ) { self::add_stuff_box( array( 'title' => __( 'Twitter Account URL', 'ICIT_THEME_DOM' ), 'callback' => 'twitter_url' ) ); } function twitter_url( $options = '', $title ){ ?>

defaults; } else { // My options $output[ 'twitter_url' ] = stripcslashes( $options[ 'twitter_url' ] ); return $output; } } /* ++++++++++++++++++++++ Shouldn't need to edit beyond here ++++++++ */ /* Output the that goes in the name or ID field just for the sake of lazy. */ function item_attrib( $value, $name = false) { if ( $name ) echo esc_attr( ICIT_THEME_OPTIONS . "[{$value}]" ); else echo esc_attr( ICIT_THEME_OPTIONS . "_{$value}" ); } function add_options_page( ) { register_setting( ICIT_THEME_OPTIONS, ICIT_THEME_OPTIONS, array( &$this, 'validate_options' ) ); add_theme_page( __( 'Theme Options', 'ICIT_THEME_DOM' ), __( 'Theme Options', 'ICIT_THEME_DOM' ), 'manage_options', 'ICIT_THEME_OPTIONS', array( &$this, 'options_page' ) ); } function icit_theme_options( ) { global $wp_version; //if ( !defined( 'ICIT_THEME_OPTIONS' ) ) // define ( 'ICIT_THEME_OPTIONS', 'icit_theme_options' ); if ( !defined( 'ICIT_THEME_DOM' ) ) define ( 'ICIT_THEME_OPTIONS', 'icit-theme' ); if ( !defined( 'ICIT_THEME_WP_VER' ) ) define ('ICIT_THEME_WP_VER', '3.0' ); if ( version_compare( $wp_version, ICIT_THEME_WP_VER, 'ge' ) ) { foreach( $this->defaults as $key => $value ) { if ( is_string( $value ) ) $this->defaults[ $key ] = sprintf( $value, get_bloginfo( 'template_url' ), TEMPLATEPATH ); } $this->options = wp_parse_args( get_option( ICIT_THEME_OPTIONS ), $this->defaults ); add_action( 'init', array( &$this, 'init' ) ); add_filter( 'icit_retrive_theme_option', array( &$this, 'retrive_theme_option' ) ); add_action( 'admin_menu', array( &$this, 'add_options_page' ) ); } } function retrive_theme_option( $option_name ) { if ( isset( $this->options[ $option_name ] ) ) { return $this->options[ $option_name ]; } else { return false; } } function do_stuff_boxes( ) { foreach( ( array ) $this->stuff_boxes as $box ) { if ( isset( $box[ 'callback' ] ) && is_callable( array( &$this, $box[ 'callback' ] ) ) ) { ?>

options, $box[ 'title' ] ) );?>
'Stuff Box', 'callback' => '' ); $r = wp_parse_args( $args, $defaults ); if ( isset( $r[ 'callback' ] ) ) { $this->stuff_boxes[] = $r; } } function options_page( ){ $disabled = function_exists( 'is_site_admin' ) && !is_site_admin( ) && $this->theme_options_mu[ 'global' ] ? 'disabled="disabled" ' : '';?>