Code Modernization: Use explicit visibility for class property declarations.
Using `var` or only `static` to declare a class property is PHP 4 code. This updates the codebase to use explicit visibility modifiers introduced in PHP 5. Props jrf. Fixes #51557. See #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@49184 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5b6a20af07
commit
5bad4e7f8d
@ -70,7 +70,7 @@ class TwentyNineteen_SVG_Icons {
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
static $ui_icons = array(
|
public static $ui_icons = array(
|
||||||
'link' => /* material-design – link */ '
|
'link' => /* material-design – link */ '
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
@ -178,7 +178,7 @@ class TwentyNineteen_SVG_Icons {
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
static $social_icons_map = array(
|
public static $social_icons_map = array(
|
||||||
'amazon' => array(
|
'amazon' => array(
|
||||||
'amazon.com',
|
'amazon.com',
|
||||||
'amazon.cn',
|
'amazon.cn',
|
||||||
@ -237,7 +237,7 @@ class TwentyNineteen_SVG_Icons {
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
static $social_icons = array(
|
public static $social_icons = array(
|
||||||
'500px' => '
|
'500px' => '
|
||||||
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<path d="M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"></path>
|
<path d="M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"></path>
|
||||||
|
@ -45,7 +45,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $author_base = 'author';
|
public $author_base = 'author';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permalink structure for author archives.
|
* Permalink structure for author archives.
|
||||||
@ -53,7 +53,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $author_structure;
|
public $author_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permalink structure for date archives.
|
* Permalink structure for date archives.
|
||||||
@ -61,7 +61,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $date_structure;
|
public $date_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permalink structure for pages.
|
* Permalink structure for pages.
|
||||||
@ -69,7 +69,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $page_structure;
|
public $page_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base of the search permalink structure (example.com/$search_base/query).
|
* Base of the search permalink structure (example.com/$search_base/query).
|
||||||
@ -77,7 +77,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $search_base = 'search';
|
public $search_base = 'search';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permalink structure for searches.
|
* Permalink structure for searches.
|
||||||
@ -85,7 +85,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $search_structure;
|
public $search_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comments permalink base.
|
* Comments permalink base.
|
||||||
@ -93,7 +93,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $comments_base = 'comments';
|
public $comments_base = 'comments';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pagination permalink base.
|
* Pagination permalink base.
|
||||||
@ -109,7 +109,7 @@ class WP_Rewrite {
|
|||||||
* @since 4.2.0
|
* @since 4.2.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $comments_pagination_base = 'comment-page';
|
public $comments_pagination_base = 'comment-page';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feed permalink base.
|
* Feed permalink base.
|
||||||
@ -117,7 +117,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $feed_base = 'feed';
|
public $feed_base = 'feed';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comments feed permalink structure.
|
* Comments feed permalink structure.
|
||||||
@ -125,7 +125,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $comment_feed_structure;
|
public $comment_feed_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Feed request permalink structure.
|
* Feed request permalink structure.
|
||||||
@ -133,7 +133,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $feed_structure;
|
public $feed_structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The static portion of the post permalink structure.
|
* The static portion of the post permalink structure.
|
||||||
@ -178,7 +178,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $matches = '';
|
public $matches = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rewrite rules to match against the request to find the redirect or query.
|
* Rewrite rules to match against the request to find the redirect or query.
|
||||||
@ -186,7 +186,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $rules;
|
public $rules;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional rules added external to the rewrite class.
|
* Additional rules added external to the rewrite class.
|
||||||
@ -196,7 +196,7 @@ class WP_Rewrite {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $extra_rules = array();
|
public $extra_rules = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional rules that belong at the beginning to match first.
|
* Additional rules that belong at the beginning to match first.
|
||||||
@ -206,7 +206,7 @@ class WP_Rewrite {
|
|||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $extra_rules_top = array();
|
public $extra_rules_top = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rules that don't redirect to WordPress' index.php.
|
* Rules that don't redirect to WordPress' index.php.
|
||||||
@ -217,7 +217,7 @@ class WP_Rewrite {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $non_wp_rules = array();
|
public $non_wp_rules = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra permalink structures, e.g. categories, added by add_permastruct().
|
* Extra permalink structures, e.g. categories, added by add_permastruct().
|
||||||
@ -225,7 +225,7 @@ class WP_Rewrite {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $extra_permastructs = array();
|
public $extra_permastructs = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Endpoints (like /trackback/) added by add_rewrite_endpoint().
|
* Endpoints (like /trackback/) added by add_rewrite_endpoint().
|
||||||
@ -233,7 +233,7 @@ class WP_Rewrite {
|
|||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $endpoints;
|
public $endpoints;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to write every mod_rewrite rule for WordPress into the .htaccess file.
|
* Whether to write every mod_rewrite rule for WordPress into the .htaccess file.
|
||||||
@ -277,7 +277,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $rewritecode = array(
|
public $rewritecode = array(
|
||||||
'%year%',
|
'%year%',
|
||||||
'%monthnum%',
|
'%monthnum%',
|
||||||
'%day%',
|
'%day%',
|
||||||
@ -298,7 +298,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $rewritereplace = array(
|
public $rewritereplace = array(
|
||||||
'([0-9]{4})',
|
'([0-9]{4})',
|
||||||
'([0-9]{1,2})',
|
'([0-9]{1,2})',
|
||||||
'([0-9]{1,2})',
|
'([0-9]{1,2})',
|
||||||
@ -318,7 +318,7 @@ class WP_Rewrite {
|
|||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $queryreplace = array(
|
public $queryreplace = array(
|
||||||
'year=',
|
'year=',
|
||||||
'monthnum=',
|
'monthnum=',
|
||||||
'day=',
|
'day=',
|
||||||
|
@ -18,16 +18,16 @@ if ( ! class_exists( 'Translation_Entry', false ) ) :
|
|||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
var $is_plural = false;
|
public $is_plural = false;
|
||||||
|
|
||||||
var $context = null;
|
public $context = null;
|
||||||
var $singular = null;
|
public $singular = null;
|
||||||
var $plural = null;
|
public $plural = null;
|
||||||
var $translations = array();
|
public $translations = array();
|
||||||
var $translator_comments = '';
|
public $translator_comments = '';
|
||||||
var $extracted_comments = '';
|
public $extracted_comments = '';
|
||||||
var $references = array();
|
public $references = array();
|
||||||
var $flags = array();
|
public $flags = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $args associative array, support following keys:
|
* @param array $args associative array, support following keys:
|
||||||
|
@ -13,7 +13,7 @@ require_once __DIR__ . '/streams.php';
|
|||||||
if ( ! class_exists( 'MO', false ) ) :
|
if ( ! class_exists( 'MO', false ) ) :
|
||||||
class MO extends Gettext_Translations {
|
class MO extends Gettext_Translations {
|
||||||
|
|
||||||
var $_nplurals = 2;
|
public $_nplurals = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loaded MO file.
|
* Loaded MO file.
|
||||||
|
@ -21,7 +21,7 @@ ini_set( 'auto_detect_line_endings', 1 );
|
|||||||
if ( ! class_exists( 'PO', false ) ) :
|
if ( ! class_exists( 'PO', false ) ) :
|
||||||
class PO extends Gettext_Translations {
|
class PO extends Gettext_Translations {
|
||||||
|
|
||||||
var $comments_before_headers = '';
|
public $comments_before_headers = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exports headers to a PO entry
|
* Exports headers to a PO entry
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
if ( ! class_exists( 'POMO_Reader', false ) ) :
|
if ( ! class_exists( 'POMO_Reader', false ) ) :
|
||||||
class POMO_Reader {
|
class POMO_Reader {
|
||||||
|
|
||||||
var $endian = 'little';
|
public $endian = 'little';
|
||||||
var $_post = '';
|
public $_post = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP5 constructor.
|
* PHP5 constructor.
|
||||||
@ -226,7 +226,7 @@ if ( ! class_exists( 'POMO_StringReader', false ) ) :
|
|||||||
*/
|
*/
|
||||||
class POMO_StringReader extends POMO_Reader {
|
class POMO_StringReader extends POMO_Reader {
|
||||||
|
|
||||||
var $_str = '';
|
public $_str = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP5 constructor.
|
* PHP5 constructor.
|
||||||
|
@ -12,8 +12,8 @@ require_once __DIR__ . '/entry.php';
|
|||||||
|
|
||||||
if ( ! class_exists( 'Translations', false ) ) :
|
if ( ! class_exists( 'Translations', false ) ) :
|
||||||
class Translations {
|
class Translations {
|
||||||
var $entries = array();
|
public $entries = array();
|
||||||
var $headers = array();
|
public $headers = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add entry to the PO structure
|
* Add entry to the PO structure
|
||||||
@ -301,8 +301,8 @@ if ( ! class_exists( 'NOOP_Translations', false ) ) :
|
|||||||
* Provides the same interface as Translations, but doesn't do anything
|
* Provides the same interface as Translations, but doesn't do anything
|
||||||
*/
|
*/
|
||||||
class NOOP_Translations {
|
class NOOP_Translations {
|
||||||
var $entries = array();
|
public $entries = array();
|
||||||
var $headers = array();
|
public $headers = array();
|
||||||
|
|
||||||
function add_entry( $entry ) {
|
function add_entry( $entry ) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -61,7 +61,7 @@ class wpdb {
|
|||||||
* @since 0.71
|
* @since 0.71
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $show_errors = false;
|
public $show_errors = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to suppress errors during the DB bootstrapping. Default false.
|
* Whether to suppress errors during the DB bootstrapping. Default false.
|
||||||
@ -69,7 +69,7 @@ class wpdb {
|
|||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $suppress_errors = false;
|
public $suppress_errors = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The error encountered during the last query.
|
* The error encountered during the last query.
|
||||||
@ -101,7 +101,7 @@ class wpdb {
|
|||||||
* @since 0.71
|
* @since 0.71
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
var $rows_affected = 0;
|
public $rows_affected = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).
|
* The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).
|
||||||
@ -117,7 +117,7 @@ class wpdb {
|
|||||||
* @since 0.71
|
* @since 0.71
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $last_query;
|
public $last_query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Results of the last query.
|
* Results of the last query.
|
||||||
@ -125,7 +125,7 @@ class wpdb {
|
|||||||
* @since 0.71
|
* @since 0.71
|
||||||
* @var array|null
|
* @var array|null
|
||||||
*/
|
*/
|
||||||
var $last_result;
|
public $last_result;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL result, which is either a resource or boolean.
|
* MySQL result, which is either a resource or boolean.
|
||||||
@ -198,7 +198,7 @@ class wpdb {
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
var $queries;
|
public $queries;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of times to retry reconnecting before dying. Default 5.
|
* The number of times to retry reconnecting before dying. Default 5.
|
||||||
@ -234,7 +234,7 @@ class wpdb {
|
|||||||
* @since 2.3.2
|
* @since 2.3.2
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $ready = false;
|
public $ready = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blog ID.
|
* Blog ID.
|
||||||
@ -259,7 +259,7 @@ class wpdb {
|
|||||||
* @see wpdb::tables()
|
* @see wpdb::tables()
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $tables = array(
|
public $tables = array(
|
||||||
'posts',
|
'posts',
|
||||||
'comments',
|
'comments',
|
||||||
'links',
|
'links',
|
||||||
@ -281,7 +281,7 @@ class wpdb {
|
|||||||
* @see wpdb::tables()
|
* @see wpdb::tables()
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $old_tables = array( 'categories', 'post2cat', 'link2cat' );
|
public $old_tables = array( 'categories', 'post2cat', 'link2cat' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of WordPress global tables.
|
* List of WordPress global tables.
|
||||||
@ -290,7 +290,7 @@ class wpdb {
|
|||||||
* @see wpdb::tables()
|
* @see wpdb::tables()
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $global_tables = array( 'users', 'usermeta' );
|
public $global_tables = array( 'users', 'usermeta' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of Multisite global tables.
|
* List of Multisite global tables.
|
||||||
@ -299,7 +299,7 @@ class wpdb {
|
|||||||
* @see wpdb::tables()
|
* @see wpdb::tables()
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $ms_global_tables = array(
|
public $ms_global_tables = array(
|
||||||
'blogs',
|
'blogs',
|
||||||
'blogmeta',
|
'blogmeta',
|
||||||
'signups',
|
'signups',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class WP_UnitTest_Generator_Sequence {
|
class WP_UnitTest_Generator_Sequence {
|
||||||
static $incr = -1;
|
public static $incr = -1;
|
||||||
public $next;
|
public $next;
|
||||||
public $template_string;
|
public $template_string;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ require_once ABSPATH . 'wp-includes/PHPMailer/PHPMailer.php';
|
|||||||
require_once ABSPATH . 'wp-includes/PHPMailer/Exception.php';
|
require_once ABSPATH . 'wp-includes/PHPMailer/Exception.php';
|
||||||
|
|
||||||
class MockPHPMailer extends PHPMailer\PHPMailer\PHPMailer {
|
class MockPHPMailer extends PHPMailer\PHPMailer\PHPMailer {
|
||||||
var $mock_sent = array();
|
public $mock_sent = array();
|
||||||
|
|
||||||
function preSend() {
|
function preSend() {
|
||||||
$this->Encoding = '8bit';
|
$this->Encoding = '8bit';
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||||
static $old_current_user;
|
public static $old_current_user;
|
||||||
static $author_id;
|
public static $author_id;
|
||||||
static $post_ids = array();
|
public static $post_ids = array();
|
||||||
static $comment_ids = array();
|
public static $comment_ids = array();
|
||||||
static $term_ids = array();
|
public static $term_ids = array();
|
||||||
static $terms = array();
|
public static $terms = array();
|
||||||
static $old_options = array();
|
public static $old_options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This can be defined in a subclass of this class which contains its own data() method.
|
* This can be defined in a subclass of this class which contains its own data() method.
|
||||||
|
@ -38,8 +38,8 @@ function strip_ws( $txt ) {
|
|||||||
* add_action( 'foo', array( &$ma, 'action' ) );
|
* add_action( 'foo', array( &$ma, 'action' ) );
|
||||||
*/
|
*/
|
||||||
class MockAction {
|
class MockAction {
|
||||||
var $events;
|
public $events;
|
||||||
var $debug;
|
public $debug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP5 constructor.
|
* PHP5 constructor.
|
||||||
@ -184,8 +184,8 @@ class MockAction {
|
|||||||
// Convert valid XML to an array tree structure.
|
// Convert valid XML to an array tree structure.
|
||||||
// Kinda lame, but it works with a default PHP 4 installation.
|
// Kinda lame, but it works with a default PHP 4 installation.
|
||||||
class TestXMLParser {
|
class TestXMLParser {
|
||||||
var $xml;
|
public $xml;
|
||||||
var $data = array();
|
public $data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP5 constructor.
|
* PHP5 constructor.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* @group adminScreen
|
* @group adminScreen
|
||||||
*/
|
*/
|
||||||
class Tests_Admin_includesScreen extends WP_UnitTestCase {
|
class Tests_Admin_includesScreen extends WP_UnitTestCase {
|
||||||
var $core_screens = array(
|
public $core_screens = array(
|
||||||
'index.php' => array(
|
'index.php' => array(
|
||||||
'base' => 'dashboard',
|
'base' => 'dashboard',
|
||||||
'id' => 'dashboard',
|
'id' => 'dashboard',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @group cache
|
* @group cache
|
||||||
*/
|
*/
|
||||||
class Tests_Cache extends WP_UnitTestCase {
|
class Tests_Cache extends WP_UnitTestCase {
|
||||||
var $cache = null;
|
public $cache = null;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
* @group feed
|
* @group feed
|
||||||
*/
|
*/
|
||||||
class Tests_Feeds_Atom extends WP_UnitTestCase {
|
class Tests_Feeds_Atom extends WP_UnitTestCase {
|
||||||
static $user_id;
|
public static $user_id;
|
||||||
static $posts;
|
public static $posts;
|
||||||
static $category;
|
public static $category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup a new user and attribute some posts.
|
* Setup a new user and attribute some posts.
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
* @group feed
|
* @group feed
|
||||||
*/
|
*/
|
||||||
class Tests_Feeds_RSS2 extends WP_UnitTestCase {
|
class Tests_Feeds_RSS2 extends WP_UnitTestCase {
|
||||||
static $user_id;
|
public static $user_id;
|
||||||
static $posts;
|
public static $posts;
|
||||||
static $category;
|
public static $category;
|
||||||
static $post_date;
|
public static $post_date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup a new user and attribute some posts.
|
* Setup a new user and attribute some posts.
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
* @covers ::wp_list_pluck
|
* @covers ::wp_list_pluck
|
||||||
*/
|
*/
|
||||||
class Tests_Functions_wpListFilter extends WP_UnitTestCase {
|
class Tests_Functions_wpListFilter extends WP_UnitTestCase {
|
||||||
var $object_list = array();
|
public $object_list = array();
|
||||||
var $array_list = array();
|
public $array_list = array();
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
|
abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
|
||||||
// You can use your own version of data/WPHTTP-testcase-redirection-script.php here.
|
// You can use your own version of data/WPHTTP-testcase-redirection-script.php here.
|
||||||
var $redirection_script = 'http://api.wordpress.org/core/tests/1.0/redirection.php';
|
public $redirection_script = 'http://api.wordpress.org/core/tests/1.0/redirection.php';
|
||||||
var $file_stream_url = 'http://s.w.org/screenshots/3.9/dashboard.png';
|
public $file_stream_url = 'http://s.w.org/screenshots/3.9/dashboard.png';
|
||||||
|
|
||||||
protected $http_request_args;
|
protected $http_request_args;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ require_once __DIR__ . '/base.php';
|
|||||||
* @group external-http
|
* @group external-http
|
||||||
*/
|
*/
|
||||||
class Tests_HTTP_curl extends WP_HTTP_UnitTestCase {
|
class Tests_HTTP_curl extends WP_HTTP_UnitTestCase {
|
||||||
var $transport = 'curl';
|
public $transport = 'curl';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ticket 39783
|
* @ticket 39783
|
||||||
|
@ -7,5 +7,5 @@ require_once __DIR__ . '/base.php';
|
|||||||
* @group external-http
|
* @group external-http
|
||||||
*/
|
*/
|
||||||
class Tests_HTTP_streams extends WP_HTTP_UnitTestCase {
|
class Tests_HTTP_streams extends WP_HTTP_UnitTestCase {
|
||||||
var $transport = 'streams';
|
public $transport = 'streams';
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
|
|||||||
* @group header
|
* @group header
|
||||||
*/
|
*/
|
||||||
class Tests_Image_Header extends WP_UnitTestCase {
|
class Tests_Image_Header extends WP_UnitTestCase {
|
||||||
var $custom_image_header;
|
public $custom_image_header;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @group link
|
* @group link
|
||||||
*/
|
*/
|
||||||
class Tests_Link_GetDashboardUrl extends WP_UnitTestCase {
|
class Tests_Link_GetDashboardUrl extends WP_UnitTestCase {
|
||||||
static $user_id = false;
|
public static $user_id = false;
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
self::$user_id = $factory->user->create( array( 'role' => 'administrator' ) );
|
self::$user_id = $factory->user->create( array( 'role' => 'administrator' ) );
|
||||||
|
@ -12,7 +12,7 @@ if ( is_multisite() ) :
|
|||||||
/**
|
/**
|
||||||
* @var WP_MS_Sites_List_Table
|
* @var WP_MS_Sites_List_Table
|
||||||
*/
|
*/
|
||||||
var $table = false;
|
public $table = false;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
* @group query
|
* @group query
|
||||||
*/
|
*/
|
||||||
class Tests_Query_CommentCount extends WP_UnitTestCase {
|
class Tests_Query_CommentCount extends WP_UnitTestCase {
|
||||||
static $post_ids = array();
|
public static $post_ids = array();
|
||||||
public $q;
|
public $q;
|
||||||
static $post_type = 'page'; // Can be anything.
|
public static $post_type = 'page'; // Can be anything.
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -10,7 +10,7 @@ class Tests_Query_Date extends WP_UnitTestCase {
|
|||||||
|
|
||||||
public $q;
|
public $q;
|
||||||
|
|
||||||
static $post_ids = array();
|
public static $post_ids = array();
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
// Be careful modifying this. Tests are coded to expect this exact sample data.
|
// Be careful modifying this. Tests are coded to expect this exact sample data.
|
||||||
|
@ -9,17 +9,17 @@
|
|||||||
class Tests_Query_Results extends WP_UnitTestCase {
|
class Tests_Query_Results extends WP_UnitTestCase {
|
||||||
protected $q;
|
protected $q;
|
||||||
|
|
||||||
static $cat_ids = array();
|
public static $cat_ids = array();
|
||||||
static $tag_ids = array();
|
public static $tag_ids = array();
|
||||||
static $post_ids = array();
|
public static $post_ids = array();
|
||||||
|
|
||||||
static $parent_one;
|
public static $parent_one;
|
||||||
static $parent_two;
|
public static $parent_two;
|
||||||
static $parent_three;
|
public static $parent_three;
|
||||||
static $child_one;
|
public static $child_one;
|
||||||
static $child_two;
|
public static $child_two;
|
||||||
static $child_three;
|
public static $child_three;
|
||||||
static $child_four;
|
public static $child_four;
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
$cat_a = $factory->term->create(
|
$cat_a = $factory->term->create(
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @group query
|
* @group query
|
||||||
*/
|
*/
|
||||||
class Tests_Query_Stickies extends WP_UnitTestCase {
|
class Tests_Query_Stickies extends WP_UnitTestCase {
|
||||||
static $posts = array();
|
public static $posts = array();
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
// Set post times to get a reliable order.
|
// Set post times to get a reliable order.
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
class Tests_Theme_Custom_Header extends WP_UnitTestCase {
|
class Tests_Theme_Custom_Header extends WP_UnitTestCase {
|
||||||
|
|
||||||
static $post;
|
public static $post;
|
||||||
|
|
||||||
protected static $header_video_id;
|
protected static $header_video_id;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
class Tests_Upload extends WP_UnitTestCase {
|
class Tests_Upload extends WP_UnitTestCase {
|
||||||
|
|
||||||
var $siteurl;
|
public $siteurl;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
$this->_reset_options();
|
$this->_reset_options();
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* @group post
|
* @group post
|
||||||
*/
|
*/
|
||||||
class Tests_User_CountUserPosts extends WP_UnitTestCase {
|
class Tests_User_CountUserPosts extends WP_UnitTestCase {
|
||||||
static $user_id;
|
public static $user_id;
|
||||||
static $post_ids = array();
|
public static $post_ids = array();
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
self::$user_id = $factory->user->create(
|
self::$user_id = $factory->user->create(
|
||||||
|
@ -10,7 +10,7 @@ if ( is_multisite() ) :
|
|||||||
* @group multisite
|
* @group multisite
|
||||||
*/
|
*/
|
||||||
class Tests_Multisite_getActiveBlogForUser extends WP_UnitTestCase {
|
class Tests_Multisite_getActiveBlogForUser extends WP_UnitTestCase {
|
||||||
static $user_id = false;
|
public static $user_id = false;
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( $factory ) {
|
public static function wpSetUpBeforeClass( $factory ) {
|
||||||
self::$user_id = $factory->user->create();
|
self::$user_id = $factory->user->create();
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
* @group user
|
* @group user
|
||||||
*/
|
*/
|
||||||
class Tests_User_ListAuthors extends WP_UnitTestCase {
|
class Tests_User_ListAuthors extends WP_UnitTestCase {
|
||||||
static $user_ids = array();
|
public static $user_ids = array();
|
||||||
static $fred_id;
|
public static $fred_id;
|
||||||
static $posts = array();
|
public static $posts = array();
|
||||||
static $user_urls = array();
|
public static $user_urls = array();
|
||||||
/* Defaults
|
/* Defaults
|
||||||
'orderby' => 'name',
|
'orderby' => 'name',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC',
|
||||||
|
@ -286,8 +286,8 @@ class Tests_Walker extends WP_UnitTestCase {
|
|||||||
|
|
||||||
class Walker_Test extends Walker {
|
class Walker_Test extends Walker {
|
||||||
|
|
||||||
var $tree_type = 'test';
|
public $tree_type = 'test';
|
||||||
var $db_fields = array(
|
public $db_fields = array(
|
||||||
'parent' => 'parent',
|
'parent' => 'parent',
|
||||||
'id' => 'id',
|
'id' => 'id',
|
||||||
);
|
);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* @group xmlrpc
|
* @group xmlrpc
|
||||||
*/
|
*/
|
||||||
class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase {
|
class Tests_XMLRPC_wp_getComments extends WP_XMLRPC_UnitTestCase {
|
||||||
var $post_id;
|
public $post_id;
|
||||||
|
|
||||||
function test_invalid_username_password() {
|
function test_invalid_username_password() {
|
||||||
$result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
|
$result = $this->myxmlrpcserver->wp_getComments( array( 1, 'username', 'password', array() ) );
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
|
class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
|
||||||
protected static $post_id;
|
protected static $post_id;
|
||||||
|
|
||||||
var $attachment_data;
|
public $attachment_data;
|
||||||
var $attachment_id;
|
public $attachment_id;
|
||||||
|
|
||||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||||
self::$post_id = $factory->post->create();
|
self::$post_id = $factory->post->create();
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
* @group xmlrpc
|
* @group xmlrpc
|
||||||
*/
|
*/
|
||||||
class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase {
|
class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase {
|
||||||
var $post_data;
|
public $post_data;
|
||||||
var $post_id;
|
public $post_id;
|
||||||
var $post_date_ts;
|
public $post_date_ts;
|
||||||
var $post_custom_field;
|
public $post_custom_field;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
* @group xmlrpc
|
* @group xmlrpc
|
||||||
*/
|
*/
|
||||||
class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase {
|
class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase {
|
||||||
var $cpt_name;
|
public $cpt_name;
|
||||||
var $cpt_args;
|
public $cpt_args;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
* @group xmlrpc
|
* @group xmlrpc
|
||||||
*/
|
*/
|
||||||
class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase {
|
class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase {
|
||||||
var $post_id;
|
public $post_id;
|
||||||
var $revision_id;
|
public $revision_id;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
Loading…
Reference in New Issue
Block a user