Skip Navigation

[Resolved] How to filter using custom setting

This support ticket is created 7 years, 6 months 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)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by monicaB 7 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#438255

I have set up a custom taxonomy called "Newsletter Issues". This taxonomy applies to posts. The terms in this taxonomy are "Winter 2016", "Summer 2016", "Spring 2017", etc.

I have created a custom setting in the Settings/General menu that allows the administrator/editor to select which newsletter should be considered the "Current" newsletter. (ie - the "Summer 2016" term in the Newsletter Issues taxonomy would be set as the current newsletter issue)

I am trying to: Filter my newsletter view to only select those posts that have Newsletter Issue taxonomy that matches the "Current" newsletter as selected by that setting. (ie, the view would only display posts now that have "Summer 2016" newsletter taxonomy).

I am not seeing how I can filter by this custom variable that is set in the Settings menu, as those variables are not listed in the filter fields options. Any thoughts?

#438263

Alternatively, is there a better way of approaching this?

#438413

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I need to check if we can use that field in order to Display the data of taxonomy that belongs from your menu settings.

1)
Could you please share problem URL?

2)
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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

#438549

Hi Minesh-

Given this isn't really a problem that I'm experiencing, more of just a coding question, I don't think it would be helpful to have you get on the site at this time.

Essentially what I'm asking is this: Is there a way, in the Views filter process, to access and use information stored in the wp-options table of the database? I know that there are framework integrations that allow this, but give that I have just one such option, it seems like overkill to add another framework. (I'm already using Genesis, btw).

Thanks.

#438575

Minesh
Supporter

Languages: English (English )

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

I can tell you one way using which you can modify the view's query on fly. Basically it will be a PHP hook so you can use PHP to get your option value and modify your view query.

More info:
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

If you need further help with this, please don't hesitate to get in touch with me.

#438578

Thank you, Minesh. This looks promising. I have not used this type of customization, so I will need to read up on how to incorporate this. Are there any tutorials or other documentation (other than the link you sent) explaining how to use these hooks?

#438787

Minesh
Supporter

Languages: English (English )

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

Yes - Indeed, this will require some programming knowledge.

I may help you to fix your issue but you need to give me information about which option value you need to compare with temporary access detail and problem URL.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

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

OR

If you need custom programming for your project, please feel free to contact our certified partners:
=> https://toolset.com/consultant/

#439038

I'm going to go ahead and try some other things, I'll let you know if I still need assistance. Thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.