WIKI使用導(dǎo)航
站長百科導(dǎo)航
站長專題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專題
- 云計(jì)算
- 微博營銷
- 虛擬主機(jī)管理系統(tǒng)
- 開放平臺(tái)
- WIKI程序與應(yīng)用
- 美國十大主機(jī)
WordPress:Function Reference/get post custom values
來自站長百科
描述[ ]
返回一個(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()