key = 'dfrapi_tools'; add_action( 'admin_init', array( &$this, 'register_settings' ) ); add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'admin_notices', array( $this, 'admin_notice' ) ); } function admin_menu() { add_submenu_page( 'dfrapi', __( 'Tools — Datafeedr API', DFRAPI_DOMAIN ), __( 'Tools', DFRAPI_DOMAIN ), 'manage_options', $this->key, array( $this, 'output' ) ); } function admin_notice() { if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] == true && isset( $_GET['page'] ) && $this->key == $_GET['page'] ) { echo '

'; _e( 'Updated!', DFRAPI_DOMAIN ); echo '

'; } } function output() { echo '
'; echo '

' . dfrapi_setting_pages( $this->page ) . ' — Datafeedr API

'; ?> page ); do_settings_sections( $this->page); echo '
'; } function register_settings() { register_setting( $this->page, $this->key, array( $this, 'validate' ) ); // Delete transient data. add_settings_section( 'delete_transient_data', __( 'Delete Cached API Data', DFRAPI_DOMAIN ), array( &$this, 'section_delete_transient_data_desc' ), $this->page ); } function section_delete_transient_data_desc() { ?>