BuddyDev

Search

[Resolved] Recent Visitors shortcode creating issues in Blocks

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31966

    Hi Brajesh, I have inserted this shortcode [bp-visitors-recent-visitors max=12 duration=1] into a Gutenberg block.

    Fore some reason this shortcode creates an issue with the Heading block above, which is outputted in the header.

    https://imgur.com/ikrJlJQ

    If i move the Heading block below the shortcode everything is ok.

    https://imgur.com/FVOHziU

    None of the other shortcodes I am using on the same page creates this issue, how can the shortcode affect other blocks?

    Regards
    Carsten

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #31969

    Hi Carsten,
    Thank you for reporting.

    I am not sure how a shortcode can affect the block. will need time to test today before replying again.

    Regards
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31970

    Hi Brajesh, I appreciate that, I’ve got this answer from my theme developer, to whom I addressed the issue first.

    ‘If it always appears before the content wherever you place it – then it’s the way Shortcode is returning its content. Which would have to be fixed at the source’

    Regards
    Carsten

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2934
    Ravi on #31977

    Hello Carsten,

    It was a bug in our plugin. I have updated the plugin. Please update the plugin and let me know if it is fixed or not.

    Regards
    Ravi

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31979
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31980

    Until then I’m testing the Custom listing of Recent Visitors code snippet, but I’m not getting any output from it. Can you confirm that it’s still supposed to work?

    Thanks

    /* custom Recent visitor code to list it anywhere for logged in user */
    $visitors = visitors_get_recent_visitors(get_current_user_id(), 5);//pass the user id for which we are retriving and how many we want
    foreach( (array) $visitors as $visitor_id ){
        echo bp_core_get_userlink( $visitor_id );//display the name of the 
        //bp_core_get_user_displayname( $visitor_id ); //use it to fetch the user display name
        //bp_core_get_user_domain( $visitor_id ); //use it to get user profile url
        //bp_core_fetch_avatar( array('item_id'=> $visitor_id, 'height'=>25, 'width'=> 25)); //fetch user avatar
    }
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #31981

    Hi Carsten,
    1. Your subscription expired on 24th June. Currently, we list it on the subscription page and not on plugins page. We will update this weekend to show it over the plugin page too.

    2. The above code will work if you put it in template file. If you put it in bp-custom or functions.php, It won’t.

    3. If you want, I will be glad to share the updated copy via google drive as it was a bugfix.

    Thank you
    Brajesh

  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31982
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #31994
    This reply has been marked as private.
  • Participant
    Level: Yogi
    Posts: 1105
    calu on #31995

    Hi Brajesh, thanks for the update, I can confirm that the issue is solved.

    Regards
    Carsten

The topic ‘ [Resolved] Recent Visitors shortcode creating issues in Blocks’ is closed to new replies.

This topic is: resolved