C:\xampp\htdocs\landing\wp-content\updraft\plugins-old\wpforms-lite\src\Providers\Provider\Core.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php

namespace WPForms\Providers\Provider;

/**
 * Class Core stores the basic information about the provider.
 * It's also a Container to load single instances of requires classes.
 *
 * @since 1.4.7
 */
abstract class Core {

    
/**
     * Unique provider slug.
     *
     * @since 1.4.7
     *
     * @var string
     */
    
public $slug;

    
/**
     * Translatable provider name.
     *
     * @since 1.4.7
     *
     * @var string
     */
    
public $name;

    
/**
     * Custom provider icon (logo).
     *
     * @since 1.4.7
     *
     * @var string
     */
    
public $icon;

    
/**
     * Custom priority for a provider, that will affect loading/placement order.
     *
     * @since 1.4.8
     *
     * @var int
     */
    
const PRIORITY 10;

    
/**
     * Get the instance of the class.
     *
     * @since 1.4.7
     *
     * @return Core
     */
    
public static function get_instance() {

        static 
$instance;

        if ( ! 
$instance ) {
            
// Same as new static(), but allows to avoid "abstract class init" error.
            
$core     = \get_called_class();
            
$instance = new $core();
        }

        return 
$instance;
    }

    
/**
     * Core constructor.
     *
     * @since 1.4.7
     *
     * @param array $params Possible keys: slug*, name*, icon. * are required.
     *
     * @throws \UnexpectedValueException Provider class should define provider's "slug"/"name" params.
     */
    
public function __construct( array $params ) {

        
// Define required provider properties.
        
if ( ! empty( $params['slug'] ) ) {
            
$this->slug = \sanitize_key$params['slug'] );
        } else {
            throw new \
UnexpectedValueException'Provider class should define a provider "slug" param in its constructor.' );
        }
        if ( ! empty( 
$params['name'] ) ) {
            
$this->name = \sanitize_text_field$params['name'] );
        } else {
            throw new \
UnexpectedValueException'Provider class should define a provider "name" param in its constructor.' );
        }

        
$this->icon WPFORMS_PLUGIN_URL 'assets/images/sullie.png';
        if ( ! empty( 
$params['icon'] ) ) {
            
$this->icon = \esc_url_raw$params['icon'] );
        }

    }

    
/**
     * Add to list of registered providers.
     *
     * @since 1.4.7
     *
     * @param array $providers Array of all active providers.
     *
     * @return array
     */
    
public function register_provider( array $providers ) {

        
$providers$this->slug ] = $this->name;

        return 
$providers;
    }

    
/**
     * Provide an instance of the object, that should process the submitted entry.
     * It will use data from an already saved entry to pass it further to a Provider.
     *
     * @since 1.4.7
     *
     * @return null|\WPForms\Providers\Provider\Process
     */
    
abstract public function get_process();

    
/**
     * Provide an instance of the object, that should display provider settings
     * on Settings > Integrations page in admin area.
     * If you don't want to display it (i.e. you don't need it), you can pass null here in your Core provider class.
     *
     * @since 1.4.7
     *
     * @return null|\WPForms\Providers\Provider\Settings\PageIntegrations
     */
    
abstract public function get_page_integrations();

    
/**
     * Provide an instance of the object, that should display provider settings in the Form Builder.
     * If you don't want to display it (i.e. you don't need it), you can pass null here in your Core provider class.
     *
     * @since 1.4.7
     *
     * @return null|\WPForms\Providers\Provider\Settings\FormBuilder
     */
    
abstract public function get_form_builder();
}
x

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