Support » Plugins » [Plugin: SP Authors] Bug on Sp-authors

  • Resolved hopeac


    I am not sure if I am the only one having the problem. When I selected the display name in the admin form, it does not save in the database.

    The values submitted in the admin tool are displayed names, and the function to get the ID for the user is expecting the login name. Therefore if the display name and login are not the same, the ID cannot be retreived.

    I have resolved the issue, hopefully my solution can help someone else.

    In function sp_authors_save_post_meta($new_post_id, $post)

    $author_id = _get_author_id_by_login(trim($co_author));
    $author_id = _get_author_id_by_display(trim($co_author));

    Insert the following function

    function _get_author_id_by_display($login) {

    global $wpdb;

    $user_id = $wpdb->get_var(“SELECT ID FROM $wpdb->users
    where display_name=’$login’

    return $user_id;

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: SP Authors] Bug on Sp-authors’ is closed to new replies.