[wp-hackers] WP_DEBUG notice with current_user_can()?

Mike Schinkel mikeschinkel at newclarity.net
Sun Apr 24 23:50:56 UTC 2011


Can someone check my logic here please?  I'm running the following code with WP 3.1 as a standalone test.php and calling the core function current_user_can() with 'edit_page' as it's only parameter, and with WP_DEBUG set to true:

<?php // test.php
define('WP_DEBUG',true);
include( 'wp-load.php' );
header( 'Content-type:text/plain' );
current_user_can('edit_page');

I get the following warnings:
Notice: Trying to get property of non-object in /Users/mikeschinkel/Sites/wp31/public_html/wp-includes/capabilities.php on line 872

Notice: Trying to get property of non-object in /Users/mikeschinkel/Sites/wp31/public_html/wp-includes/capabilities.php on line 874

Notice: Trying to get property of non-object in /Users/mikeschinkel/Sites/wp31/public_html/wp-includes/capabilities.php on line 875

Notice: Trying to get property of non-object in /Users/mikeschinkel/Sites/wp31/public_html/wp-includes/capabilities.php on line 875
Am I doing something wrong, or is this indeed a oversight in core that I should submit a trac ticket and patch to fix?

-Mike







More information about the wp-hackers mailing list