From 8a6eacda0839cc93528368871e50a8fa43b73213 Mon Sep 17 00:00:00 2001 From: westi Date: Sun, 24 May 2009 18:46:01 +0000 Subject: [PATCH] Hide options from users when they don't make any sense for them. Fixes #8433 props Denis-de-Bernardy. git-svn-id: http://svn.automattic.com/wordpress/trunk@11447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/user-edit.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index b705863ec..565c0372f 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -39,6 +39,11 @@ if ( !$user_id ) { wp_die( __('Invalid user ID.') ); } +$all_post_types = apply_filters('all_post_types', array('post', 'page')); +$user_can_edit = false; +foreach ( $all_post_types as $post_type ) + $user_can_edit |= current_user_can("edit_$post_type"); + /** * Optional SSL preference that can be turned on by hooking to the 'personal_options' action. * @@ -130,7 +135,7 @@ include ('admin-header.php');

- + @@ -159,12 +164,14 @@ foreach ( $_wp_admin_css_colors as $color => $color_info ): ?> +
More information'); ?>