WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
[resolved] Co-author Plus + JSON API Plugin (7 posts)

  1. phillipadsmith
    Member
    Posted 1 year ago #

    Did a quick search and didn't find anything obvious, so I'll just post this quickly for today, then do some digging when I have a moment...

    In short, when using the JSON API plugin with Co-author Plus, the default output from the JSON API doesn't pick up on additional authors for a post.

    Would be great if the two plugins worked together, given how freakin' awesome they both are. :)

    I'll poke around for a quick fix, but happy to hear suggestions/comments too.

    Phillip.

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    In short, when using the JSON API plugin with Co-author Plus, the default output from the JSON API doesn't pick up on additional authors for a post.

    It doesn't pick up the additional authors because Co-Authors Plus is actually storing the byline information as taxonomy terms.

    I'm not terribly familiar with the JSON API plugin but it doesn't look like there's a way to easily filter the response object. You can define your own controller though, or you could modify the requests you're making to also request the 'author' terms associated with the post.

  3. phillipadsmith
    Member
    Posted 1 year ago #

    You can define your own controller though, or you could modify the requests you're making to also request the 'author' terms associated with the post.

    That's a helpful pointer, Daniel, many thanks.

    Phillip.

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Yep. If you're not using much of the functionality the JSON API plugin offers, you might scrapping it altogether and creating your own JSON endpoints.

  5. phillipadsmith
    Member
    Posted 1 year ago #

    Hey there Daniel,

    Wondering if you can give this hack a look and let me know if you see anything terribly wrong with it: https://gist.github.com/fe484c0daeeb9933b21e

    Seems to do the trick nicely in terms allowing for the co-authors if they're in use. That said, I'm pretty sure how I'm doing this is not the "WordPress Way," and I suspect you might have a better suggestion.

    Thanks in advance,

    Phillip.

  6. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Yep, that looks like it would work. The only hesitation I'd have is that you're modding the core of the plugin, which means any automatic updates would blow your changes away.

    It doesn't look like the plugin has been updated in a year though, so you should be fine. I'd just make sure that you document the changes in a place that the next person to come along to your project has access to.

  7. phillipadsmith
    Member
    Posted 1 year ago #

    Hey there Daniel,

    Many thanks for the double-check. I appreciate it.

    Indeed, I was also looking at the plug-in from the perspective of it not getting m/any updates in the near future.

    Phillip.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic