我找到了以下线程:Paragraphs removed when using get_post_custom()?
希望有人能多帮我一点。。
我的代码:
<?php
$post_customs = get_post_custom();
//$post_customs = get_field_objects(\'project_items\');
if(isset($post_customs["project_items"]) && count($post_customs["project_items"]) > 0) {
$project_items = $post_customs["project_items"][0];
$projectItems = explode(":",$project_items);
?>
<?php if(count($projectItems) > 1) {
$totalProjectItems = $projectItems[1];
for($i = 0; $i < $totalProjectItems; $i++) {
?>
<?php $pro_item_post = get_post($post_customs["project_items_".$i."_choose_project_item"][0]); ?>
<div id="proposal_item_<?php echo $i; ?>" class="proposal_item proposals unchecked_item">
<aside class="one_third">
<input type="button" id="<?php echo $post_customs["project_items_".$i."_choose_project_item"][0]; ?>_button" onclick="updateQuote(this)" name="proposal_item" data-name="<?php echo $pro_item_post->post_title; ?>" data-id="<?php echo $post_customs["project_items_".$i."_choose_project_item"][0]; ?>" data-price="<?php echo $post_customs["project_items_".$i."_item_cost"][0]; ?>" data-index="<?php echo $i; ?>" data-checked="0" data-item-id="<?php echo $post_customs[\'project_items_\'.$i.\'_choose_project_item\'][0]; ?>" data-desc="<?php echo str_replace(\'"\', \'\', $post_customs["project_items_".$i."_edit_proposal_item"][0]); ?>" class="unchecked_btn prop_item_btns no_print" />
<div style="float: left">
<h3 style="line-height: 26px;"><?php echo $pro_item_post->post_title; ?></h3>
<h5 style="font-size: 18px; text-align: left; padding: 0; margin: 0; font-weight: bold;"><?php echo $post_customs["project_items_".$i."_item_cost"][0]; ?></h5>
</div>
<div class="clear"></div>
</aside><!--/.one_third -->
<aside class="one_half last">
<?php echo do_shortcode($post_customs["project_items_".$i."_edit_proposal_item"][0]); ?>
</aside><!--/.one_half -->
</div><!-- /.proposal_item -->
<div class="clear"></div>
<?php } } } ?>
我遇到的问题是get\\u post\\u custom从格式中去掉段落标记。有没有办法修改get\\u post\\u自定义以不删除p标记?或者有人可以帮助我将ACF的get\\u field函数的用法转换为更多吗?
谢谢