誰かがこれで私を助けてくれることを願っています。以下のコードは、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;
}