Changeset 1145 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 01/15/2015 07:48:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r1115 r1145 109 109 } 110 110 break; 111 112 case 'delete_categories': 113 case 'edit_categories': 114 case 'manage_categories': 115 116 if ( ! is_super_admin() ) { 117 $caps[] = 'do_not_allow'; 118 } 119 break; 111 120 } 112 121 … … 114 123 } 115 124 add_filter( 'map_meta_cap', 'wporg_themes_map_meta_cap', 10, 4 ); 125 126 /** 127 * Checks if ther current users is a super admin before allowing terms to be added. 128 * 129 * @param string $term The term to add or update. 130 * @return string|WP_Error The term to add or update or WP_Error on failure. 131 */ 132 function wporg_themes_pre_insert_term( $term ) { 133 if ( ! is_super_admin() ) { 134 $term = new WP_Error( 'not-allowed', __( 'You are not allowed to add terms.', 'wporg-themes' ) ); 135 } 136 137 return $term; 138 } 139 add_filter( 'pre_insert_term', 'wporg_themes_pre_insert_term' ); 116 140 117 141 /**
Note: See TracChangeset
for help on using the changeset viewer.