Support Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.






NOTE : Due to personal issue, this Ultimate WP Query Search Filter Plugin is no longer under development. Thanks for the support over the years.

Anyone that come across this page that want to find a realible saerch plugin, here are the list of potential replacements.

Plugin author will no longer giving support here, however you can still asking for help from other users here.
Pages: [1]
Author Topic: Custom post meta value/taxonomy strangeness
ncjones4
Newbie
Posts: 3
Permalink
Post Custom post meta value/taxonomy strangeness
on: August 26, 2016, 19:56
Quote

Heyo,
Been digging through support posts and stackexchanges for a while trying to solve something, but no dice. Over at https://www.ies.ncsu.edu/courses/ I'm using uwpqsf with a Course custom post type that makes use of a 'Online|Classroom' ACF meta field. Course posts also share a 'Location' taxonomy across several cpts in the site, and for the most part uwpqsf seems to handle the Course search by location fine, with a single exception I'll note in below.

In trying to slice course posts by:
Taxonomy Field (AND)
-----
Location(shared taxo)
Subject(shared term)

and Meta Field (AND)
----
Delivery Option (ACF meta Radio field)

I could never quite get the meta field ACF radio field to filter right. If I use dropdown for the select, it will parse the values into the options box okay and the Ajax results will return ONE post with the 'Online' option, problem being I've got 17 Course posts with Online selected. Filtering on Classroom option gives paginated results okay, so I think it's behaving properly.

But in trying to get the Online courses filtered, 'Online' got added to the Locations list, and appears in the Location taxo list now. And while ACF is using Location for a repeater in the Course Post Type, I'm not trying to go through the repeated field on the filter-- I just limit the filter to Courses cpt, and hit the Location taxo directly.

Except now, even with 17 courses under the 'Online' taxonomy, I get one result.

And funnily enough, the Meta filter returns the same one.

Comparing that single post to the others in the backend w/ 'Online' values, some had no values in a session repeater field, but don't see how that'd have anything to do with the delivery meta field-- Delivery isn't dependent on it, it's just Online or Classroom (or hidden value On-Site) ((Sessions is conditional on Delivery though)). But for the heck of it, I toggled a few fields and dumped values in there so there's at least four at this point that do have the same 'shape'. All of them have the 'Online' taxo selected at this point. Still nothing else turning up in the ajax results.

I tried to point the meta filter at the ACF real field 'field_55896bab25a7f' but that fetches ACF's crazy array:

a:13:{s:3:"key";s:19:"field_55896bab25a7f";s:5:"label";s:15:"Delivery Option";s:4:"name";s:8:"delivery";s:4:"type";s:5:"radio";s:12:"instructions";s:0:"";s:8:"required";s:1:"0";s:7:"choices";a:3:{s:6:"Online";s:6:"Online";s:9:"Classroom";s:9:"Classroom";s:7:"On-site";s:7:"On-site";}s:12:"other_choice";s:1:"0";s:17:"save_other_choice";s:1:"0";s:13:"default_value";s:0:"";s:6:"layout";s:8:"vertical";s:17:"conditional_logic";a:3:{s:6:"status";s:1:"0";s:5:"rules";a:1:{i:0;a:3:{s:5:"field";s:4:"null";s:8:"operator";s:2:"==";s:5:"value";s:0:"";}}s:8:"allorany";s:3:"all";}s:8:"order_no";i:1;}::a:13:{s:3:"key";s:19:"field_55896bab25a7f";s:5:"label";s:15:"Delivery Option";s:4:"name";s:8:"delivery";s:4:"type";s:5:"radio";s:12:"instructions";s:0:"";s:8:"required";s:1:"0";s:7:"choices";a:3:{s:6:"Online";s:6:"Online";s:9:"Classroom";s:9:"Classroom";s:7:"On-site";s:7:"On-site";}s:12:"other_choice";s:1:"0";s:17:"save_other_choice";s:1:"0";s:13:"default_value";s:0:"";s:6:"layout";s:8:"vertical";s:17:"conditional_logic";a:3:{s:6:"status";s:1:"0";s:5:"rules";a:1:{i:0;a:3:{s:5:"field";s:4:"null";s:8:"operator";s:2:"==";s:5:"value";s:0:"";}}s:8:"allorany";s:3:"all";}s:8:"order_no";i:1;}

which is useless.

Complicating this further I'm stuck in a university Multipress environment, so I don't have direct access to nice things like running sql, flushing tables or deleting plugins, but our theme is a child with some customizations I can push changes to, and if I need to I can modify our functions.php or page templates to rig something if you have any ideas.

