class RegisteredSettingsTest { private $page; private $name = 'test-option'; private $options; function __construct() { add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_menu', array( $this, 'admin_menu' ) ); } function admin_init() { register_setting( 'setting_ref', $this->name, array( $this, 'update_option' ) ); $this->options = get_option( $this->name ); } function admin_menu() { // change the following line to add_dashboard_page() instead of add_options_page() and the default "Settings saved" message will not appear on submit. $this->page = add_options_page( 'Test','Test','manage_options','translatable_demo', array( &$this , 'load' ) ); } function update_option( $data ) { $clean = array_map( 'absint', $data ); unset($data); return $clean; } function load() { ?>
options ) ?>