Interface for a submodule that supports meta.
Description
Source
File: src/modules/meta-submodule-interface.php
interface Meta_Submodule_Interface { /** * Retrieves the value of a specific submodule form option. * * @since 1.0.0 * * @param int $form_id Form ID. * @param string $option Name of the form option to retrieve. * @param mixed $default Optional. Value to return if the form option doesn't exist. Default false. * @return mixed Value set for the form option. */ public function get_form_option( $form_id, $option, $default = false ); /** * Retrieves the values for all submodule form options. * * @since 1.0.0 * * @param int $form_id Form ID. * @return array Associative array of `$key => $value` pairs for every form option that is set. */ public function get_form_options( $form_id ); /** * Returns the meta identifier for the submodule. * * @since 1.0.0 * * @return string Submodule meta identifier. */ public function get_meta_identifier(); /** * Returns the meta subtab title for the submodule. * * @since 1.0.0 * * @return string Submodule meta title. */ public function get_meta_title(); /** * Returns the meta subtab description for the submodule. * * @since 1.0.0 * * @return string Submodule meta description. */ public function get_meta_description(); /** * Returns the available meta fields for the submodule. * * @since 1.0.0 * * @return array Associative array of `$field_slug => $field_args` pairs. */ public function get_meta_fields(); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Methods
- enabled — Checks whether the protector is enabled for a specific form.
- get_meta_fields — Returns the available meta fields for the submodule.
- render_output — Renders the output for the protector before the Submit button.
- verify_request — Verifies a request by ensuring that it is not spammy.
- wrap_form_name — Wraps a non-prefixed form input name attribute so that it will be properly included the submission POST data.