$base_resources = [
[
'label' => 'Arch(助成金補助金コンサル)',
'img' => get_stylesheet_directory_uri() . '/img/download_btn3.png'
],
[
'label' => 'SentinelOne',
'img' => get_stylesheet_directory_uri() . '/img/download_btn1.png'
],
[
'label' => 'WEB制作・WEB集客',
'img' => get_stylesheet_directory_uri() . '/img/download_btn2.png'
],
[
'label' => 'その他支援',
'img' => get_stylesheet_directory_uri() . '/img/download_btn4.png'
],
];
$resolve_acf_url = static function ($value) {
if (is_array($value)) {
if (!empty($value['url'])) {
return (string) $value['url'];
}
if (!empty($value['ID'])) {
$attachment_url = wp_get_attachment_url((int) $value['ID']);
return $attachment_url ? (string) $attachment_url : '';
}
return '';
}
if (is_numeric($value)) {
$attachment_url = wp_get_attachment_url((int) $value);
return $attachment_url ? (string) $attachment_url : '';
}
return is_string($value) ? $value : '';
};
$resources = [];
foreach ($base_resources as $index => $base) {
$field_no = $index + 1;
$label_field_key = 'download_label_' . $field_no;
$file_field_key = 'download_file_' . $field_no;
$acf_label = function_exists('get_field') ? get_field($label_field_key) : '';
$acf_file = function_exists('get_field') ? get_field($file_field_key) : '';
$label = !empty($acf_label) ? $acf_label : $base['label'];
$url = $resolve_acf_url($acf_file);
$resources[] = [
'label' => $label,
'url' => !empty($url) ? $url : '#',
'img' => $base['img'],
];
}
?>
各サービスの概要や事例をまとめた資料をダウンロードいただけます。
貴社の課題解決や検討の参考にぜひご活用ください。
Warning: Undefined variable $resources in /home/c1112905/public_html/stars-hp.website/wp-content/themes/stars-hp/page-download_resources.php on line 69
Warning: foreach() argument must be of type array|object, null given in /home/c1112905/public_html/stars-hp.website/wp-content/themes/stars-hp/page-download_resources.php on line 69