mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +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:
@@ -43,14 +43,14 @@ class Custom_Background {
|
||||
var $page = '';
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Register administration header callback.
|
||||
* Constructor - Register administration header callback.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param callback $admin_header_callback
|
||||
* @param callback $admin_image_div_callback Optional custom image div output callback.
|
||||
* @return Custom_Background
|
||||
*/
|
||||
function Custom_Background($admin_header_callback = '', $admin_image_div_callback = '') {
|
||||
function __construct($admin_header_callback = '', $admin_image_div_callback = '') {
|
||||
$this->admin_header_callback = $admin_header_callback;
|
||||
$this->admin_image_div_callback = $admin_image_div_callback;
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ class Custom_Image_Header {
|
||||
var $page = '';
|
||||
|
||||
/**
|
||||
* PHP4 Constructor - Register administration header callback.
|
||||
* Constructor - Register administration header callback.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @param callback $admin_header_callback
|
||||
* @param callback $admin_image_div_callback Optional custom image div output callback.
|
||||
* @return Custom_Image_Header
|
||||
*/
|
||||
function Custom_Image_Header($admin_header_callback, $admin_image_div_callback = '') {
|
||||
function __construct($admin_header_callback, $admin_image_div_callback = '') {
|
||||
$this->admin_header_callback = $admin_header_callback;
|
||||
$this->admin_image_div_callback = $admin_image_div_callback;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
var $pending_count = array();
|
||||
|
||||
function WP_Comments_List_Table() {
|
||||
function __construct() {
|
||||
global $post_id;
|
||||
|
||||
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
||||
@@ -29,7 +29,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'comments',
|
||||
'singular' => 'comment',
|
||||
'ajax' => true,
|
||||
|
||||
@@ -21,7 +21,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
*
|
||||
* @param mixed $arg ingored argument
|
||||
*/
|
||||
function WP_Filesystem_Direct($arg) {
|
||||
function __construct($arg) {
|
||||
$this->method = 'direct';
|
||||
$this->errors = new WP_Error();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
var $errors = null;
|
||||
var $options = array();
|
||||
|
||||
function WP_Filesystem_FTPext($opt='') {
|
||||
function __construct($opt='') {
|
||||
$this->method = 'ftpext';
|
||||
$this->errors = new WP_Error();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
var $errors = null;
|
||||
var $options = array();
|
||||
|
||||
function WP_Filesystem_ftpsockets($opt = '') {
|
||||
function __construct($opt = '') {
|
||||
$this->method = 'ftpsockets';
|
||||
$this->errors = new WP_Error();
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
var $errors = array();
|
||||
var $options = array();
|
||||
|
||||
function WP_Filesystem_SSH2($opt='') {
|
||||
function __construct($opt='') {
|
||||
$this->method = 'ssh2';
|
||||
$this->errors = new WP_Error();
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ class WP_Importer {
|
||||
*/
|
||||
function __construct() {}
|
||||
|
||||
function WP_Importer() {
|
||||
$this->__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array with imported permalinks from WordPress database
|
||||
*
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
class WP_Links_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Links_List_Table() {
|
||||
parent::WP_List_Table( array(
|
||||
function __construct() {
|
||||
parent::__construct( array(
|
||||
'plural' => 'bookmarks',
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class WP_List_Table {
|
||||
* @param array $args An associative array with information about the current table
|
||||
* @access protected
|
||||
*/
|
||||
function WP_List_Table( $args = array() ) {
|
||||
function __construct( $args = array() ) {
|
||||
$args = wp_parse_args( $args, array(
|
||||
'plural' => '',
|
||||
'singular' => '',
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
*/
|
||||
class WP_Media_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Media_List_Table() {
|
||||
function __construct() {
|
||||
$this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'media'
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
class WP_MS_Sites_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_MS_Sites_List_Table() {
|
||||
parent::WP_List_Table( array(
|
||||
function __construct() {
|
||||
parent::__construct( array(
|
||||
'plural' => 'sites',
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
||||
var $site_id;
|
||||
var $is_site_themes;
|
||||
|
||||
function WP_MS_Themes_List_Table() {
|
||||
function __construct() {
|
||||
global $status, $page;
|
||||
|
||||
$default_status = get_user_option( 'themes_last_view' );
|
||||
@@ -32,7 +32,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
||||
if ( $this->is_site_themes )
|
||||
$this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'themes'
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Plugins_List_Table() {
|
||||
function __construct() {
|
||||
global $status, $page;
|
||||
|
||||
$default_status = get_user_option( 'plugins_last_view' );
|
||||
@@ -23,7 +23,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
$page = $this->get_pagenum();
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'plugins',
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
*/
|
||||
var $sticky_posts_count = 0;
|
||||
|
||||
function WP_Posts_List_Table() {
|
||||
function __construct() {
|
||||
global $post_type_object, $post_type, $wpdb;
|
||||
|
||||
if ( !isset( $_REQUEST['post_type'] ) )
|
||||
@@ -74,7 +74,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
$this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status != 'trash' AND ID IN ($sticky_posts)", $post_type ) );
|
||||
}
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'posts',
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
|
||||
var $callback_args;
|
||||
|
||||
function WP_Terms_List_Table() {
|
||||
function __construct() {
|
||||
global $post_type, $taxonomy, $tax;
|
||||
|
||||
wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) );
|
||||
@@ -27,7 +27,7 @@ class WP_Terms_List_Table extends WP_List_Table {
|
||||
if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) )
|
||||
$post_type = 'post';
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'plural' => 'tags',
|
||||
'singular' => 'tag',
|
||||
) );
|
||||
|
||||
@@ -25,9 +25,6 @@ class WP_Upgrader {
|
||||
var $skin = null;
|
||||
var $result = array();
|
||||
|
||||
function WP_Upgrader($skin = null) {
|
||||
return $this->__construct($skin);
|
||||
}
|
||||
function __construct($skin = null) {
|
||||
if ( null == $skin )
|
||||
$this->skin = new WP_Upgrader_Skin();
|
||||
@@ -925,9 +922,6 @@ class WP_Upgrader_Skin {
|
||||
var $done_header = false;
|
||||
var $result = false;
|
||||
|
||||
function WP_Upgrader_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'url' => '', 'nonce' => '', 'title' => '', 'context' => false );
|
||||
$this->options = wp_parse_args($args, $defaults);
|
||||
@@ -1014,10 +1008,6 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
var $plugin_active = false;
|
||||
var $plugin_network_active = false;
|
||||
|
||||
function Plugin_Upgrader_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
@@ -1070,10 +1060,6 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
var $in_loop = false;
|
||||
var $error = false;
|
||||
|
||||
function Bulk_Upgrader_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'url' => '', 'nonce' => '' );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
@@ -1178,7 +1164,8 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
|
||||
class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
|
||||
var $plugin_info = array(); // Plugin_Upgrader::bulk() will fill this in.
|
||||
function Plugin_Upgrader_Skin($args = array()) {
|
||||
|
||||
function __construct($args = array()) {
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
@@ -1209,7 +1196,8 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
|
||||
|
||||
class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
|
||||
var $theme_info = array(); // Theme_Upgrader::bulk() will fill this in.
|
||||
function Theme_Upgrader_Skin($args = array()) {
|
||||
|
||||
function __construct($args = array()) {
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
@@ -1251,10 +1239,6 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
||||
var $api;
|
||||
var $type;
|
||||
|
||||
function Plugin_Installer_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
@@ -1319,10 +1303,6 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
var $api;
|
||||
var $type;
|
||||
|
||||
function Theme_Installer_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'type' => 'web', 'url' => '', 'theme' => '', 'nonce' => '', 'title' => '' );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
@@ -1385,10 +1365,6 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
var $theme = '';
|
||||
|
||||
function Theme_Upgrader_Skin($args = array()) {
|
||||
return $this->__construct($args);
|
||||
}
|
||||
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Update Theme') );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
@@ -1440,9 +1416,6 @@ class File_Upload_Upgrader {
|
||||
var $package;
|
||||
var $filename;
|
||||
|
||||
function File_Upload_Upgrader($form, $urlholder) {
|
||||
return $this->__construct($form, $urlholder);
|
||||
}
|
||||
function __construct($form, $urlholder) {
|
||||
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
|
||||
wp_die($uploads['error']);
|
||||
|
||||
@@ -12,14 +12,14 @@ class WP_Users_List_Table extends WP_List_Table {
|
||||
var $site_id;
|
||||
var $is_site_users;
|
||||
|
||||
function WP_Users_List_Table() {
|
||||
function __construct() {
|
||||
$screen = get_current_screen();
|
||||
$this->is_site_users = 'site-users-network' == $screen->id;
|
||||
|
||||
if ( $this->is_site_users )
|
||||
$this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
parent::__construct( array(
|
||||
'singular' => 'user',
|
||||
'plural' => 'users'
|
||||
) );
|
||||
|
||||
Reference in New Issue
Block a user