• Resolved Tysss

    (@tysss)


    When using Simple author box (SAB) as a widget, the description of the author is always the current post author’s description, even when the widget has a different user selected.

    For example, consider the following situation:
    User ID | Display Name | Description
    1 | John | I am the editor of this publication.
    2 | Mary | A freelancer interested in technology
    3 | Jane | Enviromental journalist

    If John is the author of a article, where Mary and Jane are contribute and therefore we want to have their author boxes on the page, and make it via the SAB widget (SiteOrigin or similar), the resulting author boxes are something like:

    [Picture of Mary]
    Mary
    I am the editor of this publication.

    [Picture of Jane]
    Jane
    I am the editor of this publication.

    Of course Mary and Jane should have their own descriptions shown.

    The problem is in the file “template-sab.php” on line 28:
    $author_description = apply_filters( 'sab_user_description', get_the_author_meta( 'description' ), $sabox_author_id );
    where the function get_the_author_meta() should have another attribute $sabox_author_id. The correct row would be

    $author_description = apply_filters( 'sab_user_description', get_the_author_meta( 'description' , $sabox_author_id ), $sabox_author_id );

    I made a temporary fix with this line of code in my functions.php:

    add_filter( 'sab_user_description', 'my_fix_simple_author_box_description_fix', 5 , 2);
    function my_fix_simple_author_box_description_fix($description, $user_id = false) {
      if ( !$user_id ) return $description;
      return get_the_author_meta( 'description' , $user_id);
    }

    I am using the PRO version of the plugin, but I think this involves also the free version.

    Hopefully this helps other users and the developers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @tysss,

    Thank you for reaching out and letting us know about this!
    We appreciate that you also left the fix, it’s very helpful for other users and our developers.

    We will fix this in our next update.

    Thank you,
    Mihaela

    Chiming in to say that @tysss temporary solution worked for me on the free version as well as I was having this same concern. Discovered this was already reported when I was about to make the same report. ty!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Author box description from incorrect user’ is closed to new replies.