Skip Navigation

[Resolved] has_cap is deprecated, use capabilities instead

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Scott Roberts 4 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1490363

While trying to diagnose speed issues on my site, I have turned on WP_DEBUG. This message is being thrown repeatedly on the dashboard. In searching for has_cap I find most of the uses are in toolset code.

Specifically,
types-access/application/models/user_roles.php,
types-access/application/models/access_settings.php,
multiple times in types/application/models/user/Access.php,
types/vendor/toolset/includes/classes/class.wpcf.roles.php

Could it get added to the plans to resolve these deprecations? The message is "Notice: has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead." This appears 8 times at the top of each wp-admin screen.

#1490971

Hi, I don't see the same notices on a clean installation with Types Access running, so I suspect there is some kind of conflict going on here. Since you're using a custom theme and quite a few other plugins it's difficult to know exactly where that conflict could be. As a test, can you try the following troubleshooting steps?
- Temporarily activate a default theme like Twenty Twenty and deactivate all plugins except Types, Blocks and Access.
- Test the dashboard again. If the notice does not appear, reactivate your theme and other plugins one by one until the notices begin appearing again.
- If the problem was not resolved by deactivating the theme and other plugins, I'll need to take a closer look.

Let me know what you find out and we can go from there.

#1491109

I was able to identify the plugin causing the message, and it turned out to be a non-essential item. Thanks for your help!