Mark user levels as Deprecated. Fixes #10805 props nacin.
git-svn-id: https://develop.svn.wordpress.org/trunk@12585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a752e6b561
commit
12cc58c227
|
@ -712,8 +712,10 @@ class WP_User {
|
||||||
* @return bool True, if user has capability; false, if user does not have capability.
|
* @return bool True, if user has capability; false, if user does not have capability.
|
||||||
*/
|
*/
|
||||||
function has_cap( $cap ) {
|
function has_cap( $cap ) {
|
||||||
if ( is_numeric( $cap ) )
|
if ( is_numeric( $cap ) ) {
|
||||||
|
_deprecated_argument( __FUNCTION__, '2.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') );
|
||||||
$cap = $this->translate_level_to_cap( $cap );
|
$cap = $this->translate_level_to_cap( $cap );
|
||||||
|
}
|
||||||
|
|
||||||
$args = array_slice( func_get_args(), 1 );
|
$args = array_slice( func_get_args(), 1 );
|
||||||
$args = array_merge( array( $cap, $this->ID ), $args );
|
$args = array_merge( array( $cap, $this->ID ), $args );
|
||||||
|
|
Loading…
Reference in New Issue