我希望有人可以帮助我。下面的代码来自一个 WordPress 插件。从插件选项页面,我输入了一些简单的 html -
<h3>Showname</h3><p>with DJ Top</p>
下面的代码 ($showname) 用于(一个 WordPress 短代码)显示我输入的内容,但它实际上显示 HTML 而不是处理它,即显示 HTML 标题和段落。
谁能指出我的方向,以便 $showname 处理 HTML,而不仅仅是将其逐字打印出来。
非常感谢
抢
function showtime_schedule_handler($atts, $content=null, $code=""){
global $wpdb;
global $showtimeTable;
//Get the current schedule, divided into days
$daysOfTheWeek = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
$schedule = array();
$output = '';
foreach ($daysOfTheWeek as $day) {
//Add this day's shows HTML to the $output array
$showsForThisDay = $wpdb->get_results( $wpdb->prepare ( "SELECT * FROM $showtimeTable WHERE dayOfTheWeek = '$day' ORDER BY startTime" ));
//Check to make sure this day has shows before saving the header
if ($showsForThisDay){
$output .= '<h2>'.$day.'</h2>';
$output .= '<ul class="showtime-schedule">';
foreach ($showsForThisDay as $show){
$showName = $show->showName;
$startClock = $show->startClock;
$endClock = $show->endClock;
$linkURL = $show->linkURL;
if ($linkURL){
$showName = '<a href="'.$linkURL.'">'.$showName.'</a>';
}
$output .= '<li><strong>'.$startClock.'</strong> - <strong>'.$endClock.'</strong>: '.$showName.'</li>';
}
$output .= '</ul>';
}
}
return $output;
}