Completed
Branch master (78caa9)
by
unknown
16:37 queued 14:53
created
venues/templates/event_venues_metabox_content_from_manager.template.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@
 block discarded – undo
18 18
                 <?php esc_html_e('Select from Venue Manager List', 'event_espresso'); ?>
19 19
             </label>
20 20
             <?php
21
-            echo wp_kses($venue_selector, AllowedTags::getWithFormTags());
22
-            echo wp_kses($new_venue_link, AllowedTags::getWithFormTags());
23
-            foreach ($venues as $venue) :
24
-                if (! $venue instanceof EE_Venue) {
25
-                    continue;
26
-                }
27
-                $selected     = $evt_venue_id === $venue->ID() ? 'ee-venue-selected' : 'ee-venue-not-selected';
28
-                $edit_url     = EE_Admin_Page::add_query_args_and_nonce(
29
-                    ['action' => 'edit', 'post' => $venue->ID()],
30
-                    EE_VENUES_ADMIN_URL
31
-                );
32
-                $state_name   = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null;
33
-                $country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null;
34
-                ?>
21
+			echo wp_kses($venue_selector, AllowedTags::getWithFormTags());
22
+			echo wp_kses($new_venue_link, AllowedTags::getWithFormTags());
23
+			foreach ($venues as $venue) :
24
+				if (! $venue instanceof EE_Venue) {
25
+					continue;
26
+				}
27
+				$selected     = $evt_venue_id === $venue->ID() ? 'ee-venue-selected' : 'ee-venue-not-selected';
28
+				$edit_url     = EE_Admin_Page::add_query_args_and_nonce(
29
+					['action' => 'edit', 'post' => $venue->ID()],
30
+					EE_VENUES_ADMIN_URL
31
+				);
32
+				$state_name   = is_object($venue->state_obj()) ? $venue->state_obj()->name() : null;
33
+				$country_name = is_object($venue->country_obj()) ? $venue->country_obj()->name() : null;
34
+				?>
35 35
                 <div class='eebox <?php echo sanitize_html_class($selected); ?>' id="eebox_<?php echo absint($venue->ID()); ?>">
36 36
                     <p class='address-view'>
37 37
                         <span><?php esc_html_e('Address:', 'event_espresso'); ?>&nbsp;</span>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             echo wp_kses($venue_selector, AllowedTags::getWithFormTags());
22 22
             echo wp_kses($new_venue_link, AllowedTags::getWithFormTags());
23 23
             foreach ($venues as $venue) :
