在wordpress,widget函数中,当我在widget函数中只添加了这两句话:
$file = "badge.png";
echo '<img src= "'. WP_PLUGIN_URL.'/ose-firewall/images/'.$file.'" border = "0" />';
它能够在网页上显示图像,但是,当我添加 if...else 时,它不起作用。有人可以帮我吗?
public function widget($args, $instance){
oseFirewall::callLibClass('vsscanner','vsscanner');
$scanner = new vsscanner();
$log = $scanner->getScanninglog();
if (empty($log))
{
$file = "badge.png";
echo '<img src= "'. WP_PLUGIN_URL.'/ose-firewall/images/'.$file.'" border = "0" />';
}