WordPress.org

Make WordPress Core

Changeset 32731


Ignore:
Timestamp:
06/12/2015 05:25:28 PM (6 years ago)
Author:
wonderboymusic
Message:

Add the proper access modifier to _init_caps() in WP_User. Add __call() for BC.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r32650 r32731  
    632632
    633633    /**
     634     * Make private/protected methods readable for backwards compatibility.
     635     *
     636     * @since 4.3.0
     637     * @access public
     638     *
     639     * @param callable $name      Method to call.
     640     * @param array    $arguments Arguments to pass when calling.
     641     * @return mixed|false Return value of the callback, false otherwise.
     642     */
     643    public function __call( $name, $arguments ) {
     644        if ( '_init_caps' === $name ) {
     645            return call_user_func_array( array( $this, $name ), $arguments );
     646        }
     647        return false;
     648    }
     649
     650    /**
    634651     * Magic method for checking the existence of a certain custom field
    635652     *
     
    762779     * @param string $cap_key Optional capability key
    763780     */
    764     function _init_caps( $cap_key = '' ) {
     781    protected function _init_caps( $cap_key = '' ) {
    765782        global $wpdb;
    766783
Note: See TracChangeset for help on using the changeset viewer.