Support Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.






Pages: 1 [2]
Author Topic: UWPQSF and Advance cultom fields
Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: September 20, 2016, 20:47
Quote

I think I understand it, but I can't get it to work.

If I use this code: http://pastebin.com/rjpuB79J

then I get these errors:

Warning: stripslashes() expects parameter 1 to be string, array given in /Users/Beee/HTML/dvp-portal/webapp/content/plugins/ultimate-wp-query-search-filter/classes/uwpqsf-process-class.php on line 79
this error is 'expected' since the format is wrong for the search parameter of the field I'm using.
If I'm not using the field with checkboxes to search (as in all options), I don't have this error, so this one is 'expected'.

But when I change $arg to $new_args this new error pops up:
Warning: trim() expects parameter 1 to be string, array given in /Users/Beee/HTML/dvp-portal/webapp/wp/wp-includes/class-wp-meta-query.php on line 597

What am I doing wrong (if you look at my code) ?

tck30
Administrator
Posts: 530
Permalink
Post Re: UWPQSF and Advance cultom fields
on: September 22, 2016, 06:03
Quote

There must be error in your $new_args meta query. Iif you look at the documentation of wp_query

It can be an array only when compare is 'IN', 'NOT IN', 'BETWEEN', or 'NOT BETWEEN'.

Since you are using custom arguments, in your meta query array compare value, you can define yourself instead of getting from the query ($getdata).

New Add-On Plugins for Ultimate WP Query Search Filter has been released! Check it out now.

Buy Me A Beer! Thanks

Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: September 22, 2016, 14:21
Quote

I will look at it again, thanks.

Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: September 22, 2016, 18:41
Quote

quick update: I am now at a point where I can get results, when 1 checkbox is used to search....
Now doubting to use a radio box for this for the time being....

while continuing on a multiple selection because I feel it's imperative to be able do in the plugin. ACF is such a frequently used plugin.

Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: October 24, 2016, 12:28
Quote

I think I did it :)

It does need some more coding to make it more dynamic since I hardcoded some stuff in there to test, but all signs look good :)

Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: October 24, 2016, 12:49
Quote

After some testing it seems to work dynamically.
I will write a post on my blog, detailing all of this...
Because it involves quite a few steps...

Beee
Newbie
Posts: 22
Permalink
Post Re: UWPQSF and Advance cultom fields
on: October 24, 2016, 16:54
Quote

It took me almost 4 hours but here it is: My explanation of how to get ACF checkboxes to work with UWPQSF.

Read the post here.

Pages: 1 [2]