Skip to:
Content
Pages
Categories
Search
Top
Bottom

xprofile_get_field_data not working at pre_get_posts


  • msolution
    Participant

    @msolution

    im working with pre_get_posts action hook, and calling xprofile_get_field_data in the function it is returning an empty string, after looking into the function it seems the $bp->profile array is not fully loaded, and $bp->profile->table_name_fields is missing and generating a mysql error.

    I have disabled all other plugins, and still the issue persists.

    what am i missing?

    WordPress 5.2.3
    BuddyPress Version 4.4.0
    this is an intranet site!
    Theme: Multi NewsVersion: 2.6.5 [www.momizat.com]

    The Issue does not happen on TwentyFifteen/ TwentyTwelve

    Looking for a fix.

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    Due to something in your theme, you are calling xprofile_get_field_data too early.

    In your pre_get_posts filter, you could try calling BP: $bp = buddypress();

    Otherwise, you’ll need to talk to the theme creator.


    msolution
    Participant

    @msolution

    Thanks @shanebp ,

    will contact theme dev

    Thanks!

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