__construct();} /** * PHP 5 Constructor */ function __construct() { add_action('admin_menu', array(&$this,'add_admin_pages')); add_action('publish_post', array(&$this,'wp_title_intercept'), 10, 2); load_textdomain('sequentitle', dirname(__FILE__) . '/languages/sequentitle-.'. get_locale() .'.mo'); } /** * Retrieves the options from the database. Initialize with the defaults if the * option isn't set * * @return array An array of the options. */ function getOptions() { $defaults = array('title' => 'Post #%%', 'index' => 1); $options = array(); foreach ($defaults as $key=>$value) { $options[$key] = get_option( "sequentitle_$key" ); if ( empty($options[$key]) ) { add_option( "sequentitle_$key", $value); $options[$key] = $value; } } return $options; } /** * Registers the options page. */ function add_admin_pages() { add_submenu_page('options-general.php', 'SequenTitle', 'SequenTitle', 'manage_options', 'sequentitle', array(&$this,'output_sub_admin_page_0')); } /** * Outputs the HTML for the admin sub page. */ function output_sub_admin_page_0() { $options = $this->getOptions(); ?>