dongnan1899 2013-05-01 03:15
浏览 22
已采纳

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

I am receiving an unexpected T_FUNCTION error. I know this happens usually from missing closing brackets and semi colons within functions. I can't seem to figure out where it is though.

For some reason when the server outputs the error but it never outputs the right line. Is there an online tool that will output the error on the proper line?

Here is the code I am receiving the T_function error on:

/**

 * 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条回答 默认 最新

  • dongwuxie7976 2013-05-01 03:21
    关注

    find 1

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

    no close tag

    find 2

        <?php }  //<<close FUNC
    
    } //<<close class
    
    } // << CLOSE ????  try to del this
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程