回答編集履歴

1

修正

2019/03/22 16:42

投稿

KazuhiroHatano
KazuhiroHatano

スコア7804

test CHANGED
@@ -4,9 +4,11 @@
4
4
 
5
5
  add_action( 'admin_menu',function()use($custom_fields){
6
6
 
7
- foreach($custom_fields as $label=>$keyname){
7
+ foreach($custom_fields as $label=>$key){
8
8
 
9
+ $keyname='post_meta_'.$key;
10
+
9
- add_meta_box( 'post_meta_'.$key, $label, function($post)use($label,keyname){
11
+ add_meta_box( $keyname, $label, function($post)use($label,$keyname){
10
12
 
11
13
  $get_value = get_post_meta( $post->ID, $keyname, true );
12
14