__construct(); } /** * Load options * * @return none */ function __construct () { $this->options = get_option ( 'Foo' ); } /** * Return a specific option value * * @param string $option name of option to return * @return mixed */ function get_option( $option ) { if ( isset ( $this->options[$option] ) ) return $this->options[$option]; else return false; } } class FooAdmin extends Foo { /** * PHP 4 Style constructor which calls the below PHP5 Style Constructor * * @return none */ function FooAdmin() { $this->__construct(); } /** * Setup WordPress backend * * @return none */ function __construct () { Foo::__construct (); load_plugin_textdomain ( 'foo' , false , 'foo/translations' ); // Whitelist options add_action ( 'admin_init' , array ( &$this , 'register_settings' ) ); // Activate the options page add_action ( 'admin_menu' , array ( &$this , 'add_page' ) ) ; } /** * Whitelist the Foo options * * @return none */ function register_settings () { register_setting( 'Foo_options' , 'Foo' ); } /** * Add the options page * * @return none */ function add_page() { if ( current_user_can ( 'manage_options' ) && function_exists ( 'add_options_page' ) ) { //add_submenu_page( 'themes.php', 'Foo', 'Foo', 10, 'foo_options', array( &$this, 'admin_page' ) ); $options_page = add_options_page ( __( 'Foo' , 'foo' ) , __( 'Foo' , 'foo' ) , 'manage_options' , 'Foo' , array ( &$this , 'admin_page' ) ); } } /** * Output the options page * * @return none */ function admin_page () { ?>

Foo Options

Homepage default category term_id . '" '; if ( $this->options['front'] == $cat->term_id ) echo ' checked="checked" '; echo '/> '; echo $cat->slug . '
'; } ?>
Additional homepage categories term_id . ']" '; echo 'type="checkbox" value="1" '; if ( $this->options['front-additional'][$cat->term_id] == '1' ) echo ' checked="checked" '; echo '/> '; echo $cat->slug . '
'; } ?>