mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Constructor cleanup. Props ocean90. fixes #16768
git-svn-id: https://develop.svn.wordpress.org/trunk@17771 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -456,7 +456,7 @@ class WP_User {
|
||||
var $filter = null;
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Sets up the object properties.
|
||||
* Constructor - Sets up the object properties.
|
||||
*
|
||||
* Retrieves the userdata and then assigns all of the data keys to direct
|
||||
* properties of the object. Calls {@link WP_User::_init_caps()} after
|
||||
@@ -470,7 +470,7 @@ class WP_User {
|
||||
* @param int $blog_id Optional Blog ID, defaults to current blog.
|
||||
* @return WP_User
|
||||
*/
|
||||
function WP_User( $id, $name = '', $blog_id = '' ) {
|
||||
function __construct( $id, $name = '', $blog_id = '' ) {
|
||||
|
||||
if ( empty( $id ) && empty( $name ) )
|
||||
return;
|
||||
|
||||
@@ -4,15 +4,6 @@ if ( !class_exists('SimplePie') )
|
||||
require_once (ABSPATH . WPINC . '/class-simplepie.php');
|
||||
|
||||
class WP_Feed_Cache extends SimplePie_Cache {
|
||||
/**
|
||||
* Don't call the constructor. Please.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function WP_Feed_Cache() {
|
||||
trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new SimplePie_Cache object
|
||||
*
|
||||
@@ -29,7 +20,7 @@ class WP_Feed_Cache_Transient {
|
||||
var $mod_name;
|
||||
var $lifetime = 43200; //Default lifetime in cache of 12 hours
|
||||
|
||||
function WP_Feed_Cache_Transient($location, $filename, $extension) {
|
||||
function __construct($location, $filename, $extension) {
|
||||
$this->name = 'feed_' . $filename;
|
||||
$this->mod_name = 'feed_mod_' . $filename;
|
||||
$this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename);
|
||||
@@ -65,7 +56,7 @@ class WP_Feed_Cache_Transient {
|
||||
|
||||
class WP_SimplePie_File extends SimplePie_File {
|
||||
|
||||
function WP_SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
|
||||
function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
|
||||
$this->url = $url;
|
||||
$this->timeout = $timeout;
|
||||
$this->redirects = $redirects;
|
||||
|
||||
@@ -1408,17 +1408,6 @@ class WP_Http_Cookie {
|
||||
*/
|
||||
var $domain;
|
||||
|
||||
/**
|
||||
* PHP4 style Constructor - Calls PHP5 Style Constructor.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.8.0
|
||||
* @param string|array $data Raw cookie data.
|
||||
*/
|
||||
function WP_Http_Cookie( $data ) {
|
||||
$this->__construct( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up this cookie object.
|
||||
*
|
||||
|
||||
@@ -16,7 +16,7 @@ class WP_Ajax_Response {
|
||||
var $responses = array();
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}.
|
||||
* Constructor - Passes args to {@link WP_Ajax_Response::add()}.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @see WP_Ajax_Response::add()
|
||||
@@ -24,7 +24,7 @@ class WP_Ajax_Response {
|
||||
* @param string|array $args Optional. Will be passed to add() method.
|
||||
* @return WP_Ajax_Response
|
||||
*/
|
||||
function WP_Ajax_Response( $args = '' ) {
|
||||
function __construct( $args = '' ) {
|
||||
if ( !empty($args) )
|
||||
$this->add($args);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class WP_Error {
|
||||
var $error_data = array();
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Sets up error message.
|
||||
* Constructor - Sets up error message.
|
||||
*
|
||||
* If code parameter is empty then nothing will be done. It is possible to
|
||||
* add multiple messages to the same code, but with other methods in the
|
||||
@@ -54,7 +54,7 @@ class WP_Error {
|
||||
* @param mixed $data Optional. Error data.
|
||||
* @return WP_Error
|
||||
*/
|
||||
function WP_Error($code = '', $message = '', $data = '') {
|
||||
function __construct($code = '', $message = '', $data = '') {
|
||||
if ( empty($code) )
|
||||
return;
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
*
|
||||
*/
|
||||
class WP_HTTP_IXR_Client extends IXR_Client {
|
||||
function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15) {
|
||||
|
||||
function __construct($server, $path = false, $port = 80, $timeout = 15) {
|
||||
if ( ! $path ) {
|
||||
// Assume we have been given a URL instead
|
||||
$bits = parse_url($server);
|
||||
|
||||
@@ -24,7 +24,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
/**
|
||||
* Register all of the XMLRPC methods that XMLRPC server understands.
|
||||
*
|
||||
* PHP4 constructor and sets up server and method property. Passes XMLRPC
|
||||
* Sets up server and method property. Passes XMLRPC
|
||||
* methods through the 'xmlrpc_methods' filter to allow plugins to extend
|
||||
* or replace XMLRPC methods.
|
||||
*
|
||||
@@ -32,7 +32,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
*
|
||||
* @return wp_xmlrpc_server
|
||||
*/
|
||||
function wp_xmlrpc_server() {
|
||||
function __construct() {
|
||||
$this->methods = array(
|
||||
// WordPress API
|
||||
'wp.getUsersBlogs' => 'this:wp_getUsersBlogs',
|
||||
|
||||
@@ -504,18 +504,6 @@ class WP {
|
||||
do_action_ref_array('wp', array(&$this));
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Does nothing.
|
||||
*
|
||||
* Call main() method when ready to run setup.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @return WP
|
||||
*/
|
||||
function WP() {
|
||||
// Empty.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -221,7 +221,7 @@ class _WP_Dependency {
|
||||
|
||||
var $extra = array();
|
||||
|
||||
function _WP_Dependency() {
|
||||
function __construct() {
|
||||
@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
|
||||
if ( !is_array($this->deps) )
|
||||
$this->deps = array();
|
||||
|
||||
@@ -314,7 +314,7 @@ class WP_Locale {
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 style constructor which calls helper methods to set up object variables
|
||||
* Constructor which calls helper methods to set up object variables
|
||||
*
|
||||
* @uses WP_Locale::init()
|
||||
* @uses WP_Locale::register_globals()
|
||||
@@ -322,7 +322,7 @@ class WP_Locale {
|
||||
*
|
||||
* @return WP_Locale
|
||||
*/
|
||||
function WP_Locale() {
|
||||
function __construct() {
|
||||
$this->init();
|
||||
$this->register_globals();
|
||||
}
|
||||
|
||||
@@ -2970,7 +2970,7 @@ class WP_Query {
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 type constructor.
|
||||
* Constructor.
|
||||
*
|
||||
* Sets up the WordPress query, if parameter is not empty.
|
||||
*
|
||||
@@ -2980,7 +2980,7 @@ class WP_Query {
|
||||
* @param string $query URL query string.
|
||||
* @return WP_Query
|
||||
*/
|
||||
function WP_Query($query = '') {
|
||||
function __construct($query = '') {
|
||||
if ( ! empty($query) ) {
|
||||
$this->query($query);
|
||||
}
|
||||
|
||||
@@ -1976,14 +1976,14 @@ class WP_Rewrite {
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Calls init(), which runs setup.
|
||||
* Constructor - Calls init(), which runs setup.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @access public
|
||||
*
|
||||
* @return WP_Rewrite
|
||||
*/
|
||||
function WP_Rewrite() {
|
||||
function __construct() {
|
||||
$this->init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,12 +361,6 @@ class WP_User_Query {
|
||||
var $query_orderby;
|
||||
var $query_limit;
|
||||
|
||||
/**
|
||||
* PHP4 constructor
|
||||
*/
|
||||
function WP_User_Query( $query = null ) {
|
||||
$this->__construct( $query );
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5 constructor
|
||||
|
||||
@@ -60,7 +60,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
var $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline';
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Call parent constructor with params array.
|
||||
* Constructor - Call parent constructor with params array.
|
||||
*
|
||||
* This will set class properties based on the key value pairs in the array.
|
||||
*
|
||||
@@ -68,7 +68,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
function Text_Diff_Renderer_Table( $params = array() ) {
|
||||
function __construct( $params = array() ) {
|
||||
$parent = get_parent_class($this);
|
||||
$this->$parent( $params );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user