Skip Navigation

[Resolved] Name of URL-parameter from [wpv-filter-search-box] gets changed after filtering

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 26 replies, has 2 voices.

Last updated by Paul 4 years ago.

Assisted by: Minesh.

Author
Posts
#1932905

Hi Minesh,

It looks like the filtering-problem has something to do with wp_enqueue_media(), which is needed for loading the media-library in the front-end. As soon as i call this function on a page with a view on it things go wrong.

The reason you couldn't duplicate the problem earlier probably was that you didn't open/activate the CMS-bar (see private message earlier), because that's when this function hooks in.

#1932909

I recovered your testaccount, so it should work again.

#1932943

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please tell me where exactly you are enqueue wp_enqueue_media()?

#1932949

Can i sent you a private message with detailed path- and plugin-info?

#1932955

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have set the next reply to private which means only you and I have access to it.

#1932969

Hi Minesh,

The previous message isn't private yet.
Can you please make it private.

Thanks.

#1933207

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is a a custom plugin "bwb_front_end_admin" and I'm not aware of that code and as per our support policy we do not entertain such third party plugin conflicts.

What if you try to adjust the code of that plugin so that it should not run on the page where you added the search view - will that work for you?

#1933261

Yes, i'm aware of that, but it's not a problem with the plug-in, but with wp_enqueue_media().
If you put that functioncall in your functions.php then it goes wrong too.
So it looks like the combination view/wp-enqueue_media() is the problem.

I need that function for the CMS-bar, so it's no option to not load it in case of views.

#1933433

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now.

I've added the following view's filter hook to "Custom Code" section offered by Toolset:
- hidden link

function func_adjust_search_param( $query_args ,$view_settings, $view_id ) {
    global $post;
     
    $target_view_ids = array(114636, 9999);
    if ( in_array($view_id,$target_view_ids)) {
        $query_args['s'] = $_GET['wpv_post_s'];
       
    }
    return $query_args;
}
add_filter( 'wpv_filter_query', 'func_adjust_search_param', 10, 3);

I can see n ow view is filtered now as expected.

#1933521

Yes, now it works. Great!

Do you have any clue what is happening when the url changes? why it changes?

For now your solution will do, but because you have to add the view-ID each time you add a view with text-filter, i should think this needs a more permanent solution as part of the views-plugin.

Thanks for your assistance Minesh.

#1934519

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you have any clue what is happening when the url changes? why it changes?
==>
I just do not have any idea as I do not know how exactly your plugin works that is why I shared the workaround.

For now your solution will do, but because you have to add the view-ID each time you add a view with text-filter, i should think this needs a more permanent solution as part of the views-plugin.
==>
I do not see any other user reported such issue till date so I suggest you should go with workaround I shared for now that is the only solution.

#1934655

Hi Minesh,

I don't think it's in the plugin, but in the use of wp_enqueue_media.

But the work-around will do for now, so i close this ticket.

Thanks again.