WordPress.org

Plugin Directory

Changeset 632358 for role-scoper


Ignore:
Timestamp:
11/30/12 19:12:40 (17 months ago)
Author:
kevinB
Message:
  • Compat : WP 3.5 - Custom posts could not be created or edited when post type enabled for RS filtering
Location:
role-scoper/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • role-scoper/trunk/readme.txt

    r623294 r632358  
    114114 
    115115= 1.3.58-dev = 
     116* Compat : WP 3.5 - Custom posts could not be created or edited when post type enabled for RS filtering  
    116117* Fixed : Posts were unreadable if associated with a taxonomy which has no terms, under some configurations 
    117118* Fixed : RS Roles assigned to [Anonymous] group were ineffective 
  • role-scoper/trunk/wp-cap-helper_cr.php

    r502498 r632358  
    119119            $generic_caps[$post_type] = (array) $wp_post_types[$post_type]->cap; 
    120120 
     121        $skip_caps = array( 'read_post', 'edit_post', 'delete_post' ); 
     122             
     123        if ( ! isset($generic_caps['post']->create_posts) || ! isset($generic_caps['post']['edit_posts']) || ( $generic_caps['post']['create_posts'] == $generic_caps['post']['edit_posts'] ) ) 
     124            $skip_caps []= 'create_posts'; 
     125 
    121126        foreach( array_keys($wp_post_types) as $post_type ) { 
    122127            if ( empty( $use_post_types[$post_type] ) ) 
    123128                continue; 
    124                  
     129 
    125130            if ( 'post' === $wp_post_types[$post_type]->capability_type ) 
    126131                $wp_post_types[$post_type]->capability_type = $post_type; 
     
    132137            // don't allow any capability defined for this type to match any capability defined for post or page (unless this IS post or page type) 
    133138            foreach( $type_caps as $cap_property => $type_cap ) { 
    134                 if ( in_array( $cap_property, array( 'read_post', 'edit_post', 'delete_post' ) ) ) { 
     139                if ( in_array( $cap_property, $skip_caps ) ) { 
    135140                    continue; 
    136141                } 
Note: See TracChangeset for help on using the changeset viewer.