$name; } trigger_error( 'Attempted to check invalid property: ' . get_class( $this ) . "->$name", E_USER_ERROR ); } /** * Register the module's settings with the settings page. * * This function should be left as-is in subclasses. * * @access public */ public function register() { foreach ( array( 'id', 'title', 'description' ) as $name ) { if ( empty( $this->$name ) ) { trigger_error( get_class( $this ) . " has not set the $name variable.", E_USER_ERROR ); } } do_action( 'itsec-settings-page-register-module', $this ); } /** * Allow the module to enqueue module-specific scripts and styles. * * @access public */ public function enqueue_scripts_and_styles() {} /** * Allow a module to process an AJAX request. * * The module's implementation of this function can either handle all input manually or return a data structure to * be returned by the module API. The module's Javascript can make use of the itsec_module_send_ajax_request() * Javascript function in order to make the AJAX request. It has a request format of: * itsecSettingsPage.sendModuleAJAXRequest( module, data, callback ); * * @access public * * @param array $data Array of data sent by the AJAX request. */ public function handle_ajax_request( $data ) {} /** * Return the settings for the module. * * @access public * * @return array List of settings. */ public function get_settings() { return ITSEC_Modules::get_settings( $this->id ); } /** * Render the module's settings content. * * This function should be left as-is in subclasses. * * @access public * * @param ITSEC_Form $form ITSEC_Form object used to create inputs. */ public function render( $form ) { ?>
Example module description.
add_text( 'setting_1' ); ?> | |
add_text( 'setting_2' ); ?> |