WordPress.org

Make WordPress Core

Changeset 17771


Ignore:
Timestamp:
04/29/11 20:05:12 (4 years ago)
Author:
ryan
Message:

Constructor cleanup. Props ocean90. fixes #16768

Location:
trunk
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-background.php

    r17748 r17771  
    4444 
    4545    /** 
    46      * PHP4 Constructor - Register administration header callback. 
     46     * Constructor - Register administration header callback. 
    4747     * 
    4848     * @since 3.0.0 
     
    5151     * @return Custom_Background 
    5252     */ 
    53     function Custom_Background($admin_header_callback = '', $admin_image_div_callback = '') { 
     53    function __construct($admin_header_callback = '', $admin_image_div_callback = '') { 
    5454        $this->admin_header_callback = $admin_header_callback; 
    5555        $this->admin_image_div_callback = $admin_image_div_callback; 
  • trunk/wp-admin/custom-header.php

    r17770 r17771  
    6363 
    6464    /** 
    65      * PHP4 Constructor - Register administration header callback. 
     65     * Constructor - Register administration header callback. 
    6666     * 
    6767     * @since 2.1.0 
     
    7070     * @return Custom_Image_Header 
    7171     */ 
    72     function Custom_Image_Header($admin_header_callback, $admin_image_div_callback = '') { 
     72    function __construct($admin_header_callback, $admin_image_div_callback = '') { 
    7373        $this->admin_header_callback = $admin_header_callback; 
    7474        $this->admin_image_div_callback = $admin_image_div_callback; 
  • trunk/wp-admin/includes/class-wp-comments-list-table.php

    r17383 r17771  
    2222    var $pending_count = array(); 
    2323 
    24     function WP_Comments_List_Table() { 
     24    function __construct() { 
    2525        global $post_id; 
    2626 
     
    3030            add_filter( 'comment_author', 'floated_admin_avatar' ); 
    3131 
    32         parent::WP_List_Table( array( 
     32        parent::__construct( array( 
    3333            'plural' => 'comments', 
    3434            'singular' => 'comment', 
  • trunk/wp-admin/includes/class-wp-filesystem-direct.php

    r17525 r17771  
    2222     * @param mixed $arg ingored argument 
    2323     */ 
    24     function WP_Filesystem_Direct($arg) { 
     24    function __construct($arg) { 
    2525        $this->method = 'direct'; 
    2626        $this->errors = new WP_Error(); 
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r17525 r17771  
    2020    var $options = array(); 
    2121 
    22     function WP_Filesystem_FTPext($opt='') { 
     22    function __construct($opt='') { 
    2323        $this->method = 'ftpext'; 
    2424        $this->errors = new WP_Error(); 
  • trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r17525 r17771  
    2020    var $options = array(); 
    2121 
    22     function WP_Filesystem_ftpsockets($opt = '') { 
     22    function __construct($opt = '') { 
    2323        $this->method = 'ftpsockets'; 
    2424        $this->errors = new WP_Error(); 
  • trunk/wp-admin/includes/class-wp-filesystem-ssh2.php

    r17525 r17771  
    4949    var $options = array(); 
    5050 
    51     function WP_Filesystem_SSH2($opt='') { 
     51    function __construct($opt='') { 
    5252        $this->method = 'ssh2'; 
    5353        $this->errors = new WP_Error(); 
  • trunk/wp-admin/includes/class-wp-importer.php

    r15315 r17771  
    1010     */ 
    1111    function __construct() {} 
    12  
    13     function WP_Importer() { 
    14         $this->__construct(); 
    15     } 
    1612 
    1713    /** 
  • trunk/wp-admin/includes/class-wp-links-list-table.php

    r17349 r17771  
    1010class WP_Links_List_Table extends WP_List_Table { 
    1111 
    12     function WP_Links_List_Table() { 
    13         parent::WP_List_Table( array( 
     12    function __construct() { 
     13        parent::__construct( array( 
    1414            'plural' => 'bookmarks', 
    1515        ) ); 
  • trunk/wp-admin/includes/class-wp-list-table.php

    r17481 r17771  
    7878     * @access protected 
    7979     */ 
    80     function WP_List_Table( $args = array() ) { 
     80    function __construct( $args = array() ) { 
    8181        $args = wp_parse_args( $args, array( 
    8282            'plural' => '', 
  • trunk/wp-admin/includes/class-wp-media-list-table.php

    r17349 r17771  
    1010class WP_Media_List_Table extends WP_List_Table { 
    1111 
    12     function WP_Media_List_Table() { 
     12    function __construct() { 
    1313        $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] ); 
    1414 
    15         parent::WP_List_Table( array( 
     15        parent::__construct( array( 
    1616            'plural' => 'media' 
    1717        ) ); 
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r17496 r17771  
    1010class WP_MS_Sites_List_Table extends WP_List_Table { 
    1111 
    12     function WP_MS_Sites_List_Table() { 
    13         parent::WP_List_Table( array( 
     12    function __construct() { 
     13        parent::__construct( array( 
    1414            'plural' => 'sites', 
    1515        ) ); 
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r17449 r17771  
    1313    var $is_site_themes; 
    1414 
    15     function WP_MS_Themes_List_Table() { 
     15    function __construct() { 
    1616        global $status, $page; 
    1717 
     
    3333            $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; 
    3434 
    35         parent::WP_List_Table( array( 
     35        parent::__construct( array( 
    3636            'plural' => 'themes' 
    3737        ) ); 
  • trunk/wp-admin/includes/class-wp-plugins-list-table.php

    r17449 r17771  
    1010class WP_Plugins_List_Table extends WP_List_Table { 
    1111 
    12     function WP_Plugins_List_Table() { 
     12    function __construct() { 
    1313        global $status, $page; 
    1414 
     
    2424        $page = $this->get_pagenum(); 
    2525 
    26         parent::WP_List_Table( array( 
     26        parent::__construct( array( 
    2727            'plural' => 'plugins', 
    2828        ) ); 
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r17684 r17771  
    4646    var $sticky_posts_count = 0; 
    4747 
    48     function WP_Posts_List_Table() { 
     48    function __construct() { 
    4949        global $post_type_object, $post_type, $wpdb; 
    5050 
     
    7575        } 
    7676 
    77         parent::WP_List_Table( array( 
     77        parent::__construct( array( 
    7878            'plural' => 'posts', 
    7979        ) ); 
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r17342 r17771  
    1212    var $callback_args; 
    1313 
    14     function WP_Terms_List_Table() { 
     14    function __construct() { 
    1515        global $post_type, $taxonomy, $tax; 
    1616 
     
    2828            $post_type = 'post'; 
    2929 
    30         parent::WP_List_Table( array( 
     30        parent::__construct( array( 
    3131            'plural' => 'tags', 
    3232            'singular' => 'tag', 
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r17660 r17771  
    2626    var $result = array(); 
    2727 
    28     function WP_Upgrader($skin = null) { 
    29         return $this->__construct($skin); 
    30     } 
    3128    function __construct($skin = null) { 
    3229        if ( null == $skin ) 
     
    926923    var $result = false; 
    927924 
    928     function WP_Upgrader_Skin($args = array()) { 
    929         return $this->__construct($args); 
    930     } 
    931925    function __construct($args = array()) { 
    932926        $defaults = array( 'url' => '', 'nonce' => '', 'title' => '', 'context' => false ); 
     
    10151009    var $plugin_network_active = false; 
    10161010 
    1017     function Plugin_Upgrader_Skin($args = array()) { 
    1018         return $this->__construct($args); 
    1019     } 
    1020  
    10211011    function __construct($args = array()) { 
    10221012        $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') ); 
     
    10711061    var $error = false; 
    10721062 
    1073     function Bulk_Upgrader_Skin($args = array()) { 
    1074         return $this->__construct($args); 
    1075     } 
    1076  
    10771063    function __construct($args = array()) { 
    10781064        $defaults = array( 'url' => '', 'nonce' => '' ); 
     
    11791165class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin { 
    11801166    var $plugin_info = array(); // Plugin_Upgrader::bulk() will fill this in. 
    1181     function Plugin_Upgrader_Skin($args = array()) { 
     1167 
     1168    function __construct($args = array()) { 
    11821169        parent::__construct($args); 
    11831170    } 
     
    12101197class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin { 
    12111198    var $theme_info = array(); // Theme_Upgrader::bulk() will fill this in. 
    1212     function Theme_Upgrader_Skin($args = array()) { 
     1199 
     1200    function __construct($args = array()) { 
    12131201        parent::__construct($args); 
    12141202    } 
     
    12521240    var $type; 
    12531241 
    1254     function Plugin_Installer_Skin($args = array()) { 
    1255         return $this->__construct($args); 
    1256     } 
    1257  
    12581242    function __construct($args = array()) { 
    12591243        $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' ); 
     
    13201304    var $type; 
    13211305 
    1322     function Theme_Installer_Skin($args = array()) { 
    1323         return $this->__construct($args); 
    1324     } 
    1325  
    13261306    function __construct($args = array()) { 
    13271307        $defaults = array( 'type' => 'web', 'url' => '', 'theme' => '', 'nonce' => '', 'title' => '' ); 
     
    13851365class Theme_Upgrader_Skin extends WP_Upgrader_Skin { 
    13861366    var $theme = ''; 
    1387  
    1388     function Theme_Upgrader_Skin($args = array()) { 
    1389         return $this->__construct($args); 
    1390     } 
    13911367 
    13921368    function __construct($args = array()) { 
     
    14411417    var $filename; 
    14421418 
    1443     function File_Upload_Upgrader($form, $urlholder) { 
    1444         return $this->__construct($form, $urlholder); 
    1445     } 
    14461419    function __construct($form, $urlholder) { 
    14471420        if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) 
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r17439 r17771  
    1313    var $is_site_users; 
    1414 
    15     function WP_Users_List_Table() { 
     15    function __construct() { 
    1616        $screen = get_current_screen(); 
    1717        $this->is_site_users = 'site-users-network' == $screen->id; 
     
    2020            $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; 
    2121 
    22         parent::WP_List_Table( array( 
     22        parent::__construct( array( 
    2323            'singular' => 'user', 
    2424            'plural'   => 'users' 
  • trunk/wp-app.php

    r16699 r17771  
    217217 
    218218    /** 
    219      * PHP4 constructor - Sets up object properties. 
     219     * Constructor - Sets up object properties. 
    220220     * 
    221221     * @since 2.2.0 
    222222     * @return AtomServer 
    223223     */ 
    224     function AtomServer() { 
     224    function __construct() { 
    225225 
    226226        $this->script_name = array_pop( $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ) ); 
  • trunk/wp-includes/capabilities.php

    r17604 r17771  
    457457 
    458458    /** 
    459      * PHP4 Constructor - Sets up the object properties. 
     459     * Constructor - Sets up the object properties. 
    460460     * 
    461461     * Retrieves the userdata and then assigns all of the data keys to direct 
     
    471471     * @return WP_User 
    472472     */ 
    473     function WP_User( $id, $name = '', $blog_id = '' ) { 
     473    function __construct( $id, $name = '', $blog_id = '' ) { 
    474474 
    475475        if ( empty( $id ) && empty( $name ) ) 
  • trunk/wp-includes/class-feed.php

    r11787 r17771  
    55 
    66class WP_Feed_Cache extends SimplePie_Cache { 
    7     /** 
    8      * Don't call the constructor. Please. 
    9      * 
    10      * @access private 
    11      */ 
    12     function WP_Feed_Cache() { 
    13         trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR); 
    14     } 
    15  
    167    /** 
    178     * Create a new SimplePie_Cache object 
     
    3021    var $lifetime = 43200; //Default lifetime in cache of 12 hours 
    3122 
    32     function WP_Feed_Cache_Transient($location, $filename, $extension) { 
     23    function __construct($location, $filename, $extension) { 
    3324        $this->name = 'feed_' . $filename; 
    3425        $this->mod_name = 'feed_mod_' . $filename; 
     
    6657class WP_SimplePie_File extends SimplePie_File { 
    6758 
    68     function WP_SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { 
     59    function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { 
    6960        $this->url = $url; 
    7061        $this->timeout = $timeout; 
  • trunk/wp-includes/class-http.php

    r17692 r17771  
    14081408     */ 
    14091409    var $domain; 
    1410  
    1411     /** 
    1412      * PHP4 style Constructor - Calls PHP5 Style Constructor. 
    1413      * 
    1414      * @access public 
    1415      * @since 2.8.0 
    1416      * @param string|array $data Raw cookie data. 
    1417      */ 
    1418     function WP_Http_Cookie( $data ) { 
    1419         $this->__construct( $data ); 
    1420     } 
    14211410 
    14221411    /** 
  • trunk/wp-includes/class-wp-ajax-response.php

    r16101 r17771  
    1717 
    1818    /** 
    19      * PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}. 
     19     * Constructor - Passes args to {@link WP_Ajax_Response::add()}. 
    2020     * 
    2121     * @since 2.1.0 
     
    2525     * @return WP_Ajax_Response 
    2626     */ 
    27     function WP_Ajax_Response( $args = '' ) { 
     27    function __construct( $args = '' ) { 
    2828        if ( !empty($args) ) 
    2929            $this->add($args); 
  • trunk/wp-includes/class-wp-error.php

    r16101 r17771  
    3939 
    4040    /** 
    41      * PHP4 Constructor - Sets up error message. 
     41     * Constructor - Sets up error message. 
    4242     * 
    4343     * If code parameter is empty then nothing will be done. It is possible to 
     
    5555     * @return WP_Error 
    5656     */ 
    57     function WP_Error($code = '', $message = '', $data = '') { 
     57    function __construct($code = '', $message = '', $data = '') { 
    5858        if ( empty($code) ) 
    5959            return; 
  • trunk/wp-includes/class-wp-http-ixr-client.php

    r16871 r17771  
    88 */ 
    99class WP_HTTP_IXR_Client extends IXR_Client { 
    10     function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15) { 
     10 
     11    function __construct($server, $path = false, $port = 80, $timeout = 15) { 
    1112        if ( ! $path ) { 
    1213            // Assume we have been given a URL instead 
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r17663 r17771  
    2525     * Register all of the XMLRPC methods that XMLRPC server understands. 
    2626     * 
    27      * PHP4 constructor and sets up server and method property. Passes XMLRPC 
     27     * Sets up server and method property. Passes XMLRPC 
    2828     * methods through the 'xmlrpc_methods' filter to allow plugins to extend 
    2929     * or replace XMLRPC methods. 
     
    3333     * @return wp_xmlrpc_server 
    3434     */ 
    35     function wp_xmlrpc_server() { 
     35    function __construct() { 
    3636        $this->methods = array( 
    3737            // WordPress API 
  • trunk/wp-includes/class-wp.php

    r16526 r17771  
    505505    } 
    506506 
    507     /** 
    508      * PHP4 Constructor - Does nothing. 
    509      * 
    510      * Call main() method when ready to run setup. 
    511      * 
    512      * @since 2.0.0 
    513      * 
    514      * @return WP 
    515      */ 
    516     function WP() { 
    517         // Empty. 
    518     } 
    519507} 
    520508 
  • trunk/wp-includes/class.wp-dependencies.php

    r17604 r17771  
    222222    var $extra = array(); 
    223223 
    224     function _WP_Dependency() { 
     224    function __construct() { 
    225225        @list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args(); 
    226226        if ( !is_array($this->deps) ) 
  • trunk/wp-includes/locale.php

    r14404 r17771  
    315315 
    316316    /** 
    317      * PHP4 style constructor which calls helper methods to set up object variables 
     317     * Constructor which calls helper methods to set up object variables 
    318318     * 
    319319     * @uses WP_Locale::init() 
     
    323323     * @return WP_Locale 
    324324     */ 
    325     function WP_Locale() { 
     325    function __construct() { 
    326326        $this->init(); 
    327327        $this->register_globals(); 
  • trunk/wp-includes/query.php

    r17699 r17771  
    29712971 
    29722972    /** 
    2973      * PHP4 type constructor. 
     2973     * Constructor. 
    29742974     * 
    29752975     * Sets up the WordPress query, if parameter is not empty. 
     
    29812981     * @return WP_Query 
    29822982     */ 
    2983     function WP_Query($query = '') { 
     2983    function __construct($query = '') { 
    29842984        if ( ! empty($query) ) { 
    29852985            $this->query($query); 
  • trunk/wp-includes/rewrite.php

    r17518 r17771  
    19771977 
    19781978    /** 
    1979      * PHP4 Constructor - Calls init(), which runs setup. 
     1979     * Constructor - Calls init(), which runs setup. 
    19801980     * 
    19811981     * @since 1.5.0 
     
    19841984     * @return WP_Rewrite 
    19851985     */ 
    1986     function WP_Rewrite() { 
     1986    function __construct() { 
    19871987        $this->init(); 
    19881988    } 
  • trunk/wp-includes/user.php

    r17748 r17771  
    362362    var $query_limit; 
    363363 
    364     /** 
    365      * PHP4 constructor 
    366      */ 
    367     function WP_User_Query( $query = null ) { 
    368         $this->__construct( $query ); 
    369     } 
    370364 
    371365    /** 
  • trunk/wp-includes/wp-diff.php

    r16660 r17771  
    6161 
    6262    /** 
    63      * PHP4 Constructor - Call parent constructor with params array. 
     63     * Constructor - Call parent constructor with params array. 
    6464     * 
    6565     * This will set class properties based on the key value pairs in the array. 
     
    6969     * @param array $params 
    7070     */ 
    71     function Text_Diff_Renderer_Table( $params = array() ) { 
     71    function __construct( $params = array() ) { 
    7272        $parent = get_parent_class($this); 
    7373        $this->$parent( $params ); 
Note: See TracChangeset for help on using the changeset viewer.