Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    You can follow the instructions here to add a new section to Omnisearch:
    http://jetpack.me/support/omnisearch/

    If you don’t feel comfortable doing so, you can contact the Advanced Custom Fields plugin authors and ask them if they’d consider adding this to their plugin.

    Thread Starter mending

    (@mending)

    Hi,

    Thanks for your reply.

    From what you link to I cannot see how this should cover searching within Advanced Custom Fields?

    Wouldn’t it be more obvious to ask you to consider adding Advanced Custom Fields search support for JetPack? That would truely be great!

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Sorry, I should have been more precise. The relevant part is under the “Adding a Results section”:
    http://jetpack.me/support/omnisearch/#adding-results

    Wouldn’t it be more obvious to ask you to consider adding Advanced Custom Fields search support for JetPack? That would truely be great!

    Unfortunately, that’s not something we can do. There are many other plugins adding custom post types and custom data to WordPress, it’d be impossible to support them all within Jetpack. However, we’ve added the necessary filters to Jetpack so the plugin can easily be extended to fit everyone’s needs, without having to change Jetpack itself.

    I hope this helps!

    Thread Starter mending

    (@mending)

    Ok, thanks! But the documentation doesn’t explain what add in order to make search within custom fields possible?

    add_filter( 'omnisearch_results', 'my_omnisearch_results', 10, 2 );
    function my_omnisearch_results( $results, $search_term ) {
        $html = '<h2>My Omnisearch Results</h2>';
        $html .= '<p>You just searched for <em>' . esc_html( $search_term ) . '</em>!</p>';
    
        $results['My Results'] = $html;
        return $results;
    }

    How will this be possible with your snippet:
    http://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/

    ?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    This tutorial explains to add custom fields to the default WordPress Search functionality. Omnisearch is a bit different, as it can only be used from your dashboard, inside the Jetpack > Omnisearch menu. You consequently won’t be able to follow that tutorial to add ACF to Jetpack’s Omnisearch module.

    You can, however, check how we’ve extended Omnisearch for other things, like plugin search:
    https://github.com/Automattic/jetpack/blob/master/modules/omnisearch/omnisearch-plugins.php

    I hope this helps.

    Thread Starter mending

    (@mending)

    Hi,

    Thanks! I’ll look further into this 🙂

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

The topic ‘Omnisearch to support seach in Advanced Custom Fields?’ is closed to new replies.