Changeset 4495 for trunk/wp-includes/capabilities.php
- Timestamp:
- 11/19/2006 07:56:05 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/capabilities.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r4158 r4495 222 222 223 223 function level_reduction($max, $item) { 224 if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) {225 $level = intval($matches[1]);226 return max($max, $level);227 } else {228 return $max;229 }224 if(preg_match('/^level_(10|[0-9])$/i', $item, $matches)) { 225 $level = intval($matches[1]); 226 return max($max, $level); 227 } else { 228 return $max; 229 } 230 230 } 231 231 232 232 function update_user_level_from_caps() { 233 global $wpdb;234 $this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0);235 update_usermeta($this->id, $wpdb->prefix.'user_level', $this->user_level);233 global $wpdb; 234 $this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0); 235 update_usermeta($this->id, $wpdb->prefix.'user_level', $this->user_level); 236 236 } 237 237 … … 299 299 if ( 'page' == $post->post_type ) { 300 300 $args = array_merge(array('delete_page', $user_id), $args); 301 return call_user_func_array('map_meta_cap', $args); 301 return call_user_func_array('map_meta_cap', $args); 302 302 } 303 303 $post_author_data = get_userdata($post->post_author); … … 353 353 if ( 'page' == $post->post_type ) { 354 354 $args = array_merge(array('edit_page', $user_id), $args); 355 return call_user_func_array('map_meta_cap', $args); 355 return call_user_func_array('map_meta_cap', $args); 356 356 } 357 357 $post_author_data = get_userdata($post->post_author); … … 403 403 if ( 'page' == $post->post_type ) { 404 404 $args = array_merge(array('read_page', $user_id), $args); 405 return call_user_func_array('map_meta_cap', $args); 405 return call_user_func_array('map_meta_cap', $args); 406 406 } 407 407
Note: See TracChangeset
for help on using the changeset viewer.