久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔
站長百科 | 數(shù)字化技能提升教程 數(shù)字化時代生存寶典
首頁
數(shù)字化百科
電子書
建站程序
開發(fā)
服務器
辦公軟件
開發(fā)教程
服務器教程
軟件使用教程
運營教程
熱門電子書
WordPress教程
寶塔面板教程
CSS教程
Shopify教程
導航
程序頻道
推廣頻道
網(wǎng)賺頻道
人物頻道
網(wǎng)站程序
網(wǎng)頁制作
云計算
服務器
CMS
論壇
網(wǎng)店
虛擬主機
cPanel
網(wǎng)址導航
WIKI使用導航
WIKI首頁
最新資訊
網(wǎng)站程序
站長人物
頁面分類
使用幫助
編輯測試
創(chuàng)建條目
網(wǎng)站地圖
站長百科導航
站長百科
主機偵探
IDCtalk云說
跨境電商導航
WordPress啦
站長專題
網(wǎng)站推廣
網(wǎng)站程序
網(wǎng)站賺錢
虛擬主機
cPanel
網(wǎng)址導航專題
云計算
微博營銷
虛擬主機管理系統(tǒng)
開放平臺
WIKI程序與應用
美國十大主機
編輯“
WordPress:Creating Options Pages
”
人物百科
|
營銷百科
|
網(wǎng)賺百科
|
站長工具
|
網(wǎng)站程序
|
域名主機
|
互聯(lián)網(wǎng)公司
|
分類索引
跳轉至:
導航
、?
搜索
警告:
您沒有登錄。如果您做出任意編輯,您的IP地址將會公開可見。如果您
登錄
或
創(chuàng)建
一個賬戶,您的編輯將歸屬于您的用戶名,且將享受其他好處。
反垃圾檢查。
不要
加入這個!
== Introduction == == 介紹 == Creating custom options panels in WordPress is relatively easy. 在WordPress中創(chuàng)建自定義選項面板,較為簡單。 Firstly, to create the menu item and the new page, see [[WordPress:Adding Administration Menus]]. 首先,請看看[[WordPress:Adding Administration Menus|添加管理菜單]],創(chuàng)建菜單內容和新的頁面。 So long as you stick to this structure, WordPress will handle all of the option creation, update, saving, and redirection for you. It will check permissions, and do all that other magic behind the scenes. 只要你遵循這個結構,WordPress會處理所有的選項創(chuàng)建,更新,保存和更改的內容。WordPress會檢查權限,并且在幕后操作進行許多其它神奇的操作。 == Form Tag == == 表格標簽 == Once you have your page, you need to create an HTML form. Use this code: 創(chuàng)建了網(wǎng)頁后,你就需要創(chuàng)建HTML表格。使用這個代碼: <form method="post" action="options.php"> <form method="post" action="options.php"> == nonce Magic == == nonce Magic == Then after the opening form tag, insert this PHP code: <?php wp_nonce_field('update-options'); ?> 打開表格標簽后,插入這個PHP代碼: <?php wp_nonce_field('update-options'); ?> This will insert two hidden fields which automatically help to check that the user can update options and also redirect the user back to the correct admin page (because the form action is a different page). 這樣會插入兩個隱藏的欄,可以自動地幫助核對,用戶可以更新選項,也可以使用戶返回到當前的管理頁面(因為form action是個不同的頁面)。 == Update Options Button == == 更新選項按鈕 == At this point you may choose to insert the standard Update Options button, the HTML for which is: 這時,你可以選擇插入標準的更新選項按鈕,HTML是: <p class="submit"> <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> </p> <p class="submit"> <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> </p> Note the use of the _e() function to handle translation of the text, see [[WordPress:Localizing WordPress]] for more info. 注意使用the _e() function處理文本翻譯,更多的信息,請看看[[WordPress:Localizing WordPress|WordPress本地化]]。 == Field Names == == Field 名稱 == Use fields with the same names that you want your newly created options (stored in the options table) to be called, for example: 使用欄的名稱,與你希望最新創(chuàng)建的選項(儲存在選項表格中)得到調用的名稱相同,例如: <input type="text" name="new_option_name" value="<?php echo get_option('new_option_name'); ?>" /> <input type="text" name="new_option_name" value="<?php echo get_option('new_option_name'); ?>" /> Note that by using the get_option() function as the value for the field, this will automatically be updated when the options are saved. 注意通過使用get_option()函數(shù)作為欄的參數(shù)值,選項保存的時候,這會自動更新。 == action Field == == action Field == Next, create a hidden field called action containing the value update. <input type="hidden" name="action" value="update" /> 其次,創(chuàng)建創(chuàng)建隱藏的欄called action,包含更新的參數(shù)值。 <input type="hidden" name="action" value="update" /> == page_options Field == == page_options Field == Finally, create a hidden field called page_options containing a comma separated list of all the options in the page that should be written on save. 最后,創(chuàng)建包含用逗號分開的網(wǎng)頁中所有選項的列表,稱為page_options,隱藏的field,編寫這些網(wǎng)頁時,應該保存。 <input type="hidden" name="page_options" value="new_option_name,some_other_option,option_etc" /> <input type="hidden" name="page_options" value="new_option_name,some_other_option,option_etc" /> == Closing Tags == == 關閉標簽== Then obviously close the form tag after your other options, and if you like, include another "Update Options" button, this is the WordPress default. 接著,很明顯,在你的其它選項之后,關閉表格標簽,如果你愿意,可以加上另一個"更新選項"按鈕,這個按鈕是WordPress默認帶有的。 <p class="submit"> <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> </p> </form> <p class="submit"> <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> </p> </form>
摘要:
請注意,您對站長百科的所有貢獻都可能被其他貢獻者編輯,修改或刪除。如果您不希望您的文字被任意修改和再散布,請不要提交。
您同時也要向我們保證您所提交的內容是您自己所作,或得自一個不受版權保護或相似自由的來源(參閱
Wordpress-mediawiki:版權
的細節(jié))。
未經(jīng)許可,請勿提交受版權保護的作品!
取消
編輯幫助
(在新窗口中打開)
取自“
http://kktzf.com.cn/wiki/WordPress:Creating_Options_Pages
”