$field ) { if (is_array($field) and array_key_exists('font_family', $field) ) { $acfb_font_family = $field['font_family']; if ( $acfb_font_family !== "" and $acfb_font_family !== NULL and $acfb_font_family !== 'default' ) { $acfb_families[] = $acfb_font_family; } } } if (!empty($acfb_families)) { $family_merges = join('&family=', $acfb_families); return ""; } else return ""; } function get_family( $family ) { return str_replace('+', " ", $family); } function getCustomField($field_name, $post_id){ $selected_field = get_field($field_name); $selected_field_data = json_decode($selected_field, true); return [ 'type' => $selected_field_data['type'], 'value' => get_field($selected_field_data['name'], $post_id) ]; } // retrieves the attachment ID from the file URL for acf meta gallery function acfb_meta_gallery_get_image_id($acfb_meta_gallery_image_url) { global $wpdb; $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $acfb_meta_gallery_image_url )); return $attachment[0]; }