24
-                if (! $venue instanceof EE_Venue) {
24
+                if ( ! $venue instanceof EE_Venue) {
25 25
                     continue;
26 26
                 }
27 27
                 $selected     = $evt_venue_id === $venue->ID() ? 'ee-venue-selected' : 'ee-venue-not-selected';
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                     <p class='address-view'>
37 37
                         <span><?php esc_html_e('Address:', 'event_espresso'); ?>&nbsp;</span>
38 38
                         <?php echo esc_html($venue->address()); ?>
39
-                        <?php echo ($venue->address2() ? '<br />' . esc_html($venue->address2()) : ''); ?>
39
+                        <?php echo ($venue->address2() ? '<br />'.esc_html($venue->address2()) : ''); ?>
40 40
                         <br />
41 41
                         <span><?php esc_html_e('City:', 'event_espresso'); ?>&nbsp;</span>
42 42
                         <?php echo esc_html($venue->city()); ?>
Please login to merge, or discard this patch.
core/services/request/sanitizers/AllowedTags.php 1 patch
Indentation   +223 added lines, -223 removed lines patch added patch discarded remove patch
@@ -13,227 +13,227 @@
 block discarded – undo
13 13
 class AllowedTags
14 14
 {
15 15
 
16
-    /**
17
-     * @var array[]
18
-     */
19
-    private static $attributes = [
20
-        'accept-charset'    => 1,
21
-        'action'            => 1,
22
-        'alt'               => 1,
23
-        'allow'             => 1,
24
-        'allowfullscreen'   => 1,
25
-        'align'             => 1,
26
-        'aria-*'            => 1,
27
-        'autocomplete'      => 1,
28
-        'checked'           => 1,
29
-        'class'             => 1,
30
-        'cols'              => 1,
31
-        'content'           => 1,
32
-        'data-*'            => 1,
33
-        'dir'               => 1,
34
-        'disabled'          => 1,
35
-        'enctype'           => 1,
36
-        'for'               => 1,
37
-        'frameborder'       => 1,
38
-        'height'            => 1,
39
-        'href'              => 1,
40
-        'id'                => 1,
41
-        'itemprop'          => 1,
42
-        'itemscope'         => 1,
43
-        'itemtype'          => 1,
44
-        'label'             => 1,
45
-        'lang'              => 1,
46
-        'max'               => 1,
47
-        'maxlength'         => 1,
48
-        'method'            => 1,
49
-        'min'               => 1,
50
-        'multiple'          => 1,
51
-        'name'              => 1,
52
-        'novalidate'        => 1,
53
-        'placeholder'       => 1,
54
-        'readonly'          => 1,
55
-        'rel'               => 1,
56
-        'required'          => 1,
57
-        'rows'              => 1,
58
-        'selected'          => 1,
59
-        'src'               => 1,
60
-        'size'              => 1,
61
-        'style'             => 1,
62
-        'step'              => 1,
63
-        'tabindex'          => 1,
64
-        'target'            => 1,
65
-        'title'             => 1,
66
-        'type'              => 1,
67
-        'value'             => 1,
68
-        'width'             => 1,
69
-    ];
70
-
71
-
72
-    /**
73
-     * @var array
74
-     */
75
-    private static $tags = [
76
-        'a',
77
-        'abbr',
78
-        'b',
79
-        'br',
80
-        'code',
81
-        'div',
82
-        'em',
83
-        'h1',
84
-        'h2',
85
-        'h3',
86
-        'h4',
87
-        'h5',
88
-        'h6',
89
-        'hr',
90
-        'i',
91
-        'img',
92
-        'li',
93
-        'ol',
94
-        'p',
95
-        'pre',
96
-        'small',
97
-        'span',
98
-        'strong',
99
-        'table',
100
-        'td',
101
-        'tr',
102
-        'ul',
103
-    ];
104
-
105
-
106
-    /**
107
-     * @var array
108
-     */
109
-    private static $allowed_tags;
110
-
111
-
112
-    /**
113
-     * @var array
114
-     */
115
-    private static $allowed_with_embed_tags;
116
-
117
-
118
-    /**
119
-     * @var array
120
-     */
121
-    private static $allowed_with_form_tags;
122
-
123
-
124
-    /**
125
-     * @var array
126
-     */
127
-    private static $allowed_with_script_and_style_tags;
128
-
129
-
130
-    /**
131
-     * merges additional tags and attributes into the WP post tags
132
-     */
133
-    private static function initializeAllowedTags()
134
-    {
135
-        $allowed_post_tags = wp_kses_allowed_html('post');
136
-        $allowed_tags = [];
137
-        foreach (AllowedTags::$tags as $tag) {
138
-            $allowed_tags[ $tag ] = AllowedTags::$attributes;
139
-        }
140
-        AllowedTags::$allowed_tags = array_merge_recursive($allowed_post_tags, $allowed_tags);
141
-    }
142
-
143
-
144
-    /**
145
-     * merges embed tags and attributes into the EE all tags
146
-     */
147
-    private static function initializeWithEmbedTags()
148
-    {
149
-        $all_tags = AllowedTags::getAllowedTags();
150
-        $embed_tags = [
151
-            'iframe' => AllowedTags::$attributes
152
-        ];
153
-        AllowedTags::$allowed_with_embed_tags = array_merge_recursive($all_tags, $embed_tags);
154
-    }
155
-
156
-
157
-    /**
158
-     * merges form tags and attributes into the EE all tags
159
-     */
160
-    private static function initializeWithFormTags()
161
-    {
162
-        $all_tags = AllowedTags::getAllowedTags();
163
-        $form_tags = [
164
-            'form' => AllowedTags::$attributes,
165
-            'label' => AllowedTags::$attributes,
166
-            'input' => AllowedTags::$attributes,
167
-            'select' => AllowedTags::$attributes,
168
-            'option' => AllowedTags::$attributes,
169
-            'optgroup' => AllowedTags::$attributes,
170
-            'textarea' => AllowedTags::$attributes,
171
-            'button' => AllowedTags::$attributes,
172
-            'fieldset' => AllowedTags::$attributes,
173
-            'output' => AllowedTags::$attributes,
174
-        ];
175
-        AllowedTags::$allowed_with_form_tags = array_merge_recursive($all_tags, $form_tags);
176
-    }
177
-
178
-
179
-    /**
180
-     * merges form script and style tags and attributes into the EE all tags
181
-     */
182
-    private static function initializeWithScriptAndStyleTags()
183
-    {
184
-        $all_tags = AllowedTags::getAllowedTags();
185
-        $script_and_style_tags = [
186
-            'script' => AllowedTags::$attributes,
187
-            'style' => AllowedTags::$attributes,
188
-        ];
189
-        AllowedTags::$allowed_with_script_and_style_tags = array_merge_recursive($all_tags, $script_and_style_tags);
190
-    }
191
-
192
-
193
-    /**
194
-     * @return array[]
195
-     */
196
-    public static function getAllowedTags()
197
-    {
198
-        if (empty(AllowedTags::$allowed_tags)) {
199
-            AllowedTags::initializeAllowedTags();
200
-        }
201
-        return AllowedTags::$allowed_tags;
202
-    }
203
-
204
-
205
-    /**
206
-     * @return array[]
207
-     */
208
-    public static function getWithEmbedTags()
209
-    {
210
-        if (empty(AllowedTags::$allowed_with_embed_tags)) {
211
-            AllowedTags::initializeWithEmbedTags();
212
-        }
213
-        return AllowedTags::$allowed_with_embed_tags;
214
-    }
215
-
216
-
217
-    /**
218
-     * @return array[]
219
-     */
220
-    public static function getWithFormTags()
221
-    {
222
-        if (empty(AllowedTags::$allowed_with_form_tags)) {
223
-            AllowedTags::initializeWithFormTags();
224
-        }
225
-        return AllowedTags::$allowed_with_form_tags;
226
-    }
227
-
228
-
229
-    /**
230
-     * @return array[]
231
-     */
232
-    public static function getWithScriptAndStyleTags()
233
-    {
234
-        if (empty(AllowedTags::$allowed_with_script_and_style_tags)) {
235
-            AllowedTags::initializeWithScriptAndStyleTags();
236
-        }
237
-        return AllowedTags::$allowed_with_script_and_style_tags;
238
-    }
16
+	/**
17
+	 * @var array[]
18
+	 */
19
+	private static $attributes = [
20
+		'accept-charset'    => 1,
21
+		'action'            => 1,
22
+		'alt'               => 1,
23
+		'allow'             => 1,
24
+		'allowfullscreen'   => 1,
25
+		'align'             => 1,
26
+		'aria-*'            => 1,
27
+		'autocomplete'      => 1,
28
+		'checked'           => 1,
29
+		'class'             => 1,
30
+		'cols'              => 1,
31
+		'content'           => 1,
32
+		'data-*'            => 1,
33
+		'dir'               => 1,
34
+		'disabled'          => 1,
35
+		'enctype'           => 1,
36
+		'for'               => 1,
37
+		'frameborder'       => 1,
38
+		'height'            => 1,
39
+		'href'              => 1,
40
+		'id'                => 1,
41
+		'itemprop'          => 1,
42
+		'itemscope'         => 1,
43
+		'itemtype'          => 1,
44
+		'label'             => 1,
45
+		'lang'              => 1,
46
+		'max'               => 1,
47
+		'maxlength'         => 1,
48
+		'method'            => 1,
49
+		'min'               => 1,
50
+		'multiple'          => 1,
51
+		'name'              => 1,
52
+		'novalidate'        => 1,
53
+		'placeholder'       => 1,
54
+		'readonly'          => 1,
55
+		'rel'               => 1,
56
+		'required'          => 1,
57
+		'rows'              => 1,
58
+		'selected'          => 1,
59
+		'src'               => 1,
60
+		'size'              => 1,
61
+		'style'             => 1,
62
+		'step'              => 1,
63
+		'tabindex'          => 1,
64
+		'target'            => 1,
65
+		'title'             => 1,
66
+		'type'              => 1,
67
+		'value'             => 1,
68
+		'width'             => 1,
69
+	];
70
+
71
+
72
+	/**
73
+	 * @var array
74
+	 */
75
+	private static $tags = [
76
+		'a',
77
+		'abbr',
78
+		'b',
79
+		'br',
80
+		'code',
81
+		'div',
82
+		'em',
83
+		'h1',
84
+		'h2',
85
+		'h3',
86
+		'h4',
87
+		'h5',
88
+		'h6',
89
+		'hr',
90
+		'i',
91
+		'img',
92
+		'li',
93
+		'ol',
94
+		'p',
95
+		'pre',
96
+		'small',
97
+		'span',
98
+		'strong',
99
+		'table',
100
+		'td',
101
+		'tr',
102
+		'ul',
103
+	];
104
+
105
+
106
+	/**
107
+	 * @var array
108
+	 */
109
+	private static $allowed_tags;
110
+
111
+
112
+	/**
113
+	 * @var array
114
+	 */
115
+	private static $allowed_with_embed_tags;
116
+
117
+
118
+	/**
119
+	 * @var array
120
+	 */
121
+	private static $allowed_with_form_tags;
122
+
123
+
124
+	/**
125
+	 * @var array
126
+	 */
127
+	private static $allowed_with_script_and_style_tags;
128
+
129
+
130
+	/**
131
+	 * merges additional tags and attributes into the WP post tags
132
+	 */
133
+	private static function initializeAllowedTags()
134
+	{
135
+		$allowed_post_tags = wp_kses_allowed_html('post');
136
+		$allowed_tags = [];
137
+		foreach (AllowedTags::$tags as $tag) {
138
+			$allowed_tags[ $tag ] = AllowedTags::$attributes;
139
+		}
140
+		AllowedTags::$allowed_tags = array_merge_recursive($allowed_post_tags, $allowed_tags);
141
+	}
142
+
143
+
144
+	/**
145
+	 * merges embed tags and attributes into the EE all tags
146
+	 */
147
+	private static function initializeWithEmbedTags()
148
+	{
149
+		$all_tags = AllowedTags::getAllowedTags();
150
+		$embed_tags = [
151
+			'iframe' => AllowedTags::$attributes
152
+		];
153
+		AllowedTags::$allowed_with_embed_tags = array_merge_recursive($all_tags, $embed_tags);
154
+	}
155
+
156
+
157
+	/**
158
+	 * merges form tags and attributes into the EE all tags
159
+	 */
160
+	private static function initializeWithFormTags()
161
+	{
162
+		$all_tags = AllowedTags::getAllowedTags();
163
+		$form_tags = [
164
+			'form' => AllowedTags::$attributes,
165
+			'label' => AllowedTags::$attributes,
166
+			'input' => AllowedTags::$attributes,
167
+			'select' => AllowedTags::$attributes,
168
+			'option' => AllowedTags::$attributes,
169
+			'optgroup' => AllowedTags::$attributes,
170
+			'textarea' => AllowedTags::$attributes,
171
+			'button' => AllowedTags::$attributes,
172
+			'fieldset' => AllowedTags::$attributes,
173
+			'output' => AllowedTags::$attributes,
174
+		];
175
+		AllowedTags::$allowed_with_form_tags = array_merge_recursive($all_tags, $form_tags);
176
+	}
177
+
178
+
179
+	/**
180
+	 * merges form script and style tags and attributes into the EE all tags
181
+	 */
182
+	private static function initializeWithScriptAndStyleTags()
183
+	{
184
+		$all_tags = AllowedTags::getAllowedTags();
185
+		$script_and_style_tags = [
186
+			'script' => AllowedTags::$attributes,
187
+			'style' => AllowedTags::$attributes,
188
+		];
189
+		AllowedTags::$allowed_with_script_and_style_tags = array_merge_recursive($all_tags, $script_and_style_tags);
190
+	}
191
+
192
+
193
+	/**
194
+	 * @return array[]
195
+	 */
196
+	public static function getAllowedTags()
197
+	{
198
+		if (empty(AllowedTags::$allowed_tags)) {
199
+			AllowedTags::initializeAllowedTags();
200
+		}
201
+		return AllowedTags::$allowed_tags;
202
+	}
203
+
204
+
205
+	/**
206
+	 * @return array[]
207
+	 */
208
+	public static function getWithEmbedTags()
209
+	{
210
+		if (empty(AllowedTags::$allowed_with_embed_tags)) {
211
+			AllowedTags::initializeWithEmbedTags();
212
+		}
213
+		return AllowedTags::$allowed_with_embed_tags;
214
+	}
215
+
216
+
217
+	/**
218
+	 * @return array[]
219
+	 */
220
+	public static function getWithFormTags()
221
+	{
222
+		if (empty(AllowedTags::$allowed_with_form_tags)) {
223
+			AllowedTags::initializeWithFormTags();
224
+		}
225
+		return AllowedTags::$allowed_with_form_tags;
226
+	}
227
+
228
+
229
+	/**
230
+	 * @return array[]
231
+	 */
232
+	public static function getWithScriptAndStyleTags()
233
+	{
234
+		if (empty(AllowedTags::$allowed_with_script_and_style_tags)) {
235
+			AllowedTags::initializeWithScriptAndStyleTags();
236
+		}
237
+		return AllowedTags::$allowed_with_script_and_style_tags;
238
+	}
239 239
 }
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -38,103 +38,103 @@
 block discarded – undo
38 38
  * @since           4.0
39 39
  */
40 40
 if (function_exists('espresso_version')) {
41
-    if (! function_exists('espresso_duplicate_plugin_error')) {
42
-        /**
43
-         *    espresso_duplicate_plugin_error
44
-         *    displays if more than one version of EE is activated at the same time
45
-         */
46
-        function espresso_duplicate_plugin_error()
47
-        {
48
-            ?>
41
+	if (! function_exists('espresso_duplicate_plugin_error')) {
42
+		/**
43
+		 *    espresso_duplicate_plugin_error
44
+		 *    displays if more than one version of EE is activated at the same time
45
+		 */
46
+		function espresso_duplicate_plugin_error()
47
+		{
48
+			?>
49 49
             <div class="error">
50 50
                 <p>
51 51
                     <?php
52
-                    echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                    ); ?>
52
+					echo esc_html__(
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+					); ?>
56 56
                 </p>
57 57
             </div>
58 58
             <?php
59
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-        }
61
-    }
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+		}
61
+	}
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.6.2');
65
-    if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.6.2');
65
+	if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                        esc_html__(
79
-                            'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                            'event_espresso'
81
-                        ),
82
-                        EE_MIN_PHP_VER_REQUIRED,
83
-                        PHP_VERSION,
84
-                        '<br/>',
85
-                        '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+						esc_html__(
79
+							'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+							'event_espresso'
81
+						),
82
+						EE_MIN_PHP_VER_REQUIRED,
83
+						PHP_VERSION,
84
+						'<br/>',
85
+						'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
-        /**
98
-         * espresso_version
99
-         * Returns the plugin version
100
-         *
101
-         * @return string
102
-         */
103
-        function espresso_version()
104
-        {
105
-            return apply_filters('FHEE__espresso__espresso_version', '4.10.30.rc.007');
106
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
+		/**
98
+		 * espresso_version
99
+		 * Returns the plugin version
100
+		 *
101
+		 * @return string
102
+		 */
103
+		function espresso_version()
104
+		{
105
+			return apply_filters('FHEE__espresso__espresso_version', '4.10.30.rc.007');
106
+		}
107 107
 
108
-        /**
109
-         * espresso_plugin_activation
110
-         * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
-         */
112
-        function espresso_plugin_activation()
113
-        {
114
-            update_option('ee_espresso_activation', true);
115
-        }
108
+		/**
109
+		 * espresso_plugin_activation
110
+		 * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
+		 */
112
+		function espresso_plugin_activation()
113
+		{
114
+			update_option('ee_espresso_activation', true);
115
+		}
116 116
 
117
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
117
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
118 118
 
119
-        require_once __DIR__ . '/core/bootstrap_espresso.php';
120
-        bootstrap_espresso();
121
-    }
119
+		require_once __DIR__ . '/core/bootstrap_espresso.php';
120
+		bootstrap_espresso();
121
+	}
122 122
 }
123 123
 if (! function_exists('espresso_deactivate_plugin')) {
124
-    /**
125
-     *    deactivate_plugin
126
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
-     *
128
-     * @access public
129
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
-     * @return    void
131
-     */
132
-    function espresso_deactivate_plugin($plugin_basename = '')
133
-    {
134
-        if (! function_exists('deactivate_plugins')) {
135
-            require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
-        }
137
-        unset($_GET['activate'], $_REQUEST['activate']);
138
-        deactivate_plugins($plugin_basename);
139
-    }
124
+	/**
125
+	 *    deactivate_plugin
126
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
+	 *
128
+	 * @access public
129
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
+	 * @return    void
131
+	 */
132
+	function espresso_deactivate_plugin($plugin_basename = '')
133
+	{
134
+		if (! function_exists('deactivate_plugins')) {
135
+			require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+		}
137
+		unset($_GET['activate'], $_REQUEST['activate']);
138
+		deactivate_plugins($plugin_basename);
139
+	}
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.