Skip to content

Instantly share code, notes, and snippets.

@wadadanet
Created November 15, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wadadanet/34554308b94e3ecbe4286adfd1521ea8 to your computer and use it in GitHub Desktop.
Save wadadanet/34554308b94e3ecbe4286adfd1521ea8 to your computer and use it in GitHub Desktop.
Wordpress 新着情報のカスタムフィールド
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_5dce4992e0efd',
'title' => 'リンクの設定',
'fields' => array(
array(
'key' => 'field_5dce4acaebed8',
'label' => 'リンク先',
'name' => 'link-active',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => '',
'default_value' => 0,
'ui' => 1,
'ui_on_text' => '指定URL',
'ui_off_text' => '詳細ページ',
),
array(
'key' => 'field_5dce4c1debed9',
'label' => 'URL',
'name' => 'url',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5dce4acaebed8',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'news',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
));
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment