Php 添加\u操作和功能不工作
我添加了以下代码,试图在WordPress插件中向现有函数添加一个表 我试图在下面添加的代码只会在我的站点上产生一个空白页面(即不加载) 代码如下Php 添加\u操作和功能不工作,php,html,wordpress,Php,Html,Wordpress,我添加了以下代码,试图在WordPress插件中向现有函数添加一个表 我试图在下面添加的代码只会在我的站点上产生一个空白页面(即不加载) 代码如下 function my_attendee_form () { $people = array(); $EM_Bookings = $EM_Event->get_bookings(); if (count($EM_Bookings->bookings) > 0) { echo "\n"
function my_attendee_form ()
{
$people = array();
$EM_Bookings = $EM_Event->get_bookings();
if (count($EM_Bookings->bookings) > 0)
{
echo "\n";
?>
<table class="event-attendees">
<tr class="">
<th class="attendee-name">Name</th>
<th class="attendee-country">Golf Link</th>
<th class="attendee-discipline">Handicap</th>
<th class="attendee-status">Home Club</th>
</tr>
<?php
$guest_bookings = get_option('dbem_bookings_registration_disable');
$guest_booking_user = get_option('dbem_bookings_registration_user');
$counter = 0;
foreach ($EM_Bookings as $EM_Booking) {
$attendees_list = "";
$attendees = $EM_Booking->booking_meta['attendees'];
if (!empty($attendees)) {
$attendees_list = "";
foreach ($attendees as $key => $value) {
foreach ($value as $key_attendee => $value_attendee) {
$attendees_list .= "<tr>";
$attendees_list .= "<td>".$value_attendee["attendee_name"]."</td>";
$attendees_list .= "<td>".$value_attendee["golflink"]."</td>";
$attendees_list .= "<td>".$value_attendee["handicap"]."</td>";
$attendees_list .= " <td>".$value_attendee["home_club"]."</td>";
$attendees_list .= "</tr>";
}
}
}
echo $attendees_list;
}
echo "\n";
?>
</table>
<?php
if (count($EM_Bookings->bookings) == 0)
{
echo '<p>No one registered yet... Will you be the first ?</p>'
};
函数我的与会者表单()
{
$people=array();
$EM_Bookings=$EM_Event->get_Bookings();
如果(计数($EM\U预订->预订)>0)
{
回音“\n”;
?>
名称
高尔夫球场
残障
主场俱乐部
第8行:意外的?>
您是否尝试启用WP\u DEBUG
?关于$EM\u Event
您可能需要将其定义为全局变量,全局$EM\u Event;