• Resolved RayBernard

    (@raybernard)


    I am using the Exec-PHP plugin, which allows me to execute PHP code in widgets. The following code works without the call to get_last_login_current_user(), but with the function call I get a blank page displayed. Page rendering stops and a fatal error message is generated:

    Fatal error: Call to undefined function last_login_time() in [path shortened…]/wp-content/plugins/last-login/last-login.php on line 100

    Here is the code I am using.

    I have uninstalled and reinstalled the plugin and error still occurs.

    I looked in the last-login.php file, and I see that no last_login_time() function exists in it.

    <?php
    echo  '<span class="last-logged-in-text">You last logged in: </span><span class="last-logged-in-date">';
       echo get_last_login_current_user();
       echo  '</span>';
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Call to undefined function last_login_time() is a bug in get_last_login_current_user(). Line 100 should be a call to the proceeding function get_last_login().
    Change:
    function get_last_login_current_user($format=’%c’) {
    $current_user = wp_get_current_user();
    return last_login_time($current_user->ID, $format);
    }

    To:
    function get_last_login_current_user($format=’%c’) {
    $current_user = wp_get_current_user();
    return get_last_login($current_user->ID, $format);
    }

    Thread Starter RayBernard

    (@raybernard)

    richalt2 – thanks! Of course that did the trick.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Last Login] Calling function stops page creation’ is closed to new replies.