mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
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:
@@ -45,7 +45,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $author_base = 'author';
|
||||
public $author_base = 'author';
|
||||
|
||||
/**
|
||||
* Permalink structure for author archives.
|
||||
@@ -53,7 +53,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $author_structure;
|
||||
public $author_structure;
|
||||
|
||||
/**
|
||||
* Permalink structure for date archives.
|
||||
@@ -61,7 +61,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $date_structure;
|
||||
public $date_structure;
|
||||
|
||||
/**
|
||||
* Permalink structure for pages.
|
||||
@@ -69,7 +69,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $page_structure;
|
||||
public $page_structure;
|
||||
|
||||
/**
|
||||
* Base of the search permalink structure (example.com/$search_base/query).
|
||||
@@ -77,7 +77,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $search_base = 'search';
|
||||
public $search_base = 'search';
|
||||
|
||||
/**
|
||||
* Permalink structure for searches.
|
||||
@@ -85,7 +85,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $search_structure;
|
||||
public $search_structure;
|
||||
|
||||
/**
|
||||
* Comments permalink base.
|
||||
@@ -93,7 +93,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $comments_base = 'comments';
|
||||
public $comments_base = 'comments';
|
||||
|
||||
/**
|
||||
* Pagination permalink base.
|
||||
@@ -109,7 +109,7 @@ class WP_Rewrite {
|
||||
* @since 4.2.0
|
||||
* @var string
|
||||
*/
|
||||
var $comments_pagination_base = 'comment-page';
|
||||
public $comments_pagination_base = 'comment-page';
|
||||
|
||||
/**
|
||||
* Feed permalink base.
|
||||
@@ -117,7 +117,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $feed_base = 'feed';
|
||||
public $feed_base = 'feed';
|
||||
|
||||
/**
|
||||
* Comments feed permalink structure.
|
||||
@@ -125,7 +125,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $comment_feed_structure;
|
||||
public $comment_feed_structure;
|
||||
|
||||
/**
|
||||
* Feed request permalink structure.
|
||||
@@ -133,7 +133,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $feed_structure;
|
||||
public $feed_structure;
|
||||
|
||||
/**
|
||||
* The static portion of the post permalink structure.
|
||||
@@ -178,7 +178,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var string
|
||||
*/
|
||||
var $matches = '';
|
||||
public $matches = '';
|
||||
|
||||
/**
|
||||
* Rewrite rules to match against the request to find the redirect or query.
|
||||
@@ -186,7 +186,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var array
|
||||
*/
|
||||
var $rules;
|
||||
public $rules;
|
||||
|
||||
/**
|
||||
* Additional rules added external to the rewrite class.
|
||||
@@ -196,7 +196,7 @@ class WP_Rewrite {
|
||||
* @since 2.1.0
|
||||
* @var array
|
||||
*/
|
||||
var $extra_rules = array();
|
||||
public $extra_rules = array();
|
||||
|
||||
/**
|
||||
* Additional rules that belong at the beginning to match first.
|
||||
@@ -206,7 +206,7 @@ class WP_Rewrite {
|
||||
* @since 2.3.0
|
||||
* @var array
|
||||
*/
|
||||
var $extra_rules_top = array();
|
||||
public $extra_rules_top = array();
|
||||
|
||||
/**
|
||||
* Rules that don't redirect to WordPress' index.php.
|
||||
@@ -217,7 +217,7 @@ class WP_Rewrite {
|
||||
* @since 2.1.0
|
||||
* @var array
|
||||
*/
|
||||
var $non_wp_rules = array();
|
||||
public $non_wp_rules = array();
|
||||
|
||||
/**
|
||||
* Extra permalink structures, e.g. categories, added by add_permastruct().
|
||||
@@ -225,7 +225,7 @@ class WP_Rewrite {
|
||||
* @since 2.1.0
|
||||
* @var array
|
||||
*/
|
||||
var $extra_permastructs = array();
|
||||
public $extra_permastructs = array();
|
||||
|
||||
/**
|
||||
* Endpoints (like /trackback/) added by add_rewrite_endpoint().
|
||||
@@ -233,7 +233,7 @@ class WP_Rewrite {
|
||||
* @since 2.1.0
|
||||
* @var array
|
||||
*/
|
||||
var $endpoints;
|
||||
public $endpoints;
|
||||
|
||||
/**
|
||||
* Whether to write every mod_rewrite rule for WordPress into the .htaccess file.
|
||||
@@ -277,7 +277,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var array
|
||||
*/
|
||||
var $rewritecode = array(
|
||||
public $rewritecode = array(
|
||||
'%year%',
|
||||
'%monthnum%',
|
||||
'%day%',
|
||||
@@ -298,7 +298,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var array
|
||||
*/
|
||||
var $rewritereplace = array(
|
||||
public $rewritereplace = array(
|
||||
'([0-9]{4})',
|
||||
'([0-9]{1,2})',
|
||||
'([0-9]{1,2})',
|
||||
@@ -318,7 +318,7 @@ class WP_Rewrite {
|
||||
* @since 1.5.0
|
||||
* @var array
|
||||
*/
|
||||
var $queryreplace = array(
|
||||
public $queryreplace = array(
|
||||
'year=',
|
||||
'monthnum=',
|
||||
'day=',
|
||||
|
||||
@@ -18,16 +18,16 @@ if ( ! class_exists( 'Translation_Entry', false ) ) :
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
var $is_plural = false;
|
||||
public $is_plural = false;
|
||||
|
||||
var $context = null;
|
||||
var $singular = null;
|
||||
var $plural = null;
|
||||
var $translations = array();
|
||||
var $translator_comments = '';
|
||||
var $extracted_comments = '';
|
||||
var $references = array();
|
||||
var $flags = array();
|
||||
public $context = null;
|
||||
public $singular = null;
|
||||
public $plural = null;
|
||||
public $translations = array();
|
||||
public $translator_comments = '';
|
||||
public $extracted_comments = '';
|
||||
public $references = array();
|
||||
public $flags = array();
|
||||
|
||||
/**
|
||||
* @param array $args associative array, support following keys:
|
||||
|
||||
@@ -13,7 +13,7 @@ require_once __DIR__ . '/streams.php';
|
||||
if ( ! class_exists( 'MO', false ) ) :
|
||||
class MO extends Gettext_Translations {
|
||||
|
||||
var $_nplurals = 2;
|
||||
public $_nplurals = 2;
|
||||
|
||||
/**
|
||||
* Loaded MO file.
|
||||
|
||||
@@ -21,7 +21,7 @@ ini_set( 'auto_detect_line_endings', 1 );
|
||||
if ( ! class_exists( 'PO', false ) ) :
|
||||
class PO extends Gettext_Translations {
|
||||
|
||||
var $comments_before_headers = '';
|
||||
public $comments_before_headers = '';
|
||||
|
||||
/**
|
||||
* Exports headers to a PO entry
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
if ( ! class_exists( 'POMO_Reader', false ) ) :
|
||||
class POMO_Reader {
|
||||
|
||||
var $endian = 'little';
|
||||
var $_post = '';
|
||||
public $endian = 'little';
|
||||
public $_post = '';
|
||||
|
||||
/**
|
||||
* PHP5 constructor.
|
||||
@@ -226,7 +226,7 @@ if ( ! class_exists( 'POMO_StringReader', false ) ) :
|
||||
*/
|
||||
class POMO_StringReader extends POMO_Reader {
|
||||
|
||||
var $_str = '';
|
||||
public $_str = '';
|
||||
|
||||
/**
|
||||
* PHP5 constructor.
|
||||
|
||||
@@ -12,8 +12,8 @@ require_once __DIR__ . '/entry.php';
|
||||
|
||||
if ( ! class_exists( 'Translations', false ) ) :
|
||||
class Translations {
|
||||
var $entries = array();
|
||||
var $headers = array();
|
||||
public $entries = array();
|
||||
public $headers = array();
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
class NOOP_Translations {
|
||||
var $entries = array();
|
||||
var $headers = array();
|
||||
public $entries = array();
|
||||
public $headers = array();
|
||||
|
||||
function add_entry( $entry ) {
|
||||
return true;
|
||||
|
||||
@@ -61,7 +61,7 @@ class wpdb {
|
||||
* @since 0.71
|
||||
* @var bool
|
||||
*/
|
||||
var $show_errors = false;
|
||||
public $show_errors = false;
|
||||
|
||||
/**
|
||||
* Whether to suppress errors during the DB bootstrapping. Default false.
|
||||
@@ -69,7 +69,7 @@ class wpdb {
|
||||
* @since 2.5.0
|
||||
* @var bool
|
||||
*/
|
||||
var $suppress_errors = false;
|
||||
public $suppress_errors = false;
|
||||
|
||||
/**
|
||||
* The error encountered during the last query.
|
||||
@@ -101,7 +101,7 @@ class wpdb {
|
||||
* @since 0.71
|
||||
* @var int
|
||||
*/
|
||||
var $rows_affected = 0;
|
||||
public $rows_affected = 0;
|
||||
|
||||
/**
|
||||
* The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).
|
||||
@@ -117,7 +117,7 @@ class wpdb {
|
||||
* @since 0.71
|
||||
* @var string
|
||||
*/
|
||||
var $last_query;
|
||||
public $last_query;
|
||||
|
||||
/**
|
||||
* Results of the last query.
|
||||
@@ -125,7 +125,7 @@ class wpdb {
|
||||
* @since 0.71
|
||||
* @var array|null
|
||||
*/
|
||||
var $last_result;
|
||||
public $last_result;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -234,7 +234,7 @@ class wpdb {
|
||||
* @since 2.3.2
|
||||
* @var bool
|
||||
*/
|
||||
var $ready = false;
|
||||
public $ready = false;
|
||||
|
||||
/**
|
||||
* Blog ID.
|
||||
@@ -259,7 +259,7 @@ class wpdb {
|
||||
* @see wpdb::tables()
|
||||
* @var array
|
||||
*/
|
||||
var $tables = array(
|
||||
public $tables = array(
|
||||
'posts',
|
||||
'comments',
|
||||
'links',
|
||||
@@ -281,7 +281,7 @@ class wpdb {
|
||||
* @see wpdb::tables()
|
||||
* @var array
|
||||
*/
|
||||
var $old_tables = array( 'categories', 'post2cat', 'link2cat' );
|
||||
public $old_tables = array( 'categories', 'post2cat', 'link2cat' );
|
||||
|
||||
/**
|
||||
* List of WordPress global tables.
|
||||
@@ -290,7 +290,7 @@ class wpdb {
|
||||
* @see wpdb::tables()
|
||||
* @var array
|
||||
*/
|
||||
var $global_tables = array( 'users', 'usermeta' );
|
||||
public $global_tables = array( 'users', 'usermeta' );
|
||||
|
||||
/**
|
||||
* List of Multisite global tables.
|
||||
@@ -299,7 +299,7 @@ class wpdb {
|
||||
* @see wpdb::tables()
|
||||
* @var array
|
||||
*/
|
||||
var $ms_global_tables = array(
|
||||
public $ms_global_tables = array(
|
||||
'blogs',
|
||||
'blogmeta',
|
||||
'signups',
|
||||
|
||||
Reference in New Issue
Block a user