Home › Forums › Bug Reports › ACF PRO 5.4.0 get_fields('options') BUG › Reply To: ACF PRO 5.4.0 get_fields('options') BUG
Hi @nkals722
Thanks for the bug report.
This issue has now been fixed. Please re-download the plugin files and copy across the api/api-template.php file
or make the following code change on line 267:
} else {
$rows = $wpdb->get_results($wpdb->prepare(
"SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE %s OR option_name LIKE %s",
$post_id . '_%' ,
'_' . $post_id . '_%'
), ARRAY_A);
if( !empty($rows) ) {
foreach( $rows as $row ) {
// vars
$name = $row['option_name'];
$prefix = $post_id . '_';
$_prefix = '_' . $prefix;
// remove prefix from name
if( strpos($name, $prefix) === 0 ) {
$name = substr($name, strlen($prefix));
} elseif( strpos($name, $_prefix) === 0 ) {
$name = '_' . substr($name, strlen($_prefix));
}
$meta[ $name ][] = $row['option_value'];
}
}
}
Cheers
E
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.