久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔
站長百科 | 數(shù)字化技能提升教程 數(shù)字化時代生存寶典
首頁
數(shù)字化百科
電子書
建站程序
開發(fā)
服務(wù)器
辦公軟件
開發(fā)教程
服務(wù)器教程
軟件使用教程
運(yùn)營教程
熱門電子書
WordPress教程
寶塔面板教程
CSS教程
Shopify教程
導(dǎo)航
程序頻道
推廣頻道
網(wǎng)賺頻道
人物頻道
網(wǎng)站程序
網(wǎng)頁制作
云計算
服務(wù)器
CMS
論壇
網(wǎng)店
虛擬主機(jī)
cPanel
網(wǎng)址導(dǎo)航
WIKI使用導(dǎo)航
WIKI首頁
最新資訊
網(wǎng)站程序
站長人物
頁面分類
使用幫助
編輯測試
創(chuàng)建條目
網(wǎng)站地圖
站長百科導(dǎo)航
站長百科
主機(jī)偵探
IDCtalk云說
跨境電商導(dǎo)航
WordPress啦
站長專題
網(wǎng)站推廣
網(wǎng)站程序
網(wǎng)站賺錢
虛擬主機(jī)
cPanel
網(wǎng)址導(dǎo)航專題
云計算
微博營銷
虛擬主機(jī)管理系統(tǒng)
開放平臺
WIKI程序與應(yīng)用
美國十大主機(jī)
編輯“
WordPress:Function Reference/add post meta
”
人物百科
|
營銷百科
|
網(wǎng)賺百科
|
站長工具
|
網(wǎng)站程序
|
域名主機(jī)
|
互聯(lián)網(wǎng)公司
|
分類索引
跳轉(zhuǎn)至:
導(dǎo)航
、?
搜索
警告:
您沒有登錄。如果您做出任意編輯,您的IP地址將會公開可見。如果您
登錄
或
創(chuàng)建
一個賬戶,您的編輯將歸屬于您的用戶名,且將享受其他好處。
因存在沖突的中間編輯,本編輯不能撤銷。
反垃圾檢查。
不要
加入這個!
==描述== [[WordPress:Function Reference/add post meta|add_post_meta]]為某篇文章添加了一個自定義的(meta)區(qū)。 如果<tt>$unique</tt>參數(shù)設(shè)置為<var>true</var>而且已經(jīng)存在特別的meta關(guān)鍵詞,函數(shù)返回<var>false</var>而且不做什么更改;否則的話,函數(shù)返回<var>true</var>。 ==用法== %%% <?php add_post_meta($post_id, $meta_key, $meta_value, $unique); ?> %%% ==例子== ===默認(rèn)用法=== <?php add_post_meta($68, 'my_key', 47); ?> ===添加或者更新一個獨特的區(qū)=== 如果你存在關(guān)鍵詞,添加一個新的field,或者更新現(xiàn)存的field。 <?php add_post_meta(7, 'fruit', 'banana', true) 或者update_post_meta(7, 'fruit', 'banana'); ?> ===其它的例子=== 如果你想要確定沒有帶有關(guān)鍵字''"my_key"''的fieled,添加之前: <?php add_post_meta(68, 'my_key', '47', true); ?> To add several values to the key ''"my_key"'': <pre><?php add_post_meta(68, 'my_key', '47'); ?> <?php add_post_meta(68, 'my_key', '682'); ?> <?php add_post_meta(68, 'my_key', 'The quick, brown fox jumped over the lazy dog.'); ?> ...</pre> 更詳細(xì)的例子,請進(jìn)入[[WordPress:Function Reference/post meta Function Examples|post_meta 函數(shù)例子]]網(wǎng)頁。 === 制作一個 "隱藏的" 自定義區(qū) === 如果你是一個插件/主題開發(fā)人員而且你計劃使用自定義field儲存與你的插件或者主題相關(guān)的參數(shù),你會饒有興趣地發(fā)現(xiàn),WordPress習(xí)慣于顯示網(wǎng)頁/文章編輯網(wǎng)頁中自定義field列表上以"_"(下劃線)開始的關(guān)鍵字。就是說,在自定義參數(shù)中將下劃線設(shè)置為第一個字符,是個很好的做法,這樣你可以將設(shè)置儲存為自定義fields,但是你的設(shè)置不會在管理UI中的自定義fields列表中顯示。 下面的例子: <?php add_post_meta(68, '_color', 'red', true); ?> 會添加一個關(guān)鍵字是 "_color" 的自定義范圍而且這個自定義范圍中的參數(shù)值"red"不會在網(wǎng)頁/文章編輯網(wǎng)頁中顯示。 ==參數(shù)== {{Parameter|$post_id|integer|The ID of the post to which you will add a custom field.}} {{Parameter|$meta_key|string|The key of the custom field you will add.}} {{Parameter|$meta_value|string|The value of the custom field you will add.}} {{Parameter|$unique|boolean|Whether or not you want the key to be unique. When set to true, this will ensure that there is not already a custom field attached to the post with <tt>$meta_key</tt> as it's key, and, if such a field already exists, the key will not be added.|optional|false}} {{Parameter|$post_id|integer|你添加一個自定義范圍的文章的ID。}} {{Parameter|$meta_key|string|你將要添加的自定義field的關(guān)鍵詞。}} {{Parameter|$meta_value|string|你將要添加的自定義field的參數(shù)值。}} {{Parameter|$unique|boolean|你是否想要獨特的關(guān)鍵字。如果設(shè)置為真的,能夠確保不存在文章的關(guān)鍵字with <tt>$meta_key</tt> 如果這個field已經(jīng)存在,這個關(guān)鍵詞就不會得到添加。|optional|false}} ==相關(guān)的== [[WordPress:Function Reference/delete post meta|delete_post_meta()]], [[WordPress:Function Reference/get post meta|get_post_meta()]], [[WordPress:Function Reference/update post meta|update_post_meta()]], [[WordPress:Function Reference/get post custom|get_post_custom()]], [[WordPress:Function Reference/get post custom values|get_post_custom_values()]], [[WordPress:Function Reference/get post custom keys|get_post_custom_keys()]] [[WordPress:Function Reference/delete post meta|delete_post_meta()]], [[WordPress:Function Reference/get post meta|get_post_meta()]], [[WordPress:Function Reference/update post meta|update_post_meta()]], [[WordPress:Function Reference/get post custom|get_post_custom()]], [[WordPress:Function Reference/get post custom values|get_post_custom_values()]], [[WordPress:Function Reference/get post custom keys|get_post_custom_keys()]]
摘要:
請注意,您對站長百科的所有貢獻(xiàn)都可能被其他貢獻(xiàn)者編輯,修改或刪除。如果您不希望您的文字被任意修改和再散布,請不要提交。
您同時也要向我們保證您所提交的內(nèi)容是您自己所作,或得自一個不受版權(quán)保護(hù)或相似自由的來源(參閱
Wordpress-mediawiki:版權(quán)
的細(xì)節(jié))。
未經(jīng)許可,請勿提交受版權(quán)保護(hù)的作品!
取消
編輯幫助
(在新窗口中打開)
本頁使用的模板:
模板:Parameter
(
編輯
)
取自“
http://kktzf.com.cn/wiki/WordPress:Function_Reference/add_post_meta
”