Depreciated call.
-
I have found a message about a depreciated call in the admin.
Does anyone know about this or is this a false positive on depreciated calls?Here is the message I found.
Argument in current_user_can()
Used in wp-admin/includes/menu.php on line 102.Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.
Deprecated in version 2.0.
-
It is not a false positive. You need to review Roles_and_Capabilities.
Hmm…
Why would I need to review Roles and Capabilities?
I didn’t write this script..
I’m just asking because it is showing up in a few places coming from the WP script..Have you tried:
– deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
– switching to the Twenty Eleven theme to rule out any theme-specific problems.
– resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.
Been all through that..
LOL.. you suggest it a plugin, my host says it’s a problem with WordPress not being able to function properly with php 5.3.x
They suggest roll back to 5.2.x and it will solve the problem..What do you think about that?
I think your hosts don’t know that they’re talking about.
1. I run multiple WP sites under PHP 5.3 and none have this problem.
2. It’s referencing an old, deprecated, WordPress function – not a PHP one.That’s kind of what I was thinking, but I thought I would pass it by you.
Yes, I am aware it is referencing an old deprecated WordPress function.
But it is the WordPress file that is referencing the deprecated WordPress function, isn’t it?Not in wp-admin/menu.php line 102, no. Try re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.
Actually, I just downloaded the file; wp-admin/includes/menu.php
Lines 99-103 are;
// Remove menus that have no accessible submenus and require privs that the user does not have.
// Run re-parent loop again.
foreach ( $menu as $id => $data ) {
if ( ! current_user_can($data[1]) )
$_wp_menu_nopriv[$data[2]] = true;I opened the same file from a fresh download of WP 3.3.1
Lines 99-103 are;
// Remove menus that have no accessible submenus and require privs that the user does not have.
// Run re-parent loop again.
foreach ( $menu as $id => $data ) {
if ( ! current_user_can($data[1]) )
$_wp_menu_nopriv[$data[2]] = true;It appears to me that what is contained in both files is exactly the same and is consistent with what I originally posted. In fact the function “current_user_can()” is right there in black and white.
Please explain to me why that isn’t there when I am looking at it in both files.
I do not need to replace a file that is exactly the same as the one you want me to upload.
Lines 96 – 103 in wp-admin/menu.php:
$ptype_for_id = sanitize_html_class( $ptype ); if ( is_string( $ptype_obj->menu_icon ) ) { $menu_icon = esc_url( $ptype_obj->menu_icon ); $ptype_class = $ptype_for_id; } else { $menu_icon = 'div'; $ptype_class = 'post'; }
Apparently you are in need of a cup of coffee or something.
Please read what I originally posted.You aren’t even looking in the right place.
I provided you with the information I had.
I will quote it again.“Argument in current_user_can()
Used in wp-admin/includes/menu.php on line 102.Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.
Deprecated in version 2.0. “Nowhere did I say the file was wp-admin/menu.php
I said wp-admin/includes/menu.php
I said it again in the post just before your last answer.
You are ignoring what I repeatedly wrote.Isn’t this an exact science?
I don’t mean to sound or be rude.
However, I am working on an active site.
I attempted to find something out because I am not a coder.
I don’t know if this issue is serious.
I only know that it is now confirmed that the file is an unmodified WordPress file.
It is confirmed that the file is using a deprecated function.
And when I attempt to get the person I am talking to, to look at the actual file instead of having them tell me to take my site apart because they refuse to look at the file I am talking about, suddenly they stop talking.Does anyone have any idea what needs to be done to correct the issue?
Is it a serious issue?
I can ignore it if it isn’t serious and wait for WordPress to update.
But I also don’t need to have a problem with my site if it is serious.I have seen other posts about deprecated calls coming from the admin in WordPress. The answers have all been pretty much “deactivate all plugins and go back to the default theme.” When that is done, and the problem doesn’t go away, suddenly no more communication from the person offering the advice.
This is disturbing.
Please, if you are going to offer help, pay attention to what the person asking for help is saying. It’s not like we are just talking on the phone and it can slip by. It’s in print. I realize the first time you read something you can miss it, but when it is repeated over and over and the file you are looking at shows nothing like what has been said, PLEASE, double check that you are looking in the right place and at the right file.
The location of the file is clearly different from where you were looking. What confused me is how you could be talking about two different directories, in different parts of WordPress and only be talking about one file.
There are many of us who depend upon what you say. If I had taken that file you were looking at and uploaded it to the location I was looking at, I would have had a major issue and probably a dead site. And I would have been frantic to get my live site back up and running..
What you say matters. Your attention to detail makes a world of difference to the rest of us.
Thanks..
I will attempt to find the answer somewhere else..What theme are you using? Might be helpful if you listed your active plugins, as well.
[edit] ..and I can tell by reading your comments that you will appreciate how much more expeditious it would be to simply answer the question directly, rather than wasting additional time re-explaining what you have or have not tried. ??
[re-edit] More interesting reading: “Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.”
HeatMap Theme Pro 5.3
My question to you is, if the WordPress file is using a deprecated function, what difference does it make what theme I am using?
I’m really wanting to understand this. I’m not trying to be rude, though it might sound that way.
I also realize that like me, everyone else may be busy and it might be inconvenient to take the time to explain. However, once explained, I don’t have to go round in circles anymore.. That will save me time and the time of others.. It might also help other people who run into a similar issue. They would just be able to read and see rather than go through the process I am going through..
Thanks for your question.
Could you explain what the deprecated call has to do with my theme, if the call is coming from a WordPress file? Maybe I am missing something here.My question to you is, if the WordPress file is using a deprecated function, what difference does it make what theme I am using?
My gut tells me the deprecated function is being used in a theme or a plugin, and the fact that you find reference to it in WordPress files may not really be the issue, but who knows, right?
Esmi’s suggestion to replace files should not be dismissed out of hand.
It’s just part of diagnosis.Take a look at these and see if there is anything there that seems familiar, and at what others are saying. Lots of good conversations.
“Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.”
..And just to be completely on the same page, if you activate the default wordpress theme, deactivate every plugin, clear your browser cache and revisit your site, the symptom does not change? That is something you have confirmed without doubt?
So here’s your logical steps.
Activate default theme, disable all plugins (at the same time) clear cache, go back and see if the symptom changes.
-If yes, start process of elimination, theme first, one plugin at a time after that.
-If no, try re-uploading WordPress files from a fresh download as suggested. Clear cache, retest for result, see what happens.
Your theme also appears to be commercial. It won’t be supported here, if it turns out to be the issue. You will need to contact support where it was purchased.
Yes, I am aware that I will have to contact the theme Dev. if that is the problem.
So, what you are saying is something is calling the deprecated function that WordPress is using, right?
If the function is deprecated, then WordPress still uses it, but themes and plugins can not call or use it in an argument?
If that is the case, then I do understand and I will check it out..
And yes, I will dismiss out of hand the suggestion that I upload files I have already determined to be exactly the same as what is contained in a fresh download of WordPress.. That is both ridiculous and a waste of time.. The fact that they are fresh, exact duplicates of the files I have checked tells me that it doesn’t make any difference which of the two are on the server.
I have contacted 6 different plugin devs about issues their plugins have with deprecated calls. Each of them have either already updated their plugin or are in the process of doing so..
So, what you are suggesting to me is that the issue with WordPress using the argument with the deprecated call to a function is something that isn’t an issue?
As stated above, I am working with an active site. I know what plugins are using deprecated calls, I have contacted them and they are making changes. I am not going to tear my site down if it isn’t something to be concerned about. Is it a major concern? I have asked that and I would like to know.
Now I will go look at your link..
- The topic ‘Depreciated call.’ is closed to new replies.