diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-includes/capabilities.php | |
parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/capabilities.php')
-rw-r--r-- | wp-includes/capabilities.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index eccde97..3c3594d 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -267,7 +267,7 @@ class WP_User { // Must have ALL requested caps $capabilities = apply_filters('user_has_cap', $this->allcaps, $caps, $args); foreach ($caps as $cap) { - //echo "Checking cap $cap<br/>"; + //echo "Checking cap $cap<br />"; if(empty($capabilities[$cap]) || !$capabilities[$cap]) return false; } @@ -295,14 +295,14 @@ function map_meta_cap($cap, $user_id) { break; case 'delete_post': $author_data = get_userdata($user_id); - //echo "post ID: {$args[0]}<br/>"; + //echo "post ID: {$args[0]}<br />"; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('delete_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); - //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br/>"; + //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br />"; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... @@ -323,10 +323,10 @@ function map_meta_cap($cap, $user_id) { break; case 'delete_page': $author_data = get_userdata($user_id); - //echo "post ID: {$args[0]}<br/>"; + //echo "post ID: {$args[0]}<br />"; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); - //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br/>"; + //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />"; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... @@ -349,14 +349,14 @@ function map_meta_cap($cap, $user_id) { // edit_others_posts case 'edit_post': $author_data = get_userdata($user_id); - //echo "post ID: {$args[0]}<br/>"; + //echo "post ID: {$args[0]}<br />"; $post = get_post($args[0]); if ( 'page' == $post->post_type ) { $args = array_merge(array('edit_page', $user_id), $args); return call_user_func_array('map_meta_cap', $args); } $post_author_data = get_userdata($post->post_author); - //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br/>"; + //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br />"; // If the user is the author... if ($user_id == $post_author_data->ID) { // If the post is published... @@ -377,10 +377,10 @@ function map_meta_cap($cap, $user_id) { break; case 'edit_page': $author_data = get_userdata($user_id); - //echo "post ID: {$args[0]}<br/>"; + //echo "post ID: {$args[0]}<br />"; $page = get_page($args[0]); $page_author_data = get_userdata($page->post_author); - //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br/>"; + //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />"; // If the user is the author... if ($user_id == $page_author_data->ID) { // If the page is published... @@ -445,12 +445,12 @@ function map_meta_cap($cap, $user_id) { function current_user_can($capability) { $current_user = wp_get_current_user(); - $args = array_slice(func_get_args(), 1); - $args = array_merge(array($capability), $args); - if ( empty($current_user) ) return false; + $args = array_slice(func_get_args(), 1); + $args = array_merge(array($capability), $args); + return call_user_func_array(array(&$current_user, 'has_cap'), $args); } |