Php 如何在可重用自定义框WordPress中保存可重复字段数据?
您好,我正在使用来自的可重用自定义元数据库。。 这些是我的田地Php 如何在可重用自定义框WordPress中保存可重复字段数据?,php,wordpress,meta-boxes,Php,Wordpress,Meta Boxes,您好,我正在使用来自的可重用自定义元数据库。。 这些是我的田地 array( 'label' => __('Setup Slider', 'crispy' ), 'desc' => __('create your slider image/ text using these repeatable options', 'crispy' ), 'id' => $prefix.'repeatable', 'type' => 'r
array(
'label' => __('Setup Slider', 'crispy' ),
'desc' => __('create your slider image/ text using these repeatable options', 'crispy' ),
'id' => $prefix.'repeatable',
'type' => 'repeatable',
'sanitizer' => array(
'title' => 'sanitize_text_field',
'desc' => 'wp_kses_data'
),
'repeatable_fields' => array (
array(
'label' => __(' Slider Text alignment', 'crispy'),
'id' => 'alignment',
'type' => 'radio',
'options' => array (
'one' => array (
'label' => __('Left', 'crispy' ),
'value' => 'left'
),
'two' => array (
'label' => __('Center', 'crispy' ),
'value' => 'center'
),
'three' => array (
'label' => __('Right', 'crispy' ),
'value' => 'right'
)
)
),
array(
'label' => __('Background Image/pattern', 'crispy' ),
'id' => 'image',
'type' => 'image'
),
array(
'label' => __('Title', 'crispy' ),
'id' => 'title',
'type' => 'text'
),
array(
'label' => __('Description', 'crispy' ),
'id' => 'desc',
'type' => 'textarea'
),
)
),
我的问题是我不知道如何存储字段值。。。谁能解决我的问题
$home_slider_alignment = get_post_meta( $post->ID, 'alignment', true);
我用过这个,但没用!!。。这些字段可以重复,因此值存储在数组中!!。。我不知道如何从该数组中检索存储的值
请帮帮我 它正在工作:)
在此处输入代码
enter code here
<?php
$projectgallery = get_post_meta($post->ID, 'arcadia_well_projectgallery', true); {
echo '<ul class="custom_repeatable">';
foreach ($projectgallery as $project) {
echo '<li>';
foreach($project as $i=>$value) {
echo $value;
}
echo '</li>';
}
echo '</ul>';
}
?>