• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: WordPress get_users meta_query search object value

Resolved: WordPress get_users meta_query search object value

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’m running a query on users and want to include only users who have meta data (page_history) with a specific value. The problem I’m having is that the meta data is an object, and I can’t seem to get the query to check the value of the object:
Here is my meta object:
So I just want to get users if they have the meta data page_history set as ‘custom_post_type’.
Thank you

Answer:

This meta object will be serialized before being stored in the database column. The post-type field after serialization will be like that in DB s:9:"post-type";s:16:"custom_post_type";
You can use LIKE compare to filter it.
You will need to change the number 16 to the custom post type name count.

If you have better answer, please add a comment about this, thank you!

wordpress
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I write CSS selector(s) that apply to table rows for all td elements on that row after a td with a certain class?

01/04/2023

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.