2016-10-04 130 views
2

我創建一個插件,我試圖在構造使用此代碼:WordPress插件保持垂死

if(!isset($root, $version, $itemID, $codeKey, $authKey, $channelKey)) { 
     wp_die('Missing params in $config for KM_Updates constructor'); 
}else{ 
    echo 'getting here';  
} 

凡它讓垂死的,我贊同一切:

$root = 'localhost/testplugin' 
$version = null 
$itemID = 1 
$codeKey = '00000A' 
$authKey = '123456789qwertyuio' 
$channelKey = 1 

然而,它始終在死亡,即使你的一切都設置了

回答

4

$ version null會給你錯誤的isset依照official link

null是說'這不存在'的PHP方式。所以把它設置爲別的

+0

謝謝!我從中獲得了它,現在一切都像魅力一樣 –