C:\xampp\htdocs\landing\wp-content\plugins\mailchimp-for-wp\includes\forms\functions.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php

/**
 * Returns a Form instance
 *
 * @access public
 *
 * @param int|WP_Post $form_id.
 *
 * @return MC4WP_Form
 */
function mc4wp_get_form$form_id ) {
    return 
MC4WP_Form::get_instance$form_id );
}

/**
 * Get an array of Form instances
 *
 * @access public
 *
 * @param array $args Array of parameters
 *
 * @return MC4WP_Form[]
 */
function mc4wp_get_forms( array $args = array() ) {
    
// parse function arguments
    
$default_args      = array(
        
'post_status'         => 'publish',
        
'posts_per_page'      => -1,
        
'ignore_sticky_posts' => true,
        
'no_found_rows'       => true,
    );
    
$args              array_merge$default_args$args );

    
// set post_type here so it can't be overwritten using function arguments
    
$args['post_type'] = 'mc4wp-form';

    
$q                 = new WP_Query();
    
$posts             $q->query$args );
    
$forms = array();
    foreach ( 
$posts as $post ) {
        try {
            
$form mc4wp_get_form$post );
        } catch ( 
Exception $e ) {
            continue;
        }

        
$forms[] = $form;
    }
    return 
$forms;
}

/**
 * Echoes the given form
 *
 * @access public
 *
 * @param int $form_id
 * @param array $config
 * @param bool $echo
 *
 * @return string
 */
function mc4wp_show_form$form_id 0$config = array(), $echo true ) {
    
/** @var MC4WP_Form_Manager $forms */
    
$forms mc4wp'forms' );
    return 
$forms->output_form$form_id$config$echo );
}

/**
 * Check whether a form was submitted
 *
 * @ignore
 * @since 2.3.8
 * @deprecated 3.0
 * @use mc4wp_get_form
 *
 * @param int $form_id The ID of the form you want to check. (optional)
 * @param string $element_id The ID of the form element you want to check, eg id="mc4wp-form-1" (optional)
 *
 * @return boolean
 */
function mc4wp_form_is_submitted$form_id 0$element_id null ) {
    try {
        
$form mc4wp_get_form$form_id );
    } catch ( 
Exception $e ) {
        return 
false;
    }

    if ( 
$element_id ) {
        
$form_element = new MC4WP_Form_Element$form, array( 'element_id' => $element_id ) );
        return 
$form_element->is_submitted;
    }

    return 
$form->is_submitted;
}

/**
 * @since 2.3.8
 * @deprecated 3.0
 * @ignore
 * @use mc4wp_get_form
 *
 * @param int $form_id (optional)
 *
 * @return string
 */
function mc4wp_form_get_response_html$form_id ) {
    try {
        
$form mc4wp_get_form$form_id );
    } catch ( 
Exception $e ) {
        return 
'';
    }

    return 
$form->get_response_html();
}

/**
 * Gets an instance of the submitted form, if any.
 *
 * @access public
 *
 * @return MC4WP_Form|null
 */
function mc4wp_get_submitted_form() {
    return 
mc4wp'forms' )->get_submitted_form();
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586