What I really don't get is how every other Location Taxo seems to filter A-okay, but somehow 'Online' breaks down. I was thinking if I could get the Location taxonomy correctly I could just kill the meta filter and exclude 'Online' from the first Locations dropdown filter, but add a radio toggle separately so it's either ALL COURSES or just those with 'Online' Location.

Thoughts? Ideas? Clues I can continue to dig up?

Thanks!

tck30
Administrator
Posts: 530
Permalink
Post Re: Custom post meta value/taxonomy strangeness
on: August 27, 2016, 17:30
Quote

So, in a nutshell when you choose 'Online' meta field value, you only got 1 result return wheres you have 17 posts that have the meta value 'Online' attached.
Is that right?

Comparing that single post to the others in the backend w/ 'Online' values, some had no values in a session repeater field, but don't see how that'd have anything to do with the delivery meta field-- Delivery isn't dependent on it, it's just Online or Classroom (or hidden value On-Site) ((Sessions is conditional on Delivery though)). But for the heck of it, I toggled a few fields and dumped values in there so there's at least four at this point that do have the same 'shape'. All of them have the 'Online' taxo selected at this point. Still nothing else turning up in the ajax results.

I don't under what is the 'session repeater field'.
But if it is like the name suggested, your 'Online|Classroom' is a repeater field, which is not compatible with this UWPQSF plugin. Maybe this is the problem.
To solve this problem, you can use a taxonomy for ''Online|Classroom' instead of meta field.This is because if you use ACF repeater field in meta value, it will serialized the value and store it in the db. The serialized value is not meant to be searched. But if you use taxonomy for repeater field, then wp will make it stored in single value in the db with relation scheme, and thus can be used for querying. That's also is one significant difference between meta field and taxonomy.

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

Buy Me A Beer! Thanks

ncjones4
Newbie
Posts: 3
Permalink
Post Re: Custom post meta value/taxonomy strangeness
on: August 30, 2016, 15:34
Quote

The Online|Classroom is not a repeater field, it's a radio select field in ACF, should only hold single value, and when running the UWPQSF against the 'Classroom' option I get tons of results, it's only when run against the 'Online' value that it appears to glitch out, which resulted in my trying to run the filter against the Location Taxonomy where it also doesn't work for 'Online' value, but does work on every other location Taxonomy value where there are multiple courses.

So right now 'Online' exists as both a ACF meta field and a Taxonomy and all online course have both 'Online' specified in the meta field and the location taxonomy, but whatever filter I run against 'Online' either the meta field or the taxonomy, I only get one result.

'Sessions' is a repeater field attached to the Course CPT, but I'm not running a filter against it in any instance, I mentioned it because I had seen that there were issues with UWPQSF and the ACF repeater fields, but I have no filters that should even be looking at repeater fields.

tck30
Administrator
Posts: 530
Permalink
Post Re: Custom post meta value/taxonomy strangeness
on: August 30, 2016, 16:32
Quote

Sound like the problem are all with the Online posts. Check the Online posts with the one that shows in the result. See if any differences between the posts. It might have something missing in the posts that make it not visible to the search. It might be other meta fields/taxonomies that present in the that post and not absent in other posts.
Note that the meta field in the search form must be exists in the posts that you want to search. A empty meta field value will make it excluded from the search.

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

Buy Me A Beer! Thanks

ncjones4
Newbie
Posts: 3
Permalink
Post Re: Custom post meta value/taxonomy strangeness
on: September 21, 2016, 20:28
Quote

So in resetting some of the options and building new forms I seemed to have fixed the 'Online' issue, however there's an issue with Admin-Ajax on the site environment where if you're trying to use the wp-admin/admin-ajax.php functionality, if you're not logged into WordPress, then any request to wp-admin dumps you back at index.php

So when using the AJAX option, non-logged in users can't use the search.

I've asked, but they won't be loosening the wp-admin cookie verification, so I cannot use the AJAX option at this point.

Now I'm trying to build a new search.php that will actually return results when the filter is applied. Normal WP search can see the custom post types and the search.php when using that seems to work, but when I actually apply the UWPSQF search it returns no results. Is there a most basic, no styling, no theme function search.php example I can test on my dev site to explore why the default returns nothing, while the AJAX does on the same form instance?

tck30
Administrator
Posts: 530
Permalink
Post Re: Custom post meta value/taxonomy strangeness
on: September 22, 2016, 06:12
Quote
Is there a most basic, no styling, no theme function search.php example I can test on my dev site

There are no such thing as testing search.php. It is the basic wp template that depends on the theme. Every theme has it.

Do you use any other search plugin or Theme My Login plugin? It seem like plugin conflicts. Try deactivate other plugins to see if it is the problem. Better if you can test on wp default theme as well.
If you have use Theme My Login plugin, you can see the solution here.

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

Buy Me A Beer! Thanks

Pages: [1]