Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search Search Results for 'sf_edit_query_args'

Viewing 5 results - 201 through 205 (of 205 total)
  • Author
    Search Results
  • #27945

    In reply to: Default search


    Ross
    Keymaster

    Hey Keith

    Unfortunately this is not yet an option within S&F – but there are a couple of hacky workarounds.

    1) Enable “Bookmarkable URLs” – then go to you search form, click “most popular” and you will notice the URL change. Use this URL for linking to your search page.

    2) Use the filter sf_edit_query_args (this is a lot more complex) – http://www.designsandcode.com/documentation/search-filter-pro/2-0-upgrade-notes/#No_more_pre_get_posts

    Then you would have to detect whether a search has been performed (ie any options in the form selected) – if not you would use the above filter to by tag 1 – and then using JS you would also have to set the filter – its pretty messy but I guess possible.

    Thanks

    #26679

    Sergey
    Participant

    Sorry, I can’t go by this way, because I can’t pass category or tag into sf_edit_query_args 🙁

    Category isn’t fixed, it get from post with vitrine shortcode. So different vitrines have different categories, but shortcodes in the posts can be same!

    #26651

    Ross
    Keymaster

    Hey Sergey

    I think we’re getting confused.

    So, what you would like to do (as an example) is pass the category through to S&F, in the shortcode or something similar.

    Well, this is not yet possible, but you can use the shortcode like you mention above, and then use the filter sf_edit_query_args in the link above to limit the tag/category to whatever you like.

    So in this way it is dynamic and according the cat/tag you supply via some custom php code.

    Does that make sense?

    Thanks

    #26335

    Ross
    Keymaster

    Hmm what are you trying to do, find out what the current search is, and modify the query based on certain criteria?

    What I think you might want to do is, check what the current user has searched for by using the info here:

    http://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/

    and then run sf_edit_query_args – if you want to check sf_edit_query_args after it has some values from S&F then run it with a lower priority (eg 100):

    add_filter( 'sf_edit_query_args', 'sf_filter_query_args', 100, 2 );

    Thanks

    #26291

    Jaroslav Huss
    Participant

    So I’ve found that there is a new filter sf_edit_query_args which is exactly for this purpose. But when I try to hook there the $query_args argument is empty.. :-/

Viewing 5 results - 201 through 205 (of 205 total)