Forums

[Plugin: WP JS] Error On Activation (3 posts)

  1. saphod
    Member
    Posted 1 year ago #

    I get the following error on activation of the plugin:

    Fatal error: Call to undefined function: wp_get_current_user() in (...)/wp-includes/capabilities.php on line 447

    ???

    (Same with WP-CSS)

  2. italianstyle
    Member
    Posted 1 year ago #

    try adding

    if (file_exists(ABSPATH . 'wp-includes/pluggable.php')) {
        require_once(ABSPATH . 'wp-includes/pluggable.php');
    }

    at the beginning of the file wp-js.php right before
    include_once('wp-js-functions.php');

    that solved for me. Maybe the same applies to wp-css too

    edit: plugin now installs but it's not working
    here's the output
    Oh crap,the plugin messed up.Send me a message.File:

  3. halmat
    Member
    Posted 1 year ago #

    Thanks italianstyle. I've added those lines of code.

    Please can you send me:

    - source code of the page the error occurred on
    - what javascript you were using
    - if you were using the the built-in interface or raw code
    - the os
    - version of wp

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags