-
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 4a37fd55de..6854f1ddea 100644
a
|
b
|
|
26 | 26 | <element value="authorAndUri"/> |
27 | 27 | <element value="Name"/> |
28 | 28 | <element value="Version"/> |
29 | | <!-- From the result of wp_xmlrpc_server::wp_getPageList() --> |
| 29 | <!-- From the result of WP_XMLRPC_Server::wp_getPageList() --> |
30 | 30 | <element value="dateCreated"/> |
31 | 31 | |
32 | 32 | <!-- From DOMDocument --> |
… |
… |
|
182 | 182 | <exclude-pattern>/src/wp-content/themes/twentyfourteen/taxonomy-post_format\.php</exclude-pattern> |
183 | 183 | </rule> |
184 | 184 | |
| 185 | <rule ref="WordPress.Files.FileName.InvalidClassFileName"> |
| 186 | <exclude-pattern>/src/wp-admin/includes/class-wp-list-table-compat\.php</exclude-pattern> |
| 187 | <exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern> |
| 188 | </rule> |
| 189 | <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital"> |
| 190 | <exclude-pattern>/src/wp-admin/includes/class-wp-list-table-compat\.php</exclude-pattern> |
| 191 | <exclude-pattern>/src/wp-includes/class-wp-dependency\.php</exclude-pattern> |
| 192 | <exclude-pattern>/src/wp-includes/class-wp-editor\.php</exclude-pattern> |
| 193 | </rule> |
| 194 | |
185 | 195 | <!-- Whitelist test classes for select sniffs. --> |
186 | 196 | <rule ref="WordPress.Files.FileName"> |
187 | 197 | <properties> |
-
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 4b91154c09..12127ca9ad 100644
a
|
b
|
function wp_ajax_parse_embed() { |
3423 | 3423 | wp_send_json_error(); |
3424 | 3424 | } |
3425 | 3425 | setup_postdata( $post ); |
3426 | | } elseif ( ! current_user_can( 'edit_posts' ) ) { // See WP_oEmbed_Controller::get_proxy_item_permissions_check(). |
| 3426 | } elseif ( ! current_user_can( 'edit_posts' ) ) { // See WP_OEmbed_Controller::get_proxy_item_permissions_check(). |
3427 | 3427 | wp_send_json_error(); |
3428 | 3428 | } |
3429 | 3429 | |
-
diff --git a/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
index 0482663a65..275bab071e 100644
a
|
b
|
|
13 | 13 | * |
14 | 14 | * @see WP_Filesystem_Base |
15 | 15 | */ |
16 | | class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { |
| 16 | class WP_Filesystem_FTPsockets extends WP_Filesystem_Base { |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @since 2.5.0 |
-
diff --git a/src/wp-includes/class-oembed.php b/src/wp-includes/class-oembed.php
index dd3e5687f0..3a8cb230dc 100644
a
|
b
|
|
16 | 16 | * |
17 | 17 | * @since 2.9.0 |
18 | 18 | */ |
19 | | class WP_oEmbed { |
| 19 | class WP_OEmbed { |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * A list of oEmbed providers. |
… |
… |
class WP_oEmbed { |
245 | 245 | * |
246 | 246 | * @since 4.0.0 |
247 | 247 | * |
248 | | * @see WP_oEmbed::discover() |
| 248 | * @see WP_OEmbed::discover() |
249 | 249 | * |
250 | 250 | * @param string $url The URL to the content. |
251 | 251 | * @param string|array $args Optional provider arguments. |
… |
… |
class WP_oEmbed { |
334 | 334 | /** |
335 | 335 | * Takes a URL and attempts to return the oEmbed data. |
336 | 336 | * |
337 | | * @see WP_oEmbed::fetch() |
| 337 | * @see WP_OEmbed::fetch() |
338 | 338 | * |
339 | 339 | * @since 4.8.0 |
340 | 340 | * |
… |
… |
class WP_oEmbed { |
363 | 363 | /** |
364 | 364 | * The do-it-all function that takes a URL and attempts to return the HTML. |
365 | 365 | * |
366 | | * @see WP_oEmbed::fetch() |
367 | | * @see WP_oEmbed::data2html() |
| 366 | * @see WP_OEmbed::fetch() |
| 367 | * @see WP_OEmbed::data2html() |
368 | 368 | * |
369 | 369 | * @since 2.9.0 |
370 | 370 | * |
… |
… |
class WP_oEmbed { |
649 | 649 | } |
650 | 650 | |
651 | 651 | /** |
652 | | * Converts a data object from WP_oEmbed::fetch() and returns the HTML. |
| 652 | * Converts a data object from WP_OEmbed::fetch() and returns the HTML. |
653 | 653 | * |
654 | 654 | * @since 2.9.0 |
655 | 655 | * |
… |
… |
class WP_oEmbed { |
715 | 715 | * @since 3.0.0 |
716 | 716 | * |
717 | 717 | * @param string $html Existing HTML. |
718 | | * @param object $data Data object from WP_oEmbed::data2html() |
| 718 | * @param object $data Data object from WP_OEmbed::data2html() |
719 | 719 | * @param string $url The original URL passed to oEmbed. |
720 | 720 | * @return string Possibly modified $html |
721 | 721 | */ |
-
diff --git a/src/wp-includes/class-wp-embed.php b/src/wp-includes/class-wp-embed.php
index c8aec5a006..1609716d1d 100644
a
|
b
|
class WP_Embed { |
130 | 130 | * |
131 | 131 | * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of |
132 | 132 | * the registered embed handlers. If none of the regex matches and it's enabled, then the URL |
133 | | * will be given to the WP_oEmbed class. |
| 133 | * will be given to the WP_OEmbed class. |
134 | 134 | * |
135 | 135 | * @param array $attr { |
136 | 136 | * Shortcode attributes. Optional. |
… |
… |
class WP_Embed { |
263 | 263 | * @since 2.9.0 |
264 | 264 | * @since 4.4.0 The default value changed to true. |
265 | 265 | * |
266 | | * @see WP_oEmbed::discover() |
| 266 | * @see WP_OEmbed::discover() |
267 | 267 | * |
268 | 268 | * @param bool $enable Whether to enable `<link>` tag discovery. Default true. |
269 | 269 | */ |
-
diff --git a/src/wp-includes/class-wp-oembed-controller.php b/src/wp-includes/class-wp-oembed-controller.php
index 2b08516894..7a6a32d27c 100644
a
|
b
|
|
1 | 1 | <?php |
2 | 2 | /** |
3 | | * WP_oEmbed_Controller class, used to provide an oEmbed endpoint. |
| 3 | * WP_OEmbed_Controller class, used to provide an oEmbed endpoint. |
4 | 4 | * |
5 | 5 | * @package WordPress |
6 | 6 | * @subpackage Embeds |
… |
… |
|
15 | 15 | * |
16 | 16 | * @since 4.4.0 |
17 | 17 | */ |
18 | | final class WP_oEmbed_Controller { |
| 18 | final class WP_OEmbed_Controller { |
19 | 19 | /** |
20 | 20 | * Register the oEmbed REST API route. |
21 | 21 | * |
… |
… |
final class WP_oEmbed_Controller { |
155 | 155 | * |
156 | 156 | * @since 4.8.0 |
157 | 157 | * |
158 | | * @see WP_oEmbed::get_html() |
| 158 | * @see WP_OEmbed::get_html() |
159 | 159 | * @param WP_REST_Request $request Full data about the request. |
160 | 160 | * @return object|WP_Error oEmbed response data or WP_Error on failure. |
161 | 161 | */ |
… |
… |
final class WP_oEmbed_Controller { |
173 | 173 | $url = $request['url']; |
174 | 174 | unset( $args['url'] ); |
175 | 175 | |
176 | | // Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names. |
| 176 | // Copy maxwidth/maxheight to width/height since WP_OEmbed::fetch() uses these arg names. |
177 | 177 | if ( isset( $args['maxwidth'] ) ) { |
178 | 178 | $args['width'] = $args['maxwidth']; |
179 | 179 | } |
-
diff --git a/src/wp-includes/class-wp-text-diff-renderer-inline.php b/src/wp-includes/class-wp-text-diff-renderer-inline.php
index 62a33033e3..ff70501990 100644
a
|
b
|
|
1 | 1 | <?php |
2 | 2 | /** |
3 | | * Diff API: WP_Text_Diff_Renderer_inline class |
| 3 | * Diff API: WP_Text_Diff_Renderer_Inline class |
4 | 4 | * |
5 | 5 | * @package WordPress |
6 | 6 | * @subpackage Diff |
… |
… |
|
13 | 13 | * @since 2.6.0 |
14 | 14 | * @uses Text_Diff_Renderer_inline Extends |
15 | 15 | */ |
16 | | class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline { |
| 16 | class WP_Text_Diff_Renderer_Inline extends Text_Diff_Renderer_inline { |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @ignore |
-
diff --git a/src/wp-includes/class-wp-text-diff-renderer-table.php b/src/wp-includes/class-wp-text-diff-renderer-table.php
index e4e06a43b4..17d736ee75 100644
a
|
b
|
class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { |
43 | 43 | * @var string |
44 | 44 | * @since 2.6.0 |
45 | 45 | */ |
46 | | protected $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline'; |
| 46 | protected $inline_diff_renderer = 'WP_Text_Diff_Renderer_Inline'; |
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Should we show the split view or not |
-
diff --git a/src/wp-includes/class-wp-xmlrpc-server.php b/src/wp-includes/class-wp-xmlrpc-server.php
index 72aeef2048..b3a957741c 100644
a
|
b
|
|
14 | 14 | * options, etc. |
15 | 15 | * |
16 | 16 | * As of WordPress 3.5.0, XML-RPC is enabled by default. It can be disabled |
17 | | * via the {@see 'xmlrpc_enabled'} filter found in wp_xmlrpc_server::login(). |
| 17 | * via the {@see 'xmlrpc_enabled'} filter found in WP_XMLRPC_Server::login(). |
18 | 18 | * |
19 | 19 | * @since 1.5.0 |
20 | 20 | * |
21 | 21 | * @see IXR_Server |
22 | 22 | */ |
23 | | class wp_xmlrpc_server extends IXR_Server { |
| 23 | class WP_XMLRPC_Server extends IXR_Server { |
24 | 24 | /** |
25 | 25 | * Methods. |
26 | 26 | * |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
43 | 43 | public $error; |
44 | 44 | |
45 | 45 | /** |
46 | | * Flags that the user authentication has failed in this instance of wp_xmlrpc_server. |
| 46 | * Flags that the user authentication has failed in this instance of WP_XMLRPC_Server. |
47 | 47 | * |
48 | 48 | * @var bool |
49 | 49 | */ |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
278 | 278 | if ( is_wp_error( $user ) ) { |
279 | 279 | $this->error = new IXR_Error( 403, __( 'Incorrect username or password.' ) ); |
280 | 280 | |
281 | | // Flag that authentication has failed once on this wp_xmlrpc_server instance |
| 281 | // Flag that authentication has failed once on this WP_XMLRPC_Server instance |
282 | 282 | $this->auth_failed = true; |
283 | 283 | |
284 | 284 | /** |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
301 | 301 | * Check user's credentials. Deprecated. |
302 | 302 | * |
303 | 303 | * @since 1.5.0 |
304 | | * @deprecated 2.8.0 Use wp_xmlrpc_server::login() |
305 | | * @see wp_xmlrpc_server::login() |
| 304 | * @deprecated 2.8.0 Use WP_XMLRPC_Server::login() |
| 305 | * @see WP_XMLRPC_Server::login() |
306 | 306 | * |
307 | 307 | * @param string $username User's username. |
308 | 308 | * @param string $password User's password. |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
2985 | 2985 | * |
2986 | 2986 | * @since 2.2.0 |
2987 | 2987 | * |
2988 | | * @see wp_xmlrpc_server::mw_newPost() |
| 2988 | * @see WP_XMLRPC_Server::mw_newPost() |
2989 | 2989 | * |
2990 | 2990 | * @param array $args { |
2991 | 2991 | * Method arguments. Note: arguments must be ordered as documented. |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
3554 | 3554 | * @type string $password |
3555 | 3555 | * @type array $struct |
3556 | 3556 | * } |
3557 | | * @return array|IXR_Error Contains a collection of comments. See wp_xmlrpc_server::wp_getComment() for a description of each item contents |
| 3557 | * @return array|IXR_Error Contains a collection of comments. See WP_XMLRPC_Server::wp_getComment() for a description of each item contents |
3558 | 3558 | */ |
3559 | 3559 | public function wp_getComments( $args ) { |
3560 | 3560 | $this->escape( $args ); |
… |
… |
class wp_xmlrpc_server extends IXR_Server { |
4307 | 4307 | * @type string $password |
4308 | 4308 | * @type array $struct |
4309 | 4309 | * } |
4310 | | * @return array|IXR_Error Contains a collection of media items. See wp_xmlrpc_server::wp_getMediaItem() for a description of each item contents |
| 4310 | * @return array|IXR_Error Contains a collection of media items. See WP_XMLRPC_Server::wp_getMediaItem() for a description of each item contents |
4311 | 4311 | */ |
4312 | 4312 | public function wp_getMediaLibrary( $args ) { |
4313 | 4313 | $this->escape( $args ); |
-
diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
index 677a9b5d44..6e2f1f77ab 100644
a
|
b
|
function default_topic_count_text( $count ) { |
3410 | 3410 | /** |
3411 | 3411 | * Formerly used to escape strings before inserting into the DB. |
3412 | 3412 | * |
3413 | | * Has not performed this function for many, many years. Use wpdb::prepare() instead. |
| 3413 | * Has not performed this function for many, many years. Use WPDB::prepare() instead. |
3414 | 3414 | * |
3415 | 3415 | * @since 0.71 |
3416 | 3416 | * @deprecated 3.9.0 |
… |
… |
function format_to_post( $content ) { |
3427 | 3427 | * Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described. |
3428 | 3428 | * |
3429 | 3429 | * @since 2.5.0 |
3430 | | * @deprecated 4.0.0 Use wpdb::esc_like() |
3431 | | * @see wpdb::esc_like() |
| 3430 | * @deprecated 4.0.0 Use WPDB::esc_like() |
| 3431 | * @see WPDB::esc_like() |
3432 | 3432 | * |
3433 | 3433 | * @param string $text The text to be escaped. |
3434 | 3434 | * @return string text, safe for inclusion in LIKE query. |
3435 | 3435 | */ |
3436 | 3436 | function like_escape($text) { |
3437 | | _deprecated_function( __FUNCTION__, '4.0.0', 'wpdb::esc_like()' ); |
| 3437 | _deprecated_function( __FUNCTION__, '4.0.0', 'WPDB::esc_like()' ); |
3438 | 3438 | return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text ); |
3439 | 3439 | } |
3440 | 3440 | |
-
diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
index 76d937cd6c..222f779176 100644
a
|
b
|
function wp_embed_defaults( $url = '' ) { |
88 | 88 | * |
89 | 89 | * @since 2.9.0 |
90 | 90 | * |
91 | | * @see WP_oEmbed |
| 91 | * @see WP_OEmbed |
92 | 92 | * |
93 | 93 | * @param string $url The URL that should be embedded. |
94 | 94 | * @param array $args Optional. Additional arguments and parameters for retrieving embed HTML. |
… |
… |
function wp_oembed_get( $url, $args = '' ) { |
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | | * Returns the initialized WP_oEmbed object. |
| 104 | * Returns the initialized WP_OEmbed object. |
105 | 105 | * |
106 | 106 | * @since 2.9.0 |
107 | 107 | * @access private |
108 | 108 | * |
109 | | * @staticvar WP_oEmbed $wp_oembed |
| 109 | * @staticvar WP_OEmbed $wp_oembed |
110 | 110 | * |
111 | | * @return WP_oEmbed object. |
| 111 | * @return WP_OEmbed object. |
112 | 112 | */ |
113 | 113 | function _wp_oembed_get_object() { |
114 | 114 | static $wp_oembed = null; |
115 | 115 | |
116 | 116 | if ( is_null( $wp_oembed ) ) { |
117 | | $wp_oembed = new WP_oEmbed(); |
| 117 | $wp_oembed = new WP_OEmbed(); |
118 | 118 | } |
119 | 119 | return $wp_oembed; |
120 | 120 | } |
… |
… |
function _wp_oembed_get_object() { |
124 | 124 | * |
125 | 125 | * @since 2.9.0 |
126 | 126 | * |
127 | | * @see WP_oEmbed |
| 127 | * @see WP_OEmbed |
128 | 128 | * |
129 | 129 | * @param string $format The format of URL that this provider can handle. You can use asterisks |
130 | 130 | * as wildcards. |
… |
… |
function wp_oembed_add_provider( $format, $provider, $regex = false ) { |
136 | 136 | $oembed = _wp_oembed_get_object(); |
137 | 137 | $oembed->providers[ $format ] = array( $provider, $regex ); |
138 | 138 | } else { |
139 | | WP_oEmbed::_add_provider_early( $format, $provider, $regex ); |
| 139 | WP_OEmbed::_add_provider_early( $format, $provider, $regex ); |
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
… |
… |
function wp_oembed_add_provider( $format, $provider, $regex = false ) { |
145 | 145 | * |
146 | 146 | * @since 3.5.0 |
147 | 147 | * |
148 | | * @see WP_oEmbed |
| 148 | * @see WP_OEmbed |
149 | 149 | * |
150 | 150 | * @param string $format The URL format for the oEmbed provider to remove. |
151 | 151 | * @return bool Was the provider removed successfully? |
… |
… |
function wp_oembed_remove_provider( $format ) { |
159 | 159 | return true; |
160 | 160 | } |
161 | 161 | } else { |
162 | | WP_oEmbed::_remove_provider_early( $format ); |
| 162 | WP_OEmbed::_remove_provider_early( $format ); |
163 | 163 | } |
164 | 164 | |
165 | 165 | return false; |
… |
… |
function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) { |
310 | 310 | * @since 4.4.0 |
311 | 311 | */ |
312 | 312 | function wp_oembed_register_route() { |
313 | | $controller = new WP_oEmbed_Controller(); |
| 313 | $controller = new WP_OEmbed_Controller(); |
314 | 314 | $controller->register_routes(); |
315 | 315 | } |
316 | 316 | |
-
diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index ea7b80d6c2..8145fd9e12 100644
a
|
b
|
function _deep_replace( $search, $subject ) { |
4161 | 4161 | /** |
4162 | 4162 | * Escapes data for use in a MySQL query. |
4163 | 4163 | * |
4164 | | * Usually you should prepare queries using wpdb::prepare(). |
| 4164 | * Usually you should prepare queries using WPDB::prepare(). |
4165 | 4165 | * Sometimes, spot-escaping is required or useful. One example |
4166 | 4166 | * is preparing an array for use in an IN clause. |
4167 | 4167 | * |
-
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index a66b3fa406..c3b0862a60 100644
a
|
b
|
function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) { |
3393 | 3393 | * @since 3.2.0 |
3394 | 3394 | * @access private |
3395 | 3395 | * |
3396 | | * @global wp_xmlrpc_server $wp_xmlrpc_server |
| 3396 | * @global WP_XMLRPC_Server $WP_XMLRPC_Server |
3397 | 3397 | * |
3398 | 3398 | * @param string $message Error message. |
3399 | 3399 | * @param string $title Optional. Error title. Default empty. |
3400 | 3400 | * @param string|array $args Optional. Arguments to control behavior. Default empty array. |
3401 | 3401 | */ |
3402 | 3402 | function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { |
3403 | | global $wp_xmlrpc_server; |
| 3403 | global $WP_XMLRPC_Server; |
3404 | 3404 | |
3405 | 3405 | list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args ); |
3406 | 3406 | |
… |
… |
function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { |
3408 | 3408 | nocache_headers(); |
3409 | 3409 | } |
3410 | 3410 | |
3411 | | if ( $wp_xmlrpc_server ) { |
| 3411 | if ( $WP_XMLRPC_Server ) { |
3412 | 3412 | $error = new IXR_Error( $r['response'], $message ); |
3413 | | $wp_xmlrpc_server->output( $error->getXml() ); |
| 3413 | $WP_XMLRPC_Server->output( $error->getXml() ); |
3414 | 3414 | } |
3415 | 3415 | if ( $r['exit'] ) { |
3416 | 3416 | die(); |
-
diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index 7e5314c0d2..aa7b9c0daf 100644
a
|
b
|
function require_wp_db() { |
425 | 425 | $dbname = defined( 'DB_NAME' ) ? DB_NAME : ''; |
426 | 426 | $dbhost = defined( 'DB_HOST' ) ? DB_HOST : ''; |
427 | 427 | |
428 | | $wpdb = new wpdb( $dbuser, $dbpassword, $dbname, $dbhost ); |
| 428 | $wpdb = new WPDB( $dbuser, $dbpassword, $dbname, $dbhost ); |
429 | 429 | } |
430 | 430 | |
431 | 431 | /** |
-
diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php
index 3c41943e55..2b0eb5ecd7 100644
a
|
b
|
define( 'ARRAY_N', 'ARRAY_N' ); |
48 | 48 | * |
49 | 49 | * @since 0.71 |
50 | 50 | */ |
51 | | class wpdb { |
| 51 | class WPDB { |
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Whether to show SQL/DB errors. |
… |
… |
class wpdb { |
161 | 161 | * Flag to ensure we don't run into recursion problems when checking the collation. |
162 | 162 | * |
163 | 163 | * @since 4.2.0 |
164 | | * @see wpdb::check_safe_collation() |
| 164 | * @see WPDB::check_safe_collation() |
165 | 165 | * @var bool |
166 | 166 | */ |
167 | 167 | private $checking_collation = false; |
… |
… |
class wpdb { |
200 | 200 | * The number of times to retry reconnecting before dying. |
201 | 201 | * |
202 | 202 | * @since 3.9.0 |
203 | | * @see wpdb::check_connection() |
| 203 | * @see WPDB::check_connection() |
204 | 204 | * @var int |
205 | 205 | */ |
206 | 206 | protected $reconnect_retries = 5; |
… |
… |
class wpdb { |
253 | 253 | * List of WordPress per-blog tables |
254 | 254 | * |
255 | 255 | * @since 2.5.0 |
256 | | * @see wpdb::tables() |
| 256 | * @see WPDB::tables() |
257 | 257 | * @var array |
258 | 258 | */ |
259 | 259 | var $tables = array( |
… |
… |
class wpdb { |
275 | 275 | * categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539 |
276 | 276 | * |
277 | 277 | * @since 2.9.0 |
278 | | * @see wpdb::tables() |
| 278 | * @see WPDB::tables() |
279 | 279 | * @var array |
280 | 280 | */ |
281 | 281 | var $old_tables = array( 'categories', 'post2cat', 'link2cat' ); |
… |
… |
class wpdb { |
284 | 284 | * List of WordPress global tables |
285 | 285 | * |
286 | 286 | * @since 3.0.0 |
287 | | * @see wpdb::tables() |
| 287 | * @see WPDB::tables() |
288 | 288 | * @var array |
289 | 289 | */ |
290 | 290 | var $global_tables = array( 'users', 'usermeta' ); |
… |
… |
class wpdb { |
293 | 293 | * List of Multisite global tables |
294 | 294 | * |
295 | 295 | * @since 3.0.0 |
296 | | * @see wpdb::tables() |
| 296 | * @see WPDB::tables() |
297 | 297 | * @var array |
298 | 298 | */ |
299 | 299 | var $ms_global_tables = array( |
… |
… |
class wpdb { |
477 | 477 | * Keys are column names, values are format types: 'ID' => '%d' |
478 | 478 | * |
479 | 479 | * @since 2.8.0 |
480 | | * @see wpdb::prepare() |
481 | | * @see wpdb::insert() |
482 | | * @see wpdb::update() |
483 | | * @see wpdb::delete() |
| 480 | * @see WPDB::prepare() |
| 481 | * @see WPDB::insert() |
| 482 | * @see WPDB::update() |
| 483 | * @see WPDB::delete() |
484 | 484 | * @see wp_set_wpdb_vars() |
485 | 485 | * @var array |
486 | 486 | */ |
… |
… |
class wpdb { |
642 | 642 | /** |
643 | 643 | * PHP5 style destructor and will run when database object is destroyed. |
644 | 644 | * |
645 | | * @see wpdb::__construct() |
| 645 | * @see WPDB::__construct() |
646 | 646 | * @since 2.0.8 |
647 | 647 | * @return true |
648 | 648 | */ |
… |
… |
class wpdb { |
899 | 899 | * @since 2.5.0 |
900 | 900 | * |
901 | 901 | * @param string $prefix Alphanumeric name for the new prefix. |
902 | | * @param bool $set_table_names Optional. Whether the table names, e.g. wpdb::$posts, should be updated or not. |
| 902 | * @param bool $set_table_names Optional. Whether the table names, e.g. WPDB::$posts, should be updated or not. |
903 | 903 | * @return string|WP_Error Old prefix or WP_Error on error |
904 | 904 | */ |
905 | 905 | public function set_prefix( $prefix, $set_table_names = true ) { |
… |
… |
class wpdb { |
1007 | 1007 | * 'old' - returns tables which are deprecated. |
1008 | 1008 | * |
1009 | 1009 | * @since 3.0.0 |
1010 | | * @uses wpdb::$tables |
1011 | | * @uses wpdb::$old_tables |
1012 | | * @uses wpdb::$global_tables |
1013 | | * @uses wpdb::$ms_global_tables |
| 1010 | * @uses WPDB::$tables |
| 1011 | * @uses WPDB::$old_tables |
| 1012 | * @uses WPDB::$global_tables |
| 1013 | * @uses WPDB::$ms_global_tables |
1014 | 1014 | * |
1015 | 1015 | * @param string $scope Optional. Can be all, global, ms_global, blog, or old tables. Defaults to all. |
1016 | 1016 | * @param bool $prefix Optional. Whether to include table prefixes. Default true. If blog |
1017 | 1017 | * prefix is requested, then the custom users and usermeta tables will be mapped. |
1018 | | * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::$blogid. Used only when prefix is requested. |
| 1018 | * @param int $blog_id Optional. The blog_id to prefix. Defaults to WPDB::$blogid. Used only when prefix is requested. |
1019 | 1019 | * @return array Table names. When a prefix is requested, the key is the unprefixed table name. |
1020 | 1020 | */ |
1021 | 1021 | public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) { |
… |
… |
class wpdb { |
1139 | 1139 | /** |
1140 | 1140 | * Do not use, deprecated. |
1141 | 1141 | * |
1142 | | * Use esc_sql() or wpdb::prepare() instead. |
| 1142 | * Use esc_sql() or WPDB::prepare() instead. |
1143 | 1143 | * |
1144 | 1144 | * @since 2.8.0 |
1145 | | * @deprecated 3.6.0 Use wpdb::prepare() |
1146 | | * @see wpdb::prepare |
| 1145 | * @deprecated 3.6.0 Use WPDB::prepare() |
| 1146 | * @see WPDB::prepare |
1147 | 1147 | * @see esc_sql() |
1148 | 1148 | * |
1149 | 1149 | * @param string $string |
… |
… |
class wpdb { |
1151 | 1151 | */ |
1152 | 1152 | function _weak_escape( $string ) { |
1153 | 1153 | if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { |
1154 | | _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); |
| 1154 | _deprecated_function( __METHOD__, '3.6.0', 'WPDB::prepare() or esc_sql()' ); |
1155 | 1155 | } |
1156 | 1156 | return addslashes( $string ); |
1157 | 1157 | } |
… |
… |
class wpdb { |
1190 | 1190 | /** |
1191 | 1191 | * Escape data. Works on arrays. |
1192 | 1192 | * |
1193 | | * @uses wpdb::_real_escape() |
| 1193 | * @uses WPDB::_real_escape() |
1194 | 1194 | * @since 2.8.0 |
1195 | 1195 | * |
1196 | 1196 | * @param string|array $data |
… |
… |
class wpdb { |
1215 | 1215 | /** |
1216 | 1216 | * Do not use, deprecated. |
1217 | 1217 | * |
1218 | | * Use esc_sql() or wpdb::prepare() instead. |
| 1218 | * Use esc_sql() or WPDB::prepare() instead. |
1219 | 1219 | * |
1220 | 1220 | * @since 0.71 |
1221 | | * @deprecated 3.6.0 Use wpdb::prepare() |
1222 | | * @see wpdb::prepare() |
| 1221 | * @deprecated 3.6.0 Use WPDB::prepare() |
| 1222 | * @see WPDB::prepare() |
1223 | 1223 | * @see esc_sql() |
1224 | 1224 | * |
1225 | 1225 | * @param mixed $data |
… |
… |
class wpdb { |
1227 | 1227 | */ |
1228 | 1228 | public function escape( $data ) { |
1229 | 1229 | if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { |
1230 | | _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); |
| 1230 | _deprecated_function( __METHOD__, '3.6.0', 'WPDB::prepare() or esc_sql()' ); |
1231 | 1231 | } |
1232 | 1232 | if ( is_array( $data ) ) { |
1233 | 1233 | foreach ( $data as $k => $v ) { |
… |
… |
class wpdb { |
1247 | 1247 | /** |
1248 | 1248 | * Escapes content by reference for insertion into the database, for security |
1249 | 1249 | * |
1250 | | * @uses wpdb::_real_escape() |
| 1250 | * @uses WPDB::_real_escape() |
1251 | 1251 | * |
1252 | 1252 | * @since 2.3.0 |
1253 | 1253 | * |
… |
… |
class wpdb { |
1274 | 1274 | * |
1275 | 1275 | * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example, |
1276 | 1276 | * to use in LIKE syntax) must be passed via a substitution argument containing the complete LIKE string, these |
1277 | | * cannot be inserted directly in the query string. Also see wpdb::esc_like(). |
| 1277 | * cannot be inserted directly in the query string. Also see WPDB::esc_like(). |
1278 | 1278 | * |
1279 | 1279 | * Arguments may be passed as individual arguments to the method, or as a single array containing all arguments. A combination |
1280 | 1280 | * of the two is not supported. |
… |
… |
class wpdb { |
1300 | 1300 | // This is not meant to be foolproof -- but it will catch obviously incorrect usage. |
1301 | 1301 | if ( strpos( $query, '%' ) === false ) { |
1302 | 1302 | wp_load_translations_early(); |
1303 | | _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' ); |
| 1303 | _doing_it_wrong( 'WPDB::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'WPDB::prepare()' ), '3.9.0' ); |
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | $args = func_get_args(); |
… |
… |
class wpdb { |
1316 | 1316 | foreach ( $args as $arg ) { |
1317 | 1317 | if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) { |
1318 | 1318 | wp_load_translations_early(); |
1319 | | _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' ); |
| 1319 | _doing_it_wrong( 'WPDB::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' ); |
1320 | 1320 | } |
1321 | 1321 | } |
1322 | 1322 | |
… |
… |
class wpdb { |
1353 | 1353 | if ( 1 === $placeholders && $passed_as_array ) { |
1354 | 1354 | // If the passed query only expected one argument, but the wrong number of arguments were sent as an array, bail. |
1355 | 1355 | wp_load_translations_early(); |
1356 | | _doing_it_wrong( 'wpdb::prepare', __( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ), '4.9.0' ); |
| 1356 | _doing_it_wrong( 'WPDB::prepare', __( 'The query only expected one placeholder, but an array of multiple placeholders was sent.' ), '4.9.0' ); |
1357 | 1357 | |
1358 | 1358 | return; |
1359 | 1359 | } else { |
… |
… |
class wpdb { |
1363 | 1363 | */ |
1364 | 1364 | wp_load_translations_early(); |
1365 | 1365 | _doing_it_wrong( |
1366 | | 'wpdb::prepare', |
| 1366 | 'WPDB::prepare', |
1367 | 1367 | /* translators: 1: number of placeholders, 2: number of arguments passed */ |
1368 | 1368 | sprintf( |
1369 | 1369 | __( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2$d).' ), |
… |
… |
class wpdb { |
1384 | 1384 | /** |
1385 | 1385 | * First half of escaping for LIKE special characters % and _ before preparing for MySQL. |
1386 | 1386 | * |
1387 | | * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. |
| 1387 | * Use this only before WPDB::prepare() or esc_sql(). Reversing the order is very bad for security. |
1388 | 1388 | * |
1389 | 1389 | * Example Prepared Statement: |
1390 | 1390 | * |
… |
… |
class wpdb { |
1401 | 1401 | * |
1402 | 1402 | * @param string $text The raw text to be escaped. The input typed by the user should have no |
1403 | 1403 | * extra or deleted slashes. |
1404 | | * @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare() |
| 1404 | * @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $WPDB::prepare() |
1405 | 1405 | * or real_escape next. |
1406 | 1406 | */ |
1407 | 1407 | public function esc_like( $text ) { |
… |
… |
class wpdb { |
1486 | 1486 | * Enables showing of database errors. |
1487 | 1487 | * |
1488 | 1488 | * This function should be used only to enable showing of errors. |
1489 | | * wpdb::hide_errors() should be used instead for hiding of errors. However, |
| 1489 | * WPDB::hide_errors() should be used instead for hiding of errors. However, |
1490 | 1490 | * this function can be used to enable and disable showing of database |
1491 | 1491 | * errors. |
1492 | 1492 | * |
1493 | 1493 | * @since 0.71 |
1494 | | * @see wpdb::hide_errors() |
| 1494 | * @see WPDB::hide_errors() |
1495 | 1495 | * |
1496 | 1496 | * @param bool $show Whether to show or hide errors |
1497 | 1497 | * @return bool Old value for showing errors. |
… |
… |
class wpdb { |
1508 | 1508 | * By default database errors are not shown. |
1509 | 1509 | * |
1510 | 1510 | * @since 0.71 |
1511 | | * @see wpdb::show_errors() |
| 1511 | * @see WPDB::show_errors() |
1512 | 1512 | * |
1513 | 1513 | * @return bool Whether showing of errors was active |
1514 | 1514 | */ |
… |
… |
class wpdb { |
1525 | 1525 | * call to this function they can be enabled. |
1526 | 1526 | * |
1527 | 1527 | * @since 2.5.0 |
1528 | | * @see wpdb::hide_errors() |
| 1528 | * @see WPDB::hide_errors() |
1529 | 1529 | * @param bool $suppress Optional. New value. Defaults to true. |
1530 | 1530 | * @return bool Old value |
1531 | 1531 | */ |
… |
… |
class wpdb { |
1999 | 1999 | * |
2000 | 2000 | * @since 3.9.0 |
2001 | 2001 | * |
2002 | | * @see wpdb::query() |
| 2002 | * @see WPDB::query() |
2003 | 2003 | * |
2004 | 2004 | * @param string $query The query to run. |
2005 | 2005 | */ |
… |
… |
class wpdb { |
2086 | 2086 | /** |
2087 | 2087 | * Insert a row into a table. |
2088 | 2088 | * |
2089 | | * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) |
2090 | | * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) |
| 2089 | * WPDB::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) |
| 2090 | * WPDB::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) |
2091 | 2091 | * |
2092 | 2092 | * @since 2.5.0 |
2093 | | * @see wpdb::prepare() |
2094 | | * @see wpdb::$field_types |
| 2093 | * @see WPDB::prepare() |
| 2094 | * @see WPDB::$field_types |
2095 | 2095 | * @see wp_set_wpdb_vars() |
2096 | 2096 | * |
2097 | 2097 | * @param string $table Table name |
… |
… |
class wpdb { |
2101 | 2101 | * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. |
2102 | 2102 | * If string, that format will be used for all of the values in $data. |
2103 | 2103 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
2104 | | * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. |
| 2104 | * If omitted, all values in $data will be treated as strings unless otherwise specified in WPDB::$field_types. |
2105 | 2105 | * @return int|false The number of rows inserted, or false on error. |
2106 | 2106 | */ |
2107 | 2107 | public function insert( $table, $data, $format = null ) { |
… |
… |
class wpdb { |
2111 | 2111 | /** |
2112 | 2112 | * Replace a row into a table. |
2113 | 2113 | * |
2114 | | * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) |
2115 | | * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) |
| 2114 | * WPDB::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) |
| 2115 | * WPDB::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) |
2116 | 2116 | * |
2117 | 2117 | * @since 3.0.0 |
2118 | | * @see wpdb::prepare() |
2119 | | * @see wpdb::$field_types |
| 2118 | * @see WPDB::prepare() |
| 2119 | * @see WPDB::$field_types |
2120 | 2120 | * @see wp_set_wpdb_vars() |
2121 | 2121 | * |
2122 | 2122 | * @param string $table Table name |
… |
… |
class wpdb { |
2126 | 2126 | * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. |
2127 | 2127 | * If string, that format will be used for all of the values in $data. |
2128 | 2128 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
2129 | | * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. |
| 2129 | * If omitted, all values in $data will be treated as strings unless otherwise specified in WPDB::$field_types. |
2130 | 2130 | * @return int|false The number of rows affected, or false on error. |
2131 | 2131 | */ |
2132 | 2132 | public function replace( $table, $data, $format = null ) { |
… |
… |
class wpdb { |
2139 | 2139 | * Runs an insert or replace query based on $type argument. |
2140 | 2140 | * |
2141 | 2141 | * @since 3.0.0 |
2142 | | * @see wpdb::prepare() |
2143 | | * @see wpdb::$field_types |
| 2142 | * @see WPDB::prepare() |
| 2143 | * @see WPDB::$field_types |
2144 | 2144 | * @see wp_set_wpdb_vars() |
2145 | 2145 | * |
2146 | 2146 | * @param string $table Table name |
… |
… |
class wpdb { |
2150 | 2150 | * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. |
2151 | 2151 | * If string, that format will be used for all of the values in $data. |
2152 | 2152 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
2153 | | * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. |
| 2153 | * If omitted, all values in $data will be treated as strings unless otherwise specified in WPDB::$field_types. |
2154 | 2154 | * @param string $type Optional. What type of operation is this? INSERT or REPLACE. Defaults to INSERT. |
2155 | 2155 | * @return int|false The number of rows affected, or false on error. |
2156 | 2156 | */ |
… |
… |
class wpdb { |
2190 | 2190 | /** |
2191 | 2191 | * Update a row in the table |
2192 | 2192 | * |
2193 | | * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) ) |
2194 | | * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) ) |
| 2193 | * WPDB::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) ) |
| 2194 | * WPDB::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) ) |
2195 | 2195 | * |
2196 | 2196 | * @since 2.5.0 |
2197 | | * @see wpdb::prepare() |
2198 | | * @see wpdb::$field_types |
| 2197 | * @see WPDB::prepare() |
| 2198 | * @see WPDB::$field_types |
2199 | 2199 | * @see wp_set_wpdb_vars() |
2200 | 2200 | * |
2201 | 2201 | * @param string $table Table name |
… |
… |
class wpdb { |
2210 | 2210 | * @param array|string $format Optional. An array of formats to be mapped to each of the values in $data. |
2211 | 2211 | * If string, that format will be used for all of the values in $data. |
2212 | 2212 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
2213 | | * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types. |
| 2213 | * If omitted, all values in $data will be treated as strings unless otherwise specified in WPDB::$field_types. |
2214 | 2214 | * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. |
2215 | 2215 | * If string, that format will be used for all of the items in $where. |
2216 | 2216 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
… |
… |
class wpdb { |
2265 | 2265 | /** |
2266 | 2266 | * Delete a row in the table |
2267 | 2267 | * |
2268 | | * wpdb::delete( 'table', array( 'ID' => 1 ) ) |
2269 | | * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) ) |
| 2268 | * WPDB::delete( 'table', array( 'ID' => 1 ) ) |
| 2269 | * WPDB::delete( 'table', array( 'ID' => 1 ), array( '%d' ) ) |
2270 | 2270 | * |
2271 | 2271 | * @since 3.4.0 |
2272 | | * @see wpdb::prepare() |
2273 | | * @see wpdb::$field_types |
| 2272 | * @see WPDB::prepare() |
| 2273 | * @see WPDB::$field_types |
2274 | 2274 | * @see wp_set_wpdb_vars() |
2275 | 2275 | * |
2276 | 2276 | * @param string $table Table name |
… |
… |
class wpdb { |
2281 | 2281 | * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. |
2282 | 2282 | * If string, that format will be used for all of the items in $where. |
2283 | 2283 | * A format is one of '%d', '%f', '%s' (integer, float, string). |
2284 | | * If omitted, all values in $where will be treated as strings unless otherwise specified in wpdb::$field_types. |
| 2284 | * If omitted, all values in $where will be treated as strings unless otherwise specified in WPDB::$field_types. |
2285 | 2285 | * @return int|false The number of rows updated, or false on error. |
2286 | 2286 | */ |
2287 | 2287 | public function delete( $table, $where, $where_format = null ) { |
… |
… |
class wpdb { |
2393 | 2393 | |
2394 | 2394 | /** |
2395 | 2395 | * Adds field charsets to field/value/format arrays generated by |
2396 | | * the wpdb::process_field_formats() method. |
| 2396 | * the WPDB::process_field_formats() method. |
2397 | 2397 | * |
2398 | 2398 | * @since 4.2.0 |
2399 | 2399 | * |
2400 | | * @param array $data As it comes from the wpdb::process_field_formats() method. |
| 2400 | * @param array $data As it comes from the WPDB::process_field_formats() method. |
2401 | 2401 | * @param string $table Table name. |
2402 | 2402 | * @return array|false The same array as $data with additional 'charset' keys. |
2403 | 2403 | */ |
… |
… |
class wpdb { |
2427 | 2427 | * |
2428 | 2428 | * @since 4.2.1 |
2429 | 2429 | * |
2430 | | * @param array $data As it comes from the wpdb::process_field_charsets() method. |
| 2430 | * @param array $data As it comes from the WPDB::process_field_charsets() method. |
2431 | 2431 | * @param string $table Table name. |
2432 | 2432 | * @return array|false The same array as $data with additional 'length' keys, or false if |
2433 | 2433 | * any of the values were too long for their corresponding field. |
… |
… |
class wpdb { |
3357 | 3357 | /** |
3358 | 3358 | * Wraps errors in a nice header and footer and dies. |
3359 | 3359 | * |
3360 | | * Will not die if wpdb::$show_errors is false. |
| 3360 | * Will not die if WPDB::$show_errors is false. |
3361 | 3361 | * |
3362 | 3362 | * @since 1.5.0 |
3363 | 3363 | * |
… |
… |
class wpdb { |
3452 | 3452 | * |
3453 | 3453 | * Called when WordPress is generating the table scheme. |
3454 | 3454 | * |
3455 | | * Use `wpdb::has_cap( 'collation' )`. |
| 3455 | * Use `WPDB::has_cap( 'collation' )`. |
3456 | 3456 | * |
3457 | 3457 | * @since 2.5.0 |
3458 | | * @deprecated 3.5.0 Use wpdb::has_cap() |
| 3458 | * @deprecated 3.5.0 Use WPDB::has_cap() |
3459 | 3459 | * |
3460 | 3460 | * @return bool True if collation is supported, false if version does not |
3461 | 3461 | */ |
3462 | 3462 | public function supports_collation() { |
3463 | | _deprecated_function( __FUNCTION__, '3.5.0', 'wpdb::has_cap( \'collation\' )' ); |
| 3463 | _deprecated_function( __FUNCTION__, '3.5.0', 'WPDB::has_cap( \'collation\' )' ); |
3464 | 3464 | return $this->has_cap( 'collation' ); |
3465 | 3465 | } |
3466 | 3466 | |
… |
… |
class wpdb { |
3491 | 3491 | * @since 4.1.0 Added support for the 'utf8mb4' feature. |
3492 | 3492 | * @since 4.6.0 Added support for the 'utf8mb4_520' feature. |
3493 | 3493 | * |
3494 | | * @see wpdb::db_version() |
| 3494 | * @see WPDB::db_version() |
3495 | 3495 | * |
3496 | 3496 | * @param string $db_cap The feature to check for. Accepts 'collation', |
3497 | 3497 | * 'group_concat', 'subqueries', 'set_charset', |
-
diff --git a/src/xmlrpc.php b/src/xmlrpc.php
index b36b21e951..d5940f2ec0 100644
a
|
b
|
$post_default_title = ''; |
79 | 79 | * |
80 | 80 | * @param string $class The name of the XML-RPC server class. |
81 | 81 | */ |
82 | | $wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' ); |
83 | | $wp_xmlrpc_server = new $wp_xmlrpc_server_class; |
| 82 | $WP_XMLRPC_Server_class = apply_filters( 'WP_XMLRPC_Server_class', 'WP_XMLRPC_Server' ); |
| 83 | $WP_XMLRPC_Server = new $WP_XMLRPC_Server_class; |
84 | 84 | |
85 | 85 | // Fire off the request |
86 | | $wp_xmlrpc_server->serve_request(); |
| 86 | $WP_XMLRPC_Server->serve_request(); |
87 | 87 | |
88 | 88 | exit; |
89 | 89 | |
-
diff --git a/tests/phpunit/includes/testcase-xmlrpc.php b/tests/phpunit/includes/testcase-xmlrpc.php
index 5fe312bc13..837a74a168 100644
a
|
b
|
class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase { |
11 | 11 | |
12 | 12 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |
13 | 13 | |
14 | | $this->myxmlrpcserver = new wp_xmlrpc_server(); |
| 14 | $this->myxmlrpcserver = new WP_XMLRPC_Server(); |
15 | 15 | } |
16 | 16 | |
17 | 17 | function tearDown() { |
-
diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php
index 0583ae132a..46653378dd 100644
a
|
b
|
class Tests_DB extends WP_UnitTestCase { |
359 | 359 | |
360 | 360 | /** |
361 | 361 | * @ticket 25604 |
362 | | * @expectedIncorrectUsage wpdb::prepare |
| 362 | * @expectedIncorrectUsage WPDB::prepare |
363 | 363 | */ |
364 | 364 | function test_prepare_without_arguments() { |
365 | 365 | global $wpdb; |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
381 | | * @expectedIncorrectUsage wpdb::prepare |
| 381 | * @expectedIncorrectUsage WPDB::prepare |
382 | 382 | */ |
383 | 383 | function test_prepare_sprintf_invalid_args() { |
384 | 384 | global $wpdb; |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
403 | | * @expectedIncorrectUsage wpdb::prepare |
| 403 | * @expectedIncorrectUsage WPDB::prepare |
404 | 404 | */ |
405 | 405 | function test_prepare_vsprintf_invalid_args() { |
406 | 406 | global $wpdb; |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
417 | 417 | /** |
418 | 418 | * @ticket 42040 |
419 | 419 | * @dataProvider data_prepare_incorrect_arg_count |
420 | | * @expectedIncorrectUsage wpdb::prepare |
| 420 | * @expectedIncorrectUsage WPDB::prepare |
421 | 421 | */ |
422 | 422 | public function test_prepare_incorrect_arg_count( $query, $args, $expected ) { |
423 | 423 | global $wpdb; |
424 | 424 | |
425 | | // $query is the first argument to be passed to wpdb::prepare() |
| 425 | // $query is the first argument to be passed to WPDB::prepare() |
426 | 426 | array_unshift( $args, $query ); |
427 | 427 | |
428 | 428 | // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
694 | | * wpdb::update() requires a WHERE condition. |
| 694 | * WPDB::update() requires a WHERE condition. |
695 | 695 | * |
696 | 696 | * @ticket 26106 |
697 | 697 | */ |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
1359 | 1359 | global $wpdb; |
1360 | 1360 | |
1361 | 1361 | if ( $incorrect_usage ) { |
1362 | | $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); |
| 1362 | $this->setExpectedIncorrectUsage( 'WPDB::prepare' ); |
1363 | 1363 | } |
1364 | 1364 | |
1365 | 1365 | if ( ! is_array( $values ) ) { |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
1379 | 1379 | global $wpdb; |
1380 | 1380 | |
1381 | 1381 | if ( $incorrect_usage ) { |
1382 | | $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); |
| 1382 | $this->setExpectedIncorrectUsage( 'WPDB::prepare' ); |
1383 | 1383 | } |
1384 | 1384 | |
1385 | 1385 | if ( ! is_array( $values ) ) { |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
1572 | 1572 | global $wpdb; |
1573 | 1573 | |
1574 | 1574 | if ( $incorrect_usage ) { |
1575 | | $this->setExpectedIncorrectUsage( 'wpdb::prepare' ); |
| 1575 | $this->setExpectedIncorrectUsage( 'WPDB::prepare' ); |
1576 | 1576 | } |
1577 | 1577 | |
1578 | 1578 | $escape = esc_sql( $escape ); |
… |
… |
class Tests_DB extends WP_UnitTestCase { |
1613 | 1613 | } |
1614 | 1614 | |
1615 | 1615 | /** |
1616 | | * @expectedIncorrectUsage wpdb::prepare |
| 1616 | * @expectedIncorrectUsage WPDB::prepare |
1617 | 1617 | */ |
1618 | 1618 | function test_double_prepare() { |
1619 | 1619 | global $wpdb; |
-
diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php
index 3089ec9a74..81f9d76c66 100644
a
|
b
|
class Tests_DB_Charset extends WP_UnitTestCase { |
659 | 659 | } |
660 | 660 | |
661 | 661 | /** |
662 | | * Set of table definitions for testing wpdb::get_table_charset and wpdb::get_column_charset |
| 662 | * Set of table definitions for testing WPDB::get_table_charset and WPDB::get_column_charset |
663 | 663 | * |
664 | 664 | * @var array |
665 | 665 | */ |
-
diff --git a/tests/phpunit/tests/oembed/wpOembed.php b/tests/phpunit/tests/oembed/wpOembed.php
index c148dd555c..9df3d44da2 100644
a
|
b
|
|
3 | 3 | /** |
4 | 4 | * @group oembed |
5 | 5 | */ |
6 | | class Tests_WP_oEmbed extends WP_UnitTestCase { |
| 6 | class Tests_WP_OEmbed extends WP_UnitTestCase { |
7 | 7 | /** |
8 | | * @var WP_oEmbed |
| 8 | * @var WP_OEmbed |
9 | 9 | */ |
10 | 10 | protected $oembed; |
11 | 11 | |