dongpu1881 2014-02-14 02:06
浏览 17

Wordpress插件功能错误?

I recently inherited and transferred a wordpress website that contains various custom plugins. Everything seems to be working correctly except one link in the admin section assocaited with a plugin. The page comes up blank when the link is clicked when it should list all bookings. There are no syntax errors.

I know this is a long shot, but I was wondering if anybody can notice any problems with the below function that handles the page? Any insight would be greatly appreciated.

/**
 *  List all bookings
 */
function admin_list_bookings($class_id = false, $wrapper=true) {
    global $ae_EventManager;
    // View single?
    if (isset($_GET['view_booking']) && is_numeric($_GET['view_booking'])) {    $this->admin_view_booking($_GET['view_booking']); return; }
    // Delete posts?
    if (isset($_POST['DeleteLogs']) && !empty($_POST['sel_bookings']) && is_array($_POST['sel_bookings'])) {
        foreach ($_POST['sel_bookings'] as $delete_id) {
            wp_delete_post($delete_id, true);
        }
        echo '<div class="updated"><p>Selected logs have been deleted.</p></div>'."
";
    }
    // Load all bookings
    $booking_log_type = 'private';
    if (isset($_GET['logtype']))    $booking_log_type = 'any';
    $bookings = get_posts(array(
        'post_type'     => $this->booking_type,
        'numberposts'   => -1,
        'post_status'   => $booking_log_type,
        'post_parent'   => (is_numeric($class_id) ? $class_id : false),
    ));

    // Output
    if ($wrapper) {
    echo '<div class="wrap">'."
";
    echo '<h2>View Class Bookings</h2>'."
";
    echo '<form class="plugin_settings" method="post" action="'.esc_url($_SERVER['REQUEST_URI']).'">'."
";
    echo wp_nonce_field($this->nonce);
    }
    ?>
    <table class="widefat">
      <thead><tr><?php if ($wrapper) {  ?><th><input type="checkbox" id="check_all" /></th><?php    }   ?>
        <th>Date</th><th>Class</th><th>Name</th><th># Seats</th><th>Booking Cost</th><th>Status</th></tr></thead>
      <tbody>
    <?php
    foreach ($bookings as $booking) {
        $booking->post_content = $this->__unserialize($booking->post_content);
        $log = $booking->post_content;
    //          echo '<pre>'; print_r($booking); echo '</pre>';
        $view_link = 'edit.php?post_type='.$ae_EventManager->course_type.'&page&view_booking='.$booking->ID;
        ?>
        <tr>
            <?php   if ($wrapper) {     ?>
            <td class="ctrl"><input type="checkbox" name="sel_bookings[]" value="<?php echo $booking->ID; ?>" /></td>
            <?php   }                   ?>
            <td><a href="<?php echo $view_link; ?>"><?php echo $this->format_time_ago($booking->post_date); ?></a></td>
            <td><?php echo $log['course_name'].'<br />'.date('d-m-Y H:ia', strtotime($log['class_date'].' '.$log['class_time'])); ?></td>
            <td><?php echo $log['tickets'][0]['firstname'].' '.$log['tickets'][0]['lastname']; ?></td>
            <td><?php echo $log['number_seats']; ?></td>
            <td><?php echo '$'.number_format($log['transaction_total'], 2); ?></td>
            <td><?php echo $log['payment_method'].'<br />'.$log['eway_response']['ResponseMessage']; ?></td>
        </tr>
        <?php
    }
    ?>
  • 写回答

1条回答 默认 最新

  • douxing9567 2014-02-14 02:30
    关注

    Just add a closing curly bracket } at the end of admin_list_bookings function

    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法