wpcf7_captcha_ajax_refill
The Contact Form 7 wpcf7 captcha ajax refill function.
Description
wpcf7_captcha_ajax_refill( $items );
Parameters (1)
- 0. $items
- The items.
Usage
if ( !function_exists( 'wpcf7_captcha_ajax_refill' ) ) { require_once ABSPATH . PLUGINDIR . 'contact-form-7/modules/really-simple-captcha.php'; } // The items. $items = null; // NOTICE! Understand what this does before running. $result = wpcf7_captcha_ajax_refill($items);
Defined (1)
The function is defined in the following location(s).
- /modules/really-simple-captcha.php
- function wpcf7_captcha_ajax_refill( $items ) {
- if ( ! is_array( $items ) )
- return $items;
- $fes = wpcf7_scan_form_tags( array( 'type' => 'captchac' ) );
- if ( empty( $fes ) )
- return $items;
- $refill = array();
- foreach ( $fes as $fe ) {
- $name = $fe['name'];
- $options = $fe['options'];
- if ( empty( $name ) )
- continue;
- $op = wpcf7_captchac_options( $options );
- if ( $filename = wpcf7_generate_captcha( $op ) ) {
- $captcha_url = wpcf7_captcha_url( $filename );
- $refill[$name] = $captcha_url;
- }
- }
- if ( ! empty( $refill ) )
- $items['captcha'] = $refill;
- return $items;
- }