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

WordPress:Function Reference/get post custom keys

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

描述[ ]

返回一個(gè)數(shù)組,包含某篇文章或者網(wǎng)頁的所有自定義fields。也看看get_post_custom()get_post_custom_values()

用法[ ]

%%% <?php get_post_custom_keys($post_id); ?> %%%

例子[ ]

默認(rèn)用法[ ]

下面的例子會(huì)將一個(gè)變數(shù)($custom_field_keys)設(shè)置為一個(gè)數(shù)組,包含當(dāng)前文章的所有自定義fields的關(guān)鍵詞,然后再輸出。

<?php

  $custom_field_keys = get_post_custom_keys();
  foreach ( $custom_field_keys as $key => $value )
    echo $key . " => " . $value . "<br />";

?>

If the post contains custom fields with the keys mykey and yourkey, the output would be:

0 => mykey
1 => yourkey
2 => _edit_last
3 => _edit_lock
4 => _wp_page_template


注:不管一個(gè)關(guān)鍵字分配了多少參數(shù)值(自定義fields),關(guān)鍵字在數(shù)組中只顯示一次。


參數(shù)[ ]

相關(guān)的[ ]

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