Support » Plugin: Query Wrangler » Filters on field output

  • Resolved MediaDC

    (@mediadc)


    My theme is using CoAuthors Plus, and I’ve incorporated it on all of my theme files, but Query Wrangler does not have any option to use the coauthors instead of the actual post author. The end result is that the widgets that show the author name do not show the same name(s) as those on the category, single, or search pages for that post.

    Is it possible to apply my own filter to any of the author output functions, to compel them to use coauthors or any other filters I’d like to apply? I tried applying a filter to the “qw_get_the_author” function, in post_author.inc, but this didn’t seem to work. Perhaps I’m just trying it in the wrong place.

    Can you provide any guidance on how to accomplish this?

    Thanks.

    https://wordpress.org/plugins/query-wrangler/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Do you need to be able to use all the special arguments for the coauthor functions found here: http://vip.wordpress.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/#available-template-tags ?

    If not, I think you could create a custom QW field as a custom plugin fairly easily to allow you to display the coauthors.

    If you need much more control over the different ways of displaying coauthors (ie, as links, not linked, and linked to their websites, or with all the $between, $after parameters) it could be a little more difficult to provide the interface for these options within QW.

    Just let me know if you’re looking for all coauthor display options, or just one in particular and I can throw together an example for adding a custom QW field.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    Hi again,

    I went ahead and wrote a custom QW field plugin as an example of how easy this can be.

    https://gist.github.com/daggerhart/10414715

    That should be fairly self explanatory, but if you have any questions just let me know.

    Plugin Author Jonathan Daggerhart

    (@daggerhart)

    One more thing. I made another gist of a more generic custom qw field implementation that shows how to get the $post object and query wrangler $field settings into your output_callback.

    https://gist.github.com/daggerhart/10417309

    Hope this helps. Let me know if you run into any issues.

    Thread Starter MediaDC

    (@mediadc)

    Jonathan, your addition of the Callback field did the trick! Using this field allowed me to reference a very brief function I wrote in my functions.php file that called directly to the necessary CoAuthors functions. The end result gave me the coauthors with links to their profile pages, as I desired.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filters on field output’ is closed to new replies.