<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[47740] trunk/src/wp-includes/wp-db.php: Docs: Update inline documentation for the wpdb class.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/47740">47740</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/47740","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-05-02 17:23:28 +0000 (Sat, 02 May 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Docs: Update inline documentation for the wpdb class.
Props theMikeD
Fixes <a href="https://core.trac.wordpress.org/ticket/49477">#49477</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludeswpdbphp">trunk/src/wp-includes/wp-db.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludeswpdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/wp-db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/wp-db.php 2020-05-02 16:27:34 UTC (rev 47739)
+++ trunk/src/wp-includes/wp-db.php 2020-05-02 17:23:28 UTC (rev 47740)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress DB Class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress database access abstraction class
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,14 +37,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'ARRAY_N', 'ARRAY_N' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Database Access Abstraction Object
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress database access abstraction class
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * It is possible to replace this class with your own
- * by setting the $wpdb global variable in wp-content/db.php
- * file to your class. The wpdb class will still be included,
- * so you can extend it or simply use your own.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This class is used to interact with a database without needing to use raw SQL statements. By default, WordPress
+ * uses this class to instantiate the global $wpdb object, providing access to the WordPress database.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @link https://codex.wordpress.org/Function_Reference/wpdb_Class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @link https://developer.wordpress.org/reference/classes/wpdb/
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,8 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to show SQL/DB errors.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Default behavior is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY
- * evaluated to true.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Default is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluate to true.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $show_errors = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Whether to suppress errors during the DB bootstrapping.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Whether to suppress errors during the DB bootstrapping. Default false.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $suppress_errors = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The last error during query.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The last error encountered during the last query.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $last_error = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Amount of queries made
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The number of queries made.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -86,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $num_queries = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Count of rows returned by previous query
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Count of rows returned by the last query.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +91,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $num_rows = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Count of affected rows by previous query
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Count of rows affected by the last query.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,7 +99,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $rows_affected = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,7 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $insert_id = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Last query made
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The last query made.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $last_query;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Results of the last query made
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Results of the last query.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var array|null
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,7 +131,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $result;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Cached column info, for sanity checking data before inserting
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Cached column info, for sanity checking data before inserting.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +139,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $col_meta = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Calculated character sets on tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Calculated character sets on tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $table_charset = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Whether text fields in the current query need to be sanity checked.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Whether text fields in the current query need to be sanity checked. Default false.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,7 +164,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private $checking_collation = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Saved info on the table column
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Saved info on the table column.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,7 +196,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $queries;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The number of times to retry reconnecting before dying.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The number of times to retry reconnecting before dying. Default 5.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::check_connection()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,9 +207,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * WordPress table prefix
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * You can set this to have multiple WordPress installations
- * in a single database. The second reason is for possible
- * security precautions.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * You can set this to have multiple WordPress installations in a single database.
+ * The second reason is for possible security precautions.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $siteid = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * List of WordPress per-blog tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of WordPress per-blog tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::tables()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,9 +268,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * List of deprecated WordPress tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of deprecated WordPress tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::tables()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,7 +279,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $old_tables = array( 'categories', 'post2cat', 'link2cat' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * List of WordPress global tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of WordPress global tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::tables()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +288,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $global_tables = array( 'users', 'usermeta' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * List of Multisite global tables
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of Multisite global tables.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::tables()
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -309,7 +305,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Comments table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Comments table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -317,7 +313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $comments;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Comment Metadata table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Comment Metadata table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,7 +321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $commentmeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Links table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Links table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,7 +329,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $links;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Options table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Options table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -341,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $options;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Post Metadata table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Post Metadata table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -349,7 +345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $postmeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Posts table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Posts table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,7 +353,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $posts;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Terms table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Terms table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,7 +361,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $terms;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Term Relationships table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Term Relationships table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,7 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $term_relationships;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Term Taxonomy table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Term Taxonomy table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,7 +389,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> //
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress User Metadata table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress User Metadata table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -401,7 +397,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $usermeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * WordPress Users table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * WordPress Users table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +405,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $users;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Blogs table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Blogs table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,7 +413,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $blogs;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Blog Metadata table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Blog Metadata table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +421,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $blogmeta;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Registration Log table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Registration Log table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -433,7 +429,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $registration_log;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Signups table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Signups table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,7 +437,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $signups;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Sites table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Sites table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -449,7 +445,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $site;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Sitewide Terms table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Sitewide Terms table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,7 +453,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $sitecategories;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Multisite Site Metadata table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Multisite Site Metadata table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,7 +476,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $field_types = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database table columns charset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database table columns charset.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -488,7 +484,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $charset;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database table columns collate
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database table columns collate.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -496,7 +492,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public $collate;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database Username
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database Username.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,7 +500,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $dbuser;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database Password
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database Password.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -512,7 +508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $dbpassword;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database Name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database Name.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -520,7 +516,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $dbname;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database Host
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database Host.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -528,7 +524,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $dbhost;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Database Handle
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Database Handle.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -536,7 +532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected $dbh;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * A textual description of the last query/get_row/get_var call
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * A textual description of the last query/get_row/get_var call.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -572,7 +568,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Whether to use mysqli over mysql.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Whether to use mysqli over mysql. Default false.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,7 +576,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private $use_mysqli = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Whether we've managed to successfully connect at some point
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Whether we've managed to successfully connect at some point.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @var bool
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -588,11 +584,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> private $has_connected = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Connects to the database server and selects a database
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Connects to the database server and selects a database.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * PHP5 style constructor for compatibility with PHP5. Does
- * the actual setting up of the class properties and connection
- * to the database.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * PHP5 style constructor for compatibility with PHP5. Does the actual setting up of the class properties and
+ * connection to the database.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://core.trac.wordpress.org/ticket/3354
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.8
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -599,10 +594,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global string $wp_version The WordPress version string.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $dbuser MySQL database user
- * @param string $dbpassword MySQL database password
- * @param string $dbname MySQL database name
- * @param string $dbhost MySQL database host
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $dbuser MySQL database user.
+ * @param string $dbpassword MySQL database password.
+ * @param string $dbname MySQL database name.
+ * @param string $dbhost MySQL database host.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( WP_DEBUG && WP_DEBUG_DISPLAY ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -636,8 +631,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name The private member to get, and optionally process
- * @return mixed The private member
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name The private member to get, and optionally process.
+ * @return mixed The private member.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __get( $name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'col_info' === $name ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -652,8 +647,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name The private member to set
- * @param mixed $value The value to set
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name The private member to set.
+ * @param mixed $value The value to set.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __set( $name, $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $protected_members = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -672,9 +667,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $name The private member to check
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $name The private member to check.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool If the member is set or not
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool If the member is set or not.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __isset( $name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return isset( $this->$name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,7 +768,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param resource $dbh The resource given by mysql_connect
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param resource $dbh The resource given by mysql_connect.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $charset Optional. The character set. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $collate Optional. The collation. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -817,8 +812,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Change the current SQL mode, and ensure its WordPress compatibility.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If no modes are passed, it will ensure the current MySQL server
- * modes are compatible.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If no modes are passed, it will ensure the current MySQL server modes are compatible.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -886,7 +880,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $prefix Alphanumeric name for the new prefix.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $set_table_names Optional. Whether the table names, e.g. wpdb::$posts, should be updated or not.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|WP_Error Old prefix or WP_Error on error
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|WP_Error Old prefix or WP_Error on error.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_prefix( $prefix, $set_table_names = true ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -931,7 +925,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $blog_id
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $network_id Optional.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int previous blog id
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int Previous blog id.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_blog_id( $blog_id, $network_id = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $network_id ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -980,11 +974,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns an array of WordPress tables.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to
- * override the WordPress users and usermeta tables that would otherwise
- * be determined by the prefix.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to override the WordPress users and usermeta
+ * tables that would otherwise be determined by the prefix.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The scope argument can take one of the following:
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The $scope argument can take one of the following:
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * 'all' - returns 'all' and 'global' tables. No old tables are returned.
</span><span class="cx" style="display: block; padding: 0 10px"> * 'blog' - returns the blog-level tables for the queried blog.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1062,8 +1055,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Selects a database using the current database connection.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The database name will be changed based on the current database
- * connection. On failure, the execution will bail and display an DB error.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The database name will be changed based on the current database connection. On failure, the execution will
+ * bail and display a DB error.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1149,8 +1142,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see mysql_real_escape_string()
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $string to escape
- * @return string escaped
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string String to escape.
+ * @return string Escaped string.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _real_escape( $string ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->dbh ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1177,10 +1170,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Escape data. Works on arrays.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::_real_escape()
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 2.8.0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 2.8.0
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $data
- * @return string|array escaped
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|array $data Data to escape.
+ * @return string|array Escaped data, in the same type as supplied.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function _escape( $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $data ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1231,13 +1224,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Escapes content by reference for insertion into the database, for security
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Escapes content by reference for insertion into the database, for security.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wpdb::_real_escape()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $string to escape
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $string String to escape.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function escape_by_ref( &$string ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_float( $string ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1246,26 +1239,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Prepares a SQL query for safe execution. Uses sprintf()-like syntax.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Prepares a SQL query for safe execution.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The following placeholders can be used in the query string:
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Uses sprintf()-like syntax. The following placeholders can be used in the query string:
</ins><span class="cx" style="display: block; padding: 0 10px"> * %d (integer)
</span><span class="cx" style="display: block; padding: 0 10px"> * %f (float)
</span><span class="cx" style="display: block; padding: 0 10px"> * %s (string)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * All placeholders MUST be left unquoted in the query string. A corresponding argument
- * MUST be passed for each placeholder.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * All placeholders MUST be left unquoted in the query string. A corresponding argument MUST be passed for each
+ * placeholder.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * For compatibility with old behavior, numbered or formatted string placeholders (eg, %1$s, %5s)
- * will not have quotes added by this function, so should be passed with appropriate quotes around
- * them for your usage.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Note: There is one exception to the above: for compatibility with old behavior, older-style numbered or formatted
+ * string placeholders (eg, %1$s, %5s) will not have quotes added by this function, so should be passed with
+ * appropriate quotes around them.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Literal percentage signs (%) in the query string must be written as %%. Percentage wildcards (for example,
</span><span class="cx" style="display: block; padding: 0 10px"> * to use in LIKE syntax) must be passed via a substitution argument containing the complete LIKE string, these
</span><span class="cx" style="display: block; padding: 0 10px"> * cannot be inserted directly in the query string. Also see wpdb::esc_like().
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Arguments may be passed as individual arguments to the method, or as a single array containing
- * all arguments. A combination of the two is not supported.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Arguments may be passed as individual arguments to the method, or as a single array containing all arguments.
+ * A combination of the two is not supported.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Examples:
</span><span class="cx" style="display: block; padding: 0 10px"> * $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d OR `other_field` LIKE %s", array( 'foo', 1337, '%bar' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1277,13 +1270,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * by updating the function signature. The second parameter was changed
</span><span class="cx" style="display: block; padding: 0 10px"> * from `$args` to `...$args`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $query Query statement with sprintf()-like placeholders
- * @param array|mixed $args The array of variables to substitute into the query's placeholders
- * if being called with an array of arguments, or the first variable
- * to substitute into the query's placeholders if being called with
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $query Query statement with sprintf()-like placeholders.
+ * @param array|mixed $args The array of variables to substitute into the query's placeholders if being called
+ * with an array of arguments, or the first variable to substitute into the query's
+ * placeholders if being called with individual arguments.
+ * @param mixed ...$args Further variables to substitute into the query's placeholders if being called with
</ins><span class="cx" style="display: block; padding: 0 10px"> * individual arguments.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed ...$args Further variables to substitute into the query's placeholders
- * if being called with individual arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|void Sanitized query string, if there is a query to prepare.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function prepare( $query, ...$args ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1423,9 +1416,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Print SQL/DB error.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global array $EZSQL_ERROR Stores error information of query and error string.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global array $EZSQL_ERROR Stores error information of query and error string
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $str The error to display.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $str The error to display
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return void|false Void if the showing of errors is enabled, false if disabled.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function print_error( $str = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1496,16 +1489,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Enables showing of database errors.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * This function should be used only to enable showing of errors.
- * wpdb::hide_errors() should be used instead for hiding of errors. However,
- * this function can be used to enable and disable showing of database
- * errors.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This function should be used only to enable showing of errors. wpdb::hide_errors() should be used instead for
+ * hiding of errors. However, this function can be used to enable and disable showing of database errors.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @see wpdb::hide_errors()
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::hide_errors()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $show Whether to show or hide errors
- * @return bool Old value for showing errors.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $show Whether to show or hide errors.
+ * @return bool Whether showing of errors was previously active.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function show_errors( $show = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $errors = $this->show_errors;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1521,7 +1514,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::show_errors()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool Whether showing of errors was active
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool Whether showing of errors was previously active.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function hide_errors() {
</span><span class="cx" style="display: block; padding: 0 10px"> $show = $this->show_errors;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1532,11 +1525,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Whether to suppress database errors.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * By default database errors are suppressed, with a simple
- * call to this function they can be enabled.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * By default database errors are suppressed, with a simple call to this function they can be enabled.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::hide_errors()
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $suppress Optional. New value. Defaults to true.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Old value
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1580,8 +1573,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Connect to and select database.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If $allow_bail is false, the lack of database connection will need
- * to be handled manually.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If $allow_bail is false, the lack of database connection will need to be handled manually.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0 $allow_bail parameter added.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1717,9 +1709,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Parse the DB_HOST setting to interpret it for mysqli_real_connect.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * mysqli_real_connect doesn't support the host param including a port or
- * socket like mysql_connect does. This duplicates how mysql_connect detects
- * a port and/or socket file.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * mysqli_real_connect doesn't support the host param including a port or socket like mysql_connect does. This
+ * duplicates how mysql_connect detects a port and/or socket file.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1771,11 +1762,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Checks that the connection to the database is still up. If not, try to reconnect.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If this function is unable to reconnect, it will forcibly die, or if after the
- * the {@see 'template_redirect'} hook has been fired, return false instead.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If this function is unable to reconnect, it will forcibly die, or if after the {@see 'template_redirect'} hook
+ * has been fired, return false instead.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If $allow_bail is false, the lack of database connection will need
- * to be handled manually.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If $allow_bail is false, the lack of database connection will need to be handled manually.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1802,8 +1792,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // On the last try, re-enable warnings. We want to see a single instance
- // of the "unable to connect" message on the bail() screen, if it appears.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // On the last try, re-enable warnings. We want to see a single instance of the
+ // "unable to connect" message on the bail() screen, if it appears.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $this->reconnect_retries === $tries && WP_DEBUG ) {
</span><span class="cx" style="display: block; padding: 0 10px"> error_reporting( $error_reporting );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1853,8 +1843,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // We weren't able to reconnect, so we better bail.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->bail( $message, 'db_connect_fail' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Call dead_db() if bail didn't die, because this database is no more.
- // It has ceased to be (at least temporarily).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Call dead_db() if bail didn't die, because this database is no more. It has ceased to be (at least temporarily).
</ins><span class="cx" style="display: block; padding: 0 10px"> dead_db();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1997,8 +1986,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Log number of rows the query returned
- // and return number of rows selected.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Log number of rows the query returned and return number of rows selected.
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->num_rows = $num_rows;
</span><span class="cx" style="display: block; padding: 0 10px"> $return_val = $num_rows;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2138,6 +2126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Insert a row into a table.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Examples:
</ins><span class="cx" style="display: block; padding: 0 10px"> * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2146,14 +2135,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::$field_types
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_set_wpdb_vars()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $table Table name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $table Table name.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Data to insert (in column => value pairs).
</span><span class="cx" style="display: block; padding: 0 10px"> * Both $data columns and $data values should be "raw" (neither should be SQL escaped).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sending a null value will cause the column to be set to NULL - the corresponding
+ * format is ignored in this case.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the values in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If omitted, all values in $data will be treated as strings unless otherwise
+ * specified in wpdb::$field_types.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false The number of rows inserted, or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function insert( $table, $data, $format = null ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2163,6 +2154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Replace a row into a table.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Examples:
</ins><span class="cx" style="display: block; padding: 0 10px"> * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2171,14 +2163,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::$field_types
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_set_wpdb_vars()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $table Table name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $table Table name.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Data to insert (in column => value pairs).
</span><span class="cx" style="display: block; padding: 0 10px"> * Both $data columns and $data values should be "raw" (neither should be SQL escaped).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sending a null value will cause the column to be set to NULL - the corresponding
+ * format is ignored in this case.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the values in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If omitted, all values in $data will be treated as strings unless otherwise
+ * specified in wpdb::$field_types.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false The number of rows affected, or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function replace( $table, $data, $format = null ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2198,11 +2192,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $table Table name
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Data to insert (in column => value pairs).
</span><span class="cx" style="display: block; padding: 0 10px"> * Both $data columns and $data values should be "raw" (neither should be SQL escaped).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sending a null value will cause the column to be set to NULL - the corresponding format is ignored in this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sending a null value will cause the column to be set to NULL - the corresponding
+ * format is ignored in this case.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the values in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If omitted, all values in $data will be treated as strings unless otherwise
+ * specified in wpdb::$field_types.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $type Optional. What type of operation is this? INSERT or REPLACE. Defaults to INSERT.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int|false The number of rows affected, or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2240,8 +2236,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Update a row in the table
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Update a row in the table.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Examples:
</ins><span class="cx" style="display: block; padding: 0 10px"> * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) )
</span><span class="cx" style="display: block; padding: 0 10px"> * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2258,11 +2255,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $where A named array of WHERE clauses (in column => value pairs).
</span><span class="cx" style="display: block; padding: 0 10px"> * Multiple clauses will be joined with ANDs.
</span><span class="cx" style="display: block; padding: 0 10px"> * Both $where columns and $where values should be "raw".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sending a null value will create an IS NULL comparison - the corresponding format will be ignored in this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sending a null value will create an IS NULL comparison - the corresponding
+ * format will be ignored in this case.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $format Optional. An array of formats to be mapped to each of the values in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the values in $data.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If omitted, all values in $data will be treated as strings unless otherwise
+ * specified in wpdb::$field_types.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the items in $where.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2329,11 +2328,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $where A named array of WHERE clauses (in column => value pairs).
</span><span class="cx" style="display: block; padding: 0 10px"> * Multiple clauses will be joined with ANDs.
</span><span class="cx" style="display: block; padding: 0 10px"> * Both $where columns and $where values should be "raw".
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Sending a null value will create an IS NULL comparison - the corresponding format will be ignored in this case.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sending a null value will create an IS NULL comparison - the corresponding
+ * format will be ignored in this case.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where.
</span><span class="cx" style="display: block; padding: 0 10px"> * If string, that format will be used for all of the items in $where.
</span><span class="cx" style="display: block; padding: 0 10px"> * A format is one of '%d', '%f', '%s' (integer, float, string).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * If omitted, all values in $where will be treated as strings unless otherwise specified in wpdb::$field_types.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If omitted, all values in $data will be treated as strings unless otherwise
+ * specified in wpdb::$field_types.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|false The number of rows updated, or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function delete( $table, $where, $where_format = null ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2369,11 +2370,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Processes arrays of field/value pairs and field formats.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * This is a helper method for wpdb's CRUD methods, which take field/value
- * pairs for inserts, updates, and where clauses. This method first pairs
- * each value with a format. Then it determines the charset of that field,
- * using that to determine if any invalid text would be stripped. If text is
- * stripped, then field processing is rejected and the query fails.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This is a helper method for wpdb's CRUD methods, which take field/value pairs for inserts, updates, and where
+ * clauses. This method first pairs each value with a format. Then it determines the charset of that field, using
+ * that to determine if any invalid text would be stripped. If text is stripped, then field processing is rejected
+ * and the query fails.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2380,8 +2380,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $table Table name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Field/value pair.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $format Format for each field.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|false Returns an array of fields that contain paired values
- * and formats. Returns false for invalid values.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @return array|false Returns an array of fields that contain paired value and formats. Returns false for
+ * invalid values.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function process_fields( $table, $data, $format ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $this->process_field_formats( $data, $format );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2415,8 +2416,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Array of fields to values.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $format Formats to be mapped to the values in $data.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array Array, keyed by field names with values being an array
- * of 'value' and 'format' keys.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array Array, keyed by field names with values being an array of 'value' and 'format' keys.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function process_field_formats( $data, $format ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $formats = (array) $format;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2444,8 +2444,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Adds field charsets to field/value/format arrays generated by
- * the wpdb::process_field_formats() method.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adds field charsets to field/value/format arrays generated by the wpdb::process_field_formats() method.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2508,9 +2507,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve one variable from the database.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Executes a SQL query and returns the value from the SQL result.
- * If the SQL result contains more than one column and/or more than one row, this function returns the value in the column and row specified.
- * If $query is null, this function returns the value in the specified column and row from the previous SQL result.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Executes a SQL query and returns the value from the SQL result. If the SQL result contains more than one column
+ * and/or more than one row, the value in the column and row specified is returned. If $query is null, the value
+ * in the specified column and row from the previous SQL result is returned.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2547,8 +2546,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $query SQL query.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
- * an stdClass object, an associative array, or a numeric array, respectively. Default OBJECT.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
+ * correspond to a stdClass object, an associative array, or a numeric array,
+ * respectively. Default OBJECT.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $y Optional. Row to return. Indexed from 0.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|object|null|void Database query result in format specified by $output or null on failure
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2586,9 +2586,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve one column from the database.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Executes a SQL query and returns the column from the SQL result.
- * If the SQL result contains more than one column, this function returns the column specified.
- * If $query is null, this function returns the specified column from the previous SQL result.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Executes a SQL query and returns the column from the SQL result. If the SQL result contains more than one column,
+ * this function returns the column specified. If $query is null, this function returns the specified column from
+ * the previous SQL result.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2624,11 +2624,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $query SQL query.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * With one of the first three, return an array of rows indexed from 0 by SQL result row number.
- * Each row is an associative array (column => value, ...), a numerically indexed array (0 => value, ...), or an object. ( ->column = value ), respectively.
- * With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value.
- * Duplicate keys are discarded.
- * @return array|object|null Database query results
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * With one of the first three, return an array of rows indexed from 0 by SQL result row
+ * number. Each row is an associative array (column => value, ...), a numerically indexed
+ * array (0 => value, ...), or an object. ( ->column = value ), respectively. With
+ * OBJECT_K, return an associative array of row objects keyed by the value of each row's
+ * first column's value. Duplicate keys are discarded.
+ * @return array|object|null Database query results.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_results( $query = null, $output = OBJECT ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->func_call = "\$db->get_results(\"$query\", $output)";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2789,8 +2791,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $table Table name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $column Column name.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|false|WP_Error Column character set as a string. False if the column has no
- * character set. WP_Error object if there was an error.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string|false|WP_Error Column character set as a string. False if the column has no character set.
+ * WP_Error object if there was an error.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_col_charset( $table, $column ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tablekey = strtolower( $table );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2847,6 +2849,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the maximum string length allowed in a given column.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The length may either be specified as a byte length or a character length.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.1
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2938,8 +2941,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if a string is ASCII.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The negative regex is faster for non-ASCII strings, as it allows
- * the search to finish as soon as it encounters a non-ASCII character.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The negative regex is faster for non-ASCII strings, as it allows the search to finish as soon as it encounters
+ * a non-ASCII character.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3020,13 +3023,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $data Array of value arrays. Each value array has the keys
- * 'value' and 'charset'. An optional 'ascii' key can be
- * set to false to avoid redundant ASCII checks.
- * @return array|WP_Error The $data parameter, with invalid characters removed from
- * each value. This works as a passthrough: any additional keys
- * such as 'field' are retained in each value array. If we cannot
- * remove invalid characters, a WP_Error object is returned.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $data Array of value arrays. Each value array has the keys 'value' and 'charset'. An optional
+ * 'ascii' key can be set to false to avoid redundant ASCII checks.
+ * @return array|WP_Error The $data parameter, with invalid characters removed from each value. This works as a
+ * passthrough: any additional keys such as 'field' are retained in each value array. If we
+ * cannot remove invalid characters, a WP_Error object is returned.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function strip_invalid_text( $data ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $db_check_string = false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3039,11 +3040,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $truncate_by_byte_length = 'byte' === $value['length']['type'];
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $length = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /*
- * Since we have no length, we'll never truncate.
- * Initialize the variable to false. true would take us
- * through an unnecessary (for this case) codepath below.
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Since we have no length, we'll never truncate. Initialize the variable to false. true would take us
+ // through an unnecessary (for this case) codepath below.
</ins><span class="cx" style="display: block; padding: 0 10px"> $truncate_by_byte_length = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3059,7 +3057,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $needs_validation = true;
</span><span class="cx" style="display: block; padding: 0 10px"> if (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // latin1 can store any byte sequence
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // latin1 can store any byte sequence.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'latin1' === $charset
</span><span class="cx" style="display: block; padding: 0 10px"> ||
</span><span class="cx" style="display: block; padding: 0 10px"> // ASCII is always OK.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3182,7 +3180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $query Query to convert.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $query Query to convert.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|WP_Error The converted query, or a WP_Error object if the conversion fails.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function strip_invalid_text_from_query( $query ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3302,10 +3300,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * SHOW TABLE STATUS LIKE and SHOW TABLES LIKE 'wp\_123\_%'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * This quoted LIKE operand seldom holds a full table name.
- * It is usually a pattern for matching a prefix so we just
- * strip the trailing % and unescape the _ to get 'wp_123_'
- * which drop-ins can use for routing these SQL statements.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * This quoted LIKE operand seldom holds a full table name. It is usually a
+ * pattern for matching a prefix so we just strip the trailing % and unescape
+ * the _ to get 'wp_123_' which drop-ins can use for routing these SQL statements.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( preg_match( '/^\s*SHOW\s+(?:TABLE\s+STATUS|(?:FULL\s+)?TABLES)\s+(?:WHERE\s+Name\s+)?LIKE\s*("|\')((?:[\\\\0-9a-zA-Z$_.-]|[\xC2-\xDF][\x80-\xBF])+)%?\\1/is', $query, $maybe ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return str_replace( '\\_', '_', $maybe[2] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3365,8 +3362,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 0.71
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $info_type Optional. Type one of name, table, def, max_length, not_null, primary_key, multiple_key, unique_key, numeric, blob, type, unsigned, zerofill
- * @param int $col_offset Optional. 0: col name. 1: which table the col's in. 2: col's max length. 3: if the col is numeric. 4: col's type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $info_type Optional. Type one of name, table, def, max_length, not_null, primary_key,
+ * multiple_key, unique_key, numeric, blob, type, unsigned, zerofill
+ * @param int $col_offset Optional. 0: col name. 1: which table the col's in. 2: col's max length.
+ * 3: if the col is numeric. 4: col's type
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed Column Results
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_col_info( $info_type = 'name', $col_offset = -1 ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3417,9 +3416,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $message The error message.
- * @param string $error_code Optional. A computer-readable string to identify the error.
- * @return void|false Void if the showing of errors is enabled, false if disabled.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $message The Error message
+ * @param string $error_code Optional. A Computer readable string to identify the error.
+ * @return false|void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function bail( $message, $error_code = '500' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->show_errors ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3461,8 +3460,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool True if the connection was successfully closed, false if it wasn't,
- * or the connection doesn't exist.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True if the connection was successfully closed, false if it wasn't, or if the connection doesn't exist.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function close() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->dbh ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3489,10 +3487,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global string $wp_version The WordPress version string.
- * @global string $required_mysql_version The required MySQL version string.
- *
- * @return void|WP_Error
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global string $wp_version
+ * @global string $required_mysql_version
+ * @return WP_Error|void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function check_database_version() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_version, $required_mysql_version;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3549,8 +3546,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wpdb::db_version()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $db_cap The feature to check for. Accepts 'collation',
- * 'group_concat', 'subqueries', 'set_charset',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $db_cap The feature to check for. Accepts 'collation', 'group_concat', 'subqueries', 'set_charset',
</ins><span class="cx" style="display: block; padding: 0 10px"> * 'utf8mb4', or 'utf8mb4_520'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int|false Whether the database feature is supported, false otherwise.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3594,8 +3590,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieve the name of the function that called wpdb.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Searches up the list of functions until it reaches
- * the one that would most logically had called this method.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Searches up the list of functions until it reaches the one that would most logically had called this method.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre>
</div>
</div>
</body>
</html>