WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Co-Authors Plus] Post Links as an array

[Resolved] [Plugin: Co-Authors Plus] Post Links as an array

  • I am able to get most of the meta information as an array.
    But how do I get the author_posts_link of the co-authors in an array.

    I am changing the meta information of the post by adding the co-authors information through a hook. In my implementation, I need to return the author_postlink rather than echo it as coauthors_posts_links() does.

    I tried looking for it the get_the_coauthor_meta() fields but I could not find a way the author postlink can be obtained through get_the_coauthor_meta

    One way would be to do a ob_start and ob_get_clean to get the string and again split it on the commas.

    But I think it is an overkill and plain wrong to utilise the output buffer for this.

    How can I achieve obtaining the postlinks in array in a clean manner?

Viewing 2 replies - 1 through 2 (of 2 total)
  • It seems that get_the_coauthor_meta() has not been implemented in the plugin as yet.
    Also there is no get_coauthor_posts_link that does not echo.

    To work around that, I did get_coauthors() to get an array of user objects. We can use the array of user objects to do whatever we wish to implement.

    Hope that will be useful to somebody who faced the same problems that I did.

    Hey RahulB and friends,

    I have the same problems, but I´m not able to solve it alone… could you help me?

    I was hooking my parent theme to print the post author this way:

    $postutility = '<span class="entry-utility">';
    $postutility .= '<a class="url fn n" href="';
    $postutility .= get_author_link(false, $authordata->ID, $authordata->user_nicename);
    $postutility .= '" title="' . __('View all posts by ', 'thematic') . get_the_author() . '">';
    $postutility .= get_the_author();
    $postutility .= '</a></span><br />';
    
    return $postutility;

    Now I want to use “coauthors” in place of “author”… what should I do??

    Thanks for your help!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: Co-Authors Plus] Post Links as an array’ is closed to new replies.