• Resolved sashman13

    (@sashman13)


    So we’re having issues with get_the_author_meta pulling certain data. No matter what userid you pass into it, it displays the data from the context of the post you are currently in. It’s possible this is a user error, but something simple like :

    get_the_author_meta( ‘user_url’, 12);

    Seems to ignore the user 12 and pull the data from that post if it’s a molongui multi-author post. On top of it, it’s incorrect data. User_url is supposed to be the website url and instead it’s pulling back a hashed molongui object with author slug. When it’s a single author post it works as expected.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Molongui

    (@molongui)

    Hi @sashman13,

    Please, try with this:

    add_filter( 'molongui_authorship_dont_override_get_user_by', '__return_true' );
    $user_url = get_the_author_meta( 'user_url', 12 );
    remove_filter( 'molongui_authorship_dont_override_get_user_by', '__return_true' );

    As long as you provide the second optional parameter ($user_id) to the get_the_author_meta function, this works. Please, let us know if it does for you.

    Thread Starter sashman13

    (@sashman13)

    Appreciate this. Would be nice to include some of this in the documentation and add a few more functions. I like the plugin for the most part, but it’s a little burdensome writing code that works with it.

    Plugin Author Molongui

    (@molongui)

    Yes, that’s something we have pending.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issues with get_the_author_meta called from with a post context’ is closed to new replies.