PluginProbe
Advanced Forms for ACF / trunk
Advanced Forms for ACF vtrunk
1.9.0 1.9.1 1.9.2.1 1.9.3 1.9.3.1 1.9.3.2 1.9.3.3 1.9.3.4 1.9.3.5 1.9.3.6 1.9.3.7 1.9.3.8 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.3.1 1.0.3.2 1.0.3.3 1.0.4 1.1.0 1.1.1 1.2.0 1.3.0 All 51 releases
advanced-forms / api / api-entries.php

api-entries.php in Advanced Forms for ACF trunk, at api/api-entries.php

53 lines 717 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 /**
5 * Gets all entries for the specified form
6 *
7 * @since 1.0.0
8 *
9 */
10 function af_get_entries( $form_key ) {
11
12 $args = array(
13 'post_type' => 'af_entry',
14 'posts_per_page' => '-1',
15 'meta_query' => array(
16 array(
17 'key' => 'entry_form',
18 'value' => $form_key,
19 ),
20 ),
21 );
22
23 $query = new WP_Query( $args );
24
25 return $query->posts;
26
27 }
28
29
30 /**
31 * Get number of entries by form
32 *
33 * 1.0.2
34 *
35 */
36 function af_get_entry_count( $form_key ) {
37
38 $args = array(
39 'post_type' => 'af_entry',
40 'posts_per_page' => '-1',
41 'meta_query' => array(
42 array(
43 'key' => 'entry_form',
44 'value' => $form_key,
45 ),
46 ),
47 );
48
49 $query = new WP_Query( $args );
50
51 return $query->found_posts;
52
53 }