How to Add Jquery FullCalendar in wp plugin in admin

自古美人都是妖i 提交于 2019-12-12 04:59:52

问题


I m developing a plugin in my plugin file i have registers these files.

 function add_fullcaledar(){
            wp_enqueue_style( 'ui-css', plugins_url( '/css/jquery-ui.min.css', __FILE__ ) );
            wp_enqueue_style( 'full-css', plugins_url( '/css/fullcalendar.css', __FILE__ ) );
            wp_register_script( 'moment-js', plugins_url( '/js/moment.min.js', __FILE__ ) );
            wp_register_script( 'full-js', plugins_url( '/js/fullcalendar.min.js', __FILE__ ) );
            wp_enqueue_script('moment-js');
            wp_enqueue_script('full-js');
 }
 add_action('admin_head', array( $this,'add_fullcaledar'));

In my admin i have loaded a page Calendar where i have coded these lines.

<div id="calender">
          </div>

jQuery(document).ready(function($) {    



          var calendar = jQuery('#calendar').fullCalendar({
            editable: true,
            header: {
             left: 'prev,next today',
             center: 'title',
             right: 'month,agendaWeek,agendaDay'
            }

    }); 


  });

But no error is occurring nor its giving me any error .

来源:https://stackoverflow.com/questions/31263409/how-to-add-jquery-fullcalendar-in-wp-plugin-in-admin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!