Description
This is a filter hook for customizing the HTML for the WP-Members captcha. It fires for all of the available captchas, regardless of which captcha is selected.
NOTE: While it can be used to customize the HTML and thus implement a different, unsupported captcha, that process would also involve handling the captcha result in form validation. The simple use of this filter is simply to handle customizing the HTML for the existing, selected captcha type.
Parameters
$html
(string)(required) The HTML for the captcha
Example
/** * The wpmem_captcha filter allows you to filter the HTML * for any of the available captcha methods in the plugin. * It filters the entire HTML string that applies the * captcha. * * NOTE: This filters the pre-submitted form HTML for the * captcha (which is essentially the necessary JavaScript). * It does NOT affect anything on the form validation side * of things, so you cannot use this alone to change the * capctha type. That is a more involved process. You * can, however, use this to customize the HTML of the * existing captcha type you are using (which is what it * is intended for). */ add_filter( 'wpmem_captcha', function( $captcha_html ) { // your custom HTML for the captcha here. return $captcha_html; });
Changelog
- Introduced in version 3.3.5
Source
wpmem_captcha
is located in /includes/class-wp-members-captcha.php