WP_User::has_prop() WordPress Method

The WP_User::has_prop() method is used to check if a user has a certain property. This is useful for checking if a user has a certain capability or role.

WP_User::has_prop( string $key ) #

Determines whether a property or meta key is set.


Description

Consults the users and usermeta tables.


Top ↑

Parameters

$key

(string)(Required)Property.


Top ↑

Return

(bool)


Top ↑

Source

File: wp-includes/class-wp-user.php

	public function has_prop( $key ) {
		return $this->__isset( $key );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.