意外的T_FUNCTION。我不知道问题出在哪里

时间:2013-05-01 03:15:11

标签: php html wordpress wordpress-plugin wordpress-theming

我收到意外的T_FUNCTION错误。我知道这通常发生在函数中缺少右括号和半冒号。我似乎无法弄清楚它在哪里。

由于某种原因,当服务器输出错误但它从不输出正确的行。是否有在线工具可以在正确的行上输出错误?

以下是我收到T_function错误的代码:

/**

 * Add Meta Box to Menu Editor Page.

 *

 *

 * 

 */



if ( !class_exists('JMO_Custom_Nav')) {

    class JMO_Custom_Nav {

        public function add_nav_menu_meta_boxes() {

            add_meta_box(

                'wl_login_nav_link',

                __('WishList Login'),

                array( $this, 'nav_menu_link'),

                'nav-menus',

                'side',

                'low'

            );

        }



        public function nav_menu_link() {

        ?>

            <div id="posttype-wl-login" class="posttypediv">

                <div id="tabs-panel-wishlist-login" class="tabs-panel tabs-panel-active">

                    <ul id ="wishlist-login-checklist" class="categorychecklist form-no-clear">

                         <?php $sections = get_post_meta($post->ID, 'newtheme_section_id', false);



                            foreach( $sections as $section ) { ?>



                        <li>





                            <label class="menu-item-title">

                                <input type="checkbox" class="menu-item-checkbox" name="menu-item[-1][menu-item-object-id]" value="-1"><?php echo $section; ?>

                            </label>

                            <input type="hidden" class="menu-item-type" name="menu-item[-1][menu-item-type]" value="custom">

                            <input type="hidden" class="menu-item-title" name="menu-item[-1][menu-item-title]" value="Login">

                            <input type="hidden" class="menu-item-url" name="menu-item[-1][menu-item-url]" value="<?php echo $section; ?>

                            <input type="hidden" class="menu-item-classes" name="menu-item[-1][menu-item-classes]" value="wl-login-pop">

                        </li>

                        <?php } ?>

                    </ul>

                </div>

                <p class="button-controls">

                    <span class="list-controls">

                        <a href="/wordpress/wp-admin/nav-menus.php?page-tab=all&amp;selectall=1#posttype-page" class="select-all">Select All</a>

                    </span>

                    <span class="add-to-menu">

                        <input type="submit" class="button-secondary submit-add-to-menu right" value="Add to Menu" name="add-post-type-menu-item" id="submit-posttype-wl-login">

                        <span class="spinner"></span>

                    </span>

                </p>

            </div>

        <?php } 

    }

}



$custom_nav = new JMO_Custom_Nav;



add_action('admin_init', array($custom_nav, 'add_nav_menu_meta_boxes'))

1 个答案:

答案 0 :(得分:0)

找到1

<input type="hidden" class="menu-item-url" name="menu-item[-1][menu-item-url]" value="<?php echo $section; ?>

没有关闭标签

找到2

    <?php }  //<<close FUNC

} //<<close class

} // << CLOSE ????  try to del this