• Resolved skrueger03

    (@skrueger03)


    Upgraded manually to WordPress 3.8 on http://www.smart-ins.com and got the following error after upgrade.

    NOTE: I usually do the upgrade through the dashboard on other sites but for this client it doesn’t work with their small-town hosting provider so I have to do it manually. I don’t know if that has anything to do with the new error. Everything was working fine until upgrading to 3.8.

    Fatal error: Call to undefined function wp_get_current_user() in /mnt/nfs/www/www.smart-ins.com/wp-includes/capabilities.php on line 1342

    Here is the code from that file.

    function author_can( $post, $capability ) {
    if ( !$post = get_post($post) )
    return false;

    $author = get_userdata( $post->post_author );

    if ( ! $author )
    return false;

    $args = array_slice( func_get_args(), 2 );
    $args = array_merge( array( $capability ), $args );

    return call_user_func_array( array( $author, ‘has_cap’ ), $args );
    }

    I tried reverting back to 3.7.1, but that just returned the same error but this time on line 1286. So, I’m reinstalling 3.8.

    Anyone have any ideas? I’m a novice at WordPress so please use as plain of language as you can. I’d really appreciate some help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Have you tried:
    – deactivating ALL plugins temporarily to see if this resolves the problem. If this works, re-activate them individually (one-by-one) to find the problematic plugin(s). If you can’t get into your admin dashboard, try deactivating via FTP or SFTP or whatever file management application your host provides. If applicable, also remember to deactivate any plugins in the mu-plugins folder. The easiest way is to rename that folder to mu-plugins-old.
    – To rule out any theme-specific issue, try switching to the unedited default, core-bundled Theme (such as Twenty Twelve, Twenty Thirteen or Twenty Fourteen) for a moment using the WP dashboard. If you don’t have access to your admin area, you can switch to the default theme by renaming your current theme’s folder in wp-content/themes and adding “-old” to the end of the folder name using via FTP or SFTP or whatever file management application your host provides. Alternately, you can remove other themes except the default theme. That will force your site to use it.
    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems (because the hooks remain unless plugins completely removed or some plugins stick around in cached files. So by renaming the folder, you break them and force them inactive).
    – If the above troubleshooting steps fail to resolve the issue, try manually re-uploading all files and folders EXCEPT the wp-config.php file and the /wp-content/ directory from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones. Read the Manual Update directions first!

    Thread Starter skrueger03

    (@skrueger03)

    Thank you, Tara! I worked through a few of your solutions and fixed the problem. It appears that a plugin was the culprit. Thank you!

    Moderator t-p

    (@t-p)

    you are welcome 🙂

    Details:

    In my case the guilty plugin calls the function “current_user_can” at improper time.

    You case could be the same – most likely, it calls current_user_can() right from the constructor, rather than from a method, which has to be called via add_action (‘init’, …).

    It might be something new to WP 3.8 – at the time the plugin is being constructed, the wp-include\pluggable.php had not been called yet, and the function wp_get_current_user is not being defined yet.

    So it’s up to the plugin’s author to fix that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Installed 3.8 and site is broken now’ is closed to new replies.