Catchable fatal error: Object of class stdClass could not be converted to string in /advanced-custom-fields/core/api.php on line 23
function get_field_reference($field_name, $post_id ) {
// cache
$found = false;
—LINE-23 $cache = wp_cache_get( ‘field_reference/post_id=’ . $post_id . ‘/name=’ . $field_name, ‘acf’, false, $found );
if( $found )
{
return $cache;
}
// vars
$return = ”;
// get field key
if( is_numeric($post_id) )
{
$return = get_post_meta($post_id, ‘_’ . $field_name, true);
}
elseif( strpos($post_id, ‘user_’) !== false )
{
$temp_post_id = str_replace(‘user_’, ”, $post_id);
$return = get_user_meta($temp_post_id, ‘_’ . $field_name, true);
}
else
{
$return = get_option(‘_’ . $post_id . ‘_’ . $field_name);
}
// set cache
wp_cache_set( ‘field_reference/post_id=’ . $post_id . ‘/name=’ . $field_name, $return, ‘acf’ );
// return
return $return;
}