mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
f2779be7f0
Ensure `current_user_can()` and `user_can()` return the same results for logged out users. For core capabilities this changes `user_can( 0, 'exist' )` to return `true` rather than `false` in line with `current_user_can( 'exist' )` for logged out users. Convert `current_user_can()` and `current_user_can_for_blog()` to wrapper functions ultimately calling `user_can()`. Add anonymous user to primitive capability checks as appropriate. Convert `Tests_User_Capabilities::test_other_caps_for_all_roles()` to use a data provider and add tests to check whether user exists in the database (`WP_User::exists()`) as that intentionally differs from the `exist` capability. Props jjj, johnbillion, peterwilsoncc, SergeyBiryukov, TimothyBlynJacobs. Fixes #52076. git-svn-id: https://develop.svn.wordpress.org/trunk@50490 602fd350-edb4-49c9-b593-d223f7449a82