WordPress.org

Ready to get started?Download WordPress

Forums

Whisper Comment Reloaded
author vs user_login (2 posts)

  1. Sofia
    Member
    Posted 1 year ago #

    This is Sofia again. I can get the html errors (incorrect layout and empty select list) to correct if I hardcode a user_login into the following code vs using the author name (display) ($author = get_the_author();)

    $wp_users = $wpdb->get_results("SELECT * FROM {$wpdb->users} WHERE user_login = '".$author."' ORDER BY ID");
    changed to
    $wp_users = $wpdb->get_results("SELECT * FROM {$wpdb->users} WHERE user_login = 'test1' ORDER BY ID");

    My user test1 is still unable to view comments on the site. perhaps this is an additional author vs user_login_id issue.

    http://wordpress.org/extend/plugins/whisper-comment-reloaded/

  2. Sofia
    Member
    Posted 1 year ago #

    This is Sofia for the last time. I fixed it!! Once I retrieved the author's login id and used that in the sql query in place of the author's display id, everything works just as i want it!!

    I added this
    $author_login = get_the_author_meta('user_login');

    and I replaced
    $wp_users = $wpdb->get_results("SELECT * FROM {$wpdb->users} WHERE user_login = '".<strong>$author</strong>."' ORDER BY ID");
    with
    $wp_users = $wpdb->get_results("SELECT * FROM {$wpdb->users} WHERE user_login = '".<blockquote>$author_login</blockquote>."' ORDER BY ID");

    PHP isn't too hard :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.