var $use_db = true;
/**
- * PHP4 Constructor - Call {@link WP_Roles::_init()} method.
+ * Constructor
*
* @since 2.0.0
- * @access public
- *
- * @return WP_Roles
*/
- function WP_Roles() {
+ function __construct() {
$this->_init();
}
var $capabilities;
/**
- * PHP4 Constructor - Set up object properties.
+ * Constructor - Set up object properties.
*
* The list of capabilities, must have the key as the name of the capability
* and the value a boolean of whether it is granted to the role.
*
* @param string $role Role name.
* @param array $capabilities List of capabilities.
- * @return WP_Role
*/
- function WP_Role( $role, $capabilities ) {
+ function __construct( $role, $capabilities ) {
$this->name = $role;
$this->capabilities = $capabilities;
}
var $filter = null;
/**
- * PHP4 Constructor - Sets up the object properties.
+ * Constructor - Sets up the object properties.
*
* Retrieves the userdata and then assigns all of the data keys to direct
* properties of the object. Calls {@link WP_User::_init_caps()} after
* @param int $blog_id Optional Blog ID, defaults to current blog.
* @return WP_User
*/
- function WP_User( $id, $name = '', $blog_id = '' ) {
+ function __construct( $id, $name = '', $blog_id = '' ) {
if ( empty( $id ) && empty( $name ) )
return;
case 'delete_page':
$author_data = get_userdata( $user_id );
$post = get_post( $args[0] );
+
+ if ( 'revision' == $post->post_type ) {
+ $post = get_post( $post->post_parent );
+ }
+
$post_type = get_post_type_object( $post->post_type );
if ( ! $post_type->map_meta_cap ) {
case 'edit_page':
$author_data = get_userdata( $user_id );
$post = get_post( $args[0] );
+
+ if ( 'revision' == $post->post_type ) {
+ $post = get_post( $post->post_parent );
+ }
+
$post_type = get_post_type_object( $post->post_type );
if ( ! $post_type->map_meta_cap ) {
case 'read_page':
$author_data = get_userdata( $user_id );
$post = get_post( $args[0] );
+
+ if ( 'revision' == $post->post_type ) {
+ $post = get_post( $post->post_parent );
+ }
+
$post_type = get_post_type_object( $post->post_type );
if ( ! $post_type->map_meta_cap ) {