acceptance.php
10 years ago
akismet.php
11 years ago
checkbox.php
10 years ago
count.php
11 years ago
date.php
10 years ago
file.php
10 years ago
flamingo.php
10 years ago
jetpack.php
10 years ago
listo.php
12 years ago
number.php
10 years ago
quiz.php
10 years ago
really-simple-captcha.php
10 years ago
recaptcha.php
10 years ago
response.php
11 years ago
select.php
10 years ago
submit.php
10 years ago
text.php
10 years ago
textarea.php
10 years ago
listo.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | ** Retrieve list data from the Listo plugin. |
| 4 | ** Listo http://wordpress.org/plugins/listo/ |
| 5 | **/ |
| 6 | |
| 7 | add_filter( 'wpcf7_form_tag_data_option', 'wpcf7_listo', 10, 3 ); |
| 8 | |
| 9 | function wpcf7_listo( $data, $options, $args ) { |
| 10 | if ( ! function_exists( 'listo' ) ) { |
| 11 | return $data; |
| 12 | } |
| 13 | |
| 14 | $args = wp_parse_args( $args, array() ); |
| 15 | |
| 16 | $contact_form = wpcf7_get_current_contact_form(); |
| 17 | $args['locale'] = $contact_form->locale; |
| 18 | |
| 19 | foreach ( (array) $options as $option ) { |
| 20 | $option = explode( '.', $option ); |
| 21 | $type = $option[0]; |
| 22 | $args['group'] = isset( $option[1] ) ? $option[1] : null; |
| 23 | |
| 24 | if ( $list = listo( $type, $args ) ) { |
| 25 | $data = array_merge( (array) $data, $list ); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | return $data; |
| 30 | } |
| 31 | |
| 32 | ?> |