久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔

WordPress:Function Reference/get post custom values

來自站長百科
跳轉(zhuǎn)至: 導(dǎo)航、? 搜索

描述[ ]

返回一個(gè)數(shù)組,包含某篇文章($post_id)某關(guān)鍵字($key)自定義fields的所有參數(shù)值。如果不存在這樣的關(guān)鍵字,或者沒有輸入任何內(nèi)容,不返回任何內(nèi)容。也看看get_post_custom()get_post_custom_keys()。

用法[ ]

%%% <?php get_post_custom_values($key, $post_id); ?> %%%

例子[ ]

默認(rèn)用法[ ]

下面的例子將一個(gè)變數(shù)($mykey_values)設(shè)置為一個(gè)數(shù)組,包含關(guān)鍵字為my_key的當(dāng)前文章的自定義fields的參數(shù)值。

<?php

  $mykey_values = get_post_custom_values('my_key');
  foreach ( $mykey_values as $key => $value ) {
    echo $key . " => " . $value . "<br />"; 
  }

?>

0 => First value with "my_key" as its key
1 => Second value with "my_key" as its key
2 => Third value with "my_key" as its key
etc...

參數(shù)[ ]

相關(guān)的[ ]

add_post_meta(), delete_post_meta(), get_post_meta(), update_post_meta(), get_post_custom(), get_post_custom_keys()