Home › Forums › Backend Issues (wp-admin) › Parsing results of db query › Reply To: Parsing results of db query
Well – I sort of solved this, but I’m still curious as to how to parse the above string. To get around this I used…
global $wpdb;
$query = "
SELECT DISTINCT post_name
FROM $wpdb->posts
WHERE post_title LIKE 'request_status'
";
$result = $wpdb->get_row($query, ARRAY_N);
$field_object = get_field_object($result[0]);
$status_array = $field_object['choices'];
this gives an array of choices from the field object instead of trying to read them from the database
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.