Changeset 1025816
- Timestamp:
- 11/14/2014 03:39:23 PM (11 years ago)
- Location:
- admin-users-advances-permissions/trunk
- Files:
-
- 5 edited
-
admin-users-advanced-permissions.php (modified) (1 diff)
-
inc/admin-restrict-cat-tax.php (modified) (1 diff)
-
inc/admin-users.php (modified) (1 diff)
-
js/admin-users.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
admin-users-advances-permissions/trunk/admin-users-advanced-permissions.php
r1025697 r1025816 4 4 Plugin URI: https://wordpress.org/plugins/admin-users-advances-permissions/ 5 5 Description: Set up permissions for categories and taxonomies to admin users whose role is not "administrator" 6 Version: 1.0 16 Version: 1.02 7 7 Author: Mathieu Thollet 8 8 Author URI: http://www.awebvision.fr -
admin-users-advances-permissions/trunk/inc/admin-restrict-cat-tax.php
r1025631 r1025816 7 7 function auap_admin_pre_get_posts($query){ 8 8 if (is_admin() && !current_user_can("administrator")) { 9 $post_type = $query->query["post_type"]; 9 10 $tax_query = array(); 10 11 foreach (auap_get_taxonomies() as $taxonomy) { 11 if (count(get_terms($taxonomy, array("hide_empty" => false))) > 0) { 12 $access_tax = json_decode(get_user_meta(get_current_user_id(), "auap_".$taxonomy, true)); 13 if (is_array($access_tax)) { 14 $tax_query[] = array( 15 'taxonomy' => $taxonomy, 16 'field' => 'id', 17 'terms' => $access_tax 18 ); 12 if (in_array($post_type, get_taxonomy($taxonomy)->object_type)) { 13 if (count(get_terms($taxonomy, array("hide_empty" => false))) > 0) { 14 $access_tax = json_decode(get_user_meta(get_current_user_id(), "auap_".$taxonomy, true)); 15 if (!is_array($access_tax)) 16 $access_tax = array(); 17 if (is_array($access_tax)) { 18 $tax_query[] = array( 19 'taxonomy' => $taxonomy, 20 'field' => 'id', 21 'terms' => $access_tax 22 ); 23 } 19 24 } 20 25 } -
admin-users-advances-permissions/trunk/inc/admin-users.php
r1025672 r1025816 63 63 <?php if ($term_id=="0") {?> 64 64 <p> 65 <a class="check-all" rel="<?php echo $input_name;?>" ><?php _e("Check all", AUAP_I18N_DOMAIN);?></a>65 <a class="check-all" rel="<?php echo $input_name;?>" href="#"><?php _e("Check all", AUAP_I18N_DOMAIN);?></a> 66 66 </p> 67 67 <?php } ?> -
admin-users-advances-permissions/trunk/js/admin-users.js
r1025631 r1025816 13 13 jQuery(this).html(auap_check_all_label); 14 14 } 15 return false; 16 }); 17 jQuery('.check-all').each(function() { 18 var rel = jQuery(this).attr("rel"); 19 if (jQuery("input[type='checkbox'][rel='" + rel + "']").length == jQuery("input[type='checkbox'][rel='" + rel + "']:checked").length) 20 jQuery(this).trigger("click"); 15 21 }); 16 22 }); -
admin-users-advances-permissions/trunk/readme.txt
r1025697 r1025816 28 28 == Changelog == 29 29 30 = 1.02 = 31 * Minor improvements and bug corrections 32 30 33 = 1.01 = 31 34 * Minor improvements and bug corrections
Note: See TracChangeset
for help on using the changeset viewer.