Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在Wordpress自定义元字段中插入html代码_Php_Html_Wordpress - Fatal编程技术网

Php 在Wordpress自定义元字段中插入html代码

Php 在Wordpress自定义元字段中插入html代码,php,html,wordpress,Php,Html,Wordpress,我在functions.php文件中创建了自定义元字段。我在这里面临的问题是,当插入和保存html代码(如)时,元框将包含代码,而该框现在只显示使用PHP中的htmlspecialchars()-函数。html代码是如何插入的?感谢快速响应,我刚刚编辑了这个问题以显示html实现HM。可能使用htmlspecialchars()?是的!非常感谢你!你用这么简单的解决方案为我省了很多麻烦和时间。 "example_name" => array( "name" => "example_n

我在functions.php文件中创建了自定义元字段。我在这里面临的问题是,当插入和保存html代码(如
)时,元框将包含代码,而该框现在只显示
使用PHP中的
htmlspecialchars()
-函数。

html代码是如何插入的?感谢快速响应,我刚刚编辑了这个问题以显示html实现HM。可能使用htmlspecialchars()?是的!非常感谢你!你用这么简单的解决方案为我省了很多麻烦和时间。
"example_name" => array(
"name" => "example_name",
"std" => "",
"title" => "Example",
"description" => "Example text")
if($meta_box_value == "")
$meta_box_value = $meta_box['std'];
echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
echo'<h2 style=" margin:0px; padding:0px 3px; font-style:normal; font-family:Tahoma; font-size:13px;font-weight:bold;">'.$meta_box['title'].'</h2>';
echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="95" /><br />';
echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';