• Here is my crappy code that used to work and now doesn’t under 2.8. I understand that this is not optimized. I pieced together bits and pieces from the web. Although I am getting more familiar with php, I still have a lot to learn. Any help would be appreciated.

    <div class=”widgetarea”>
    <ul id=”sidebarwidgeted”>
    <?php if (!(current_user_can(‘level_0’))){ ?>
    <h3>User Dashboard:</h3>
    <p><?php wp_loginout(); ?> | <?php wp_register(”, ”);?> | ” title=”Lost Password”>Lost Password</p>
    <?php } else { ?>
    <h3><?php echo $current_user->user_login; ?>’s Dashboard:</h3>
    <ul class=”admin_box”>
    <?php if (is_user_logged_in()){
    global $user_email, $user_login;
    get_currentuserinfo();
    echo ”

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Define “doesn’t work”. What doesn’t work about it?

    Thread Starter cornetjr

    (@cornetjr)

    Sorry that was pretty vague. In a couple of areas I am trying to call the logged in user name. The call below works beautifully with or with wp_supercache runnng

    ” . $user_login . “

    The call below does not call the user name at all when supercache is running, but does so when it is disabled.

    <?php echo $current_user->user_login; ?>

    Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP code optimization’ is closed to new replies.