• Resolved coolee

    (@coolee)


    Hi, so Im using the filter “current_author” for the gd-listings block on the user profiles and its working flawlessly, now I wanted to add a new Tab for reviews on the user profiles. However somehow the “current_author” does not work for the “recent review” block. I tried using “current_user” and that is working.

    How it looks with “current_user”:

    The Settings/Preview with “current_author”

    How it looks with “current_author”

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support alexrollin

    (@alexrollin)

    Hello!

    I can confirm I see that on my test site, too.

    Our team is looking into it and will get back to you ASAP with an update

    Hi,

    The current_author parameter is designed to work specifically on listing pages. However, if you’re using the widget on a user profile page and want it to display current author reviews, you can achieve this by using the following code snippet:

    add_filter( 'widget_review_by_author', 'widget_review_by_author_custom_callback', 10, 1 );
    function widget_review_by_author_custom_callback( $review_by_author ){
    if(!is_uwp_profile_page()){
    return;
    }
    if ( $review_by_author === 'current' || $review_by_author === 'current_author' ) {
    $user = uwp_get_displayed_user();
    if($user && !empty($user->ID)){
    $user_id = $user->ID;
    }
    }
    return $user_id;
    }

    Note: You can either place this code snippet in the themes functions.php or you can use any code snippet plugin.

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.