How to Add Jquery FullCalendar in wp plugin in adm

2019-09-18 06:24发布

问题:

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 .