WordPress.org

Plugin Directory

Changeset 570821


Ignore:
Timestamp:
07/11/12 19:09:27 (22 months ago)
Author:
bainternet
Message:

changelog 2.4

Location:
bainternet-posts-creation-limits/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bainternet-posts-creation-limits/trunk/bapl.php

    r535814 r570821  
    44Plugin URI: http://en.bainternet.info/category/plugins 
    55Description: this plugin helps you to limit the number of posts/pages/custom post types each user can create on your site. 
    6 Version: 2.3 
     6Version: 2.4 
    77Author: bainternet 
    88Author URI: http://en.bainternet.info 
     
    249249                if ($rules_BY_roles){ 
    250250                    foreach($rules_BY_roles as $ke => $arr){ 
    251                         if ($arr['post_type'] == $typenow){ 
    252                             $count_posts = get_posts(array('author'=>$current_user->ID,'post_type' => $typenow,'post_status' => $arr['status'],'fields' => 'ids')); 
     251                        if ($arr['post_type'] == $typenow || $arr['post_type'] == 'any'){ 
     252                            $tyn = ($arr['post_type'] == 'any') ? 'any' : $typenow; 
     253                            $count_posts = get_posts(array('author'=>$current_user->ID,'post_type' => $tyn,'post_status' => $arr['status'],'fields' => 'ids')); 
    253254                            $count = count($count_posts); 
    254255                            if($count >= $arr['limit']){ 
     
    264265                if ($rules_BY_id){ 
    265266                    foreach($rules_BY_id as $ke => $arr){ 
    266                         if ($arr['post_type'] == $typenow){ 
    267                             $count_posts = get_posts(array('author'=>$current_user->ID,'post_type' => $typenow,'post_status' => $arr['status'],'fields' => 'ids')); 
     267                        if ($arr['post_type'] == $typenow || $arr['post_type'] == 'any'){ 
     268                            $tyn = ($arr['post_type'] == 'any') ? 'any' : $typenow; 
     269                            $count_posts = get_posts(array('author'=>$current_user->ID,'post_type' => $tyn,'post_status' => $arr['status'],'fields' => 'ids')); 
    268270                            $count = count($count_posts); 
    269271                            if($count >= $arr['limit']){ 
     
    538540                            <label for="ptype"><?php _e('Post Type'); ?></label> 
    539541                            <select name="ptype" id="pt"> 
     542                                <option value="any">Any</option> 
    540543                            <?php 
    541544                                $post_types=get_post_types('','names');  
  • bainternet-posts-creation-limits/trunk/readme.txt

    r535814 r570821  
    44Tags: limits, cpt limits, posts per user, limit pages, limit user, post creating limit, post limit, user post limit 
    55Requires at least: 3.0 
    6 Tested up to: 3.3.2 
    7 Stable tag: 2.3 
     6Tested up to: 3.4.1 
     7Stable tag: 2.4 
    88 
    99this plugin helps you to limit the number of posts/pages/custom post types each user can create on your site. 
     
    119119 
    120120== Changelog == 
     1212.4 Added Any to post type rules. 
     122 
    1211232.3 Fixed HTML message issues. 
    122124Added `bapl_limited_message_Filter` filter hook for message. 
Note: See TracChangeset for help on using the changeset viewer.