2014-02-27 93 views
0

我已經使用Wordpress中的PHP創建了多維數組。目前我正在爲WordPress添加管理選項,並在插件選項頁面中創建了幾個輸入。在每個輸入標籤中都需要名稱和值屬性。如何更新多維數組中的值鍵?我有問題更新它。更新多維數組鍵值

$option_settings = (array(
    array('Aries', array(
     array( 'Name'=>'id_name1', 
         'Work'=> 3, 
         'Health'=> 4, 
         'Love'=> 5, 
         'Money'=> 6 
))))); 
add_option('general_settings',$option_settings); 
register_setting('general_settings','general_settings'); 
add_settings_section('main_section','General Settings',array($this,'main_section_cb'), __FILE__); //id, title of section, cb which page ? 
add_settings_field('Workload_rate',"Workload rate: ",array($this,'Workload_rate_setting'),__FILE__,'main_section'); 

public function Workload_rate_setting() 
{ 
echo "<input name='' type='text' value='{$this->options['Workload_rate_setting']}' />"; 
} 

回答

0

php函數var_dump()將幫助您查看變量中的內容。 我建議你在添加設置後在你的陣列上使用它:

var_dump(option_settings);