@@ -134,7 +134,7 @@ public function init_post_types() {
134134 'label ' => __ ( 'Changelog ' , 'cbxchangelog ' ),
135135 'description ' => __ ( 'Changelog ' , 'cbxchangelog ' ),
136136 'labels ' => $ labels ,
137- 'supports ' => [ 'title ' , 'editor ' , 'thumbnail ' , 'author ' , 'excerpt ' , 'comments ' ],
137+ // 'supports' => [ 'title', 'editor', 'thumbnail', 'author', 'excerpt', 'comments' ],
138138 'hierarchical ' => false ,
139139 'public ' => true ,
140140 'show_ui ' => true ,
@@ -575,8 +575,12 @@ public function enqueue_scripts( $hook ) {
575575
576576 $ allowed_post_types = CBXChangelogHelper::supported_post_types ();
577577
578+ $ in_footer = array (
579+ 'in_footer ' => true ,
580+ );
581+
578582 if ( in_array ( $ post_type , $ allowed_post_types ) && $ hook == 'edit.php ' && $ page == '' ) {
579- wp_register_script ( 'cbxchangelog-listing ' , $ js_url_part . 'cbxchangelog-listing.js ' , [ 'jquery ' ], $ version , true );
583+ wp_register_script ( 'cbxchangelog-listing ' , $ js_url_part . 'cbxchangelog-listing.js ' , [ 'jquery ' ], $ version , $ in_footer );
580584
581585 wp_localize_script ( 'cbxchangelog-listing ' , 'cbxchangelog_listing ' , apply_filters ( 'cbxchangelog_listing_localize_script ' ,
582586 [
@@ -600,13 +604,13 @@ public function enqueue_scripts( $hook ) {
600604 if ( in_array ( $ post_type , $ allowed_post_types ) && ( $ hook == 'post.php ' || $ hook == 'post-new.php ' ) && $ page == '' ) {
601605 wp_enqueue_script ( 'jquery ' );
602606
603- wp_register_script ( 'pickr ' , $ vendors_url_part . 'pickr/pickr.min.js ' , [], $ version , true );
604- wp_register_script ( 'awesome-notifications ' , $ vendors_url_part . 'awesome-notifications/script.js ' , [], $ version , true );
605- wp_register_script ( 'jquery-mustache ' , $ vendors_url_part . 'mustache/jquery.mustache.js ' , [ 'jquery ' ], $ version , true );
607+ wp_register_script ( 'pickr ' , $ vendors_url_part . 'pickr/pickr.min.js ' , [], $ version , $ in_footer );
608+ wp_register_script ( 'awesome-notifications ' , $ vendors_url_part . 'awesome-notifications/script.js ' , [], $ version , $ in_footer );
609+ wp_register_script ( 'jquery-mustache ' , $ vendors_url_part . 'mustache/jquery.mustache.js ' , [ 'jquery ' ], $ version , $ in_footer );
606610 wp_register_script ( 'mustache ' , $ vendors_url_part . 'mustache/mustache.min.js ' , [
607611 'jquery-mustache ' ,
608612 'jquery '
609- ], $ version , true );
613+ ], $ version , $ in_footer );
610614
611615 wp_register_script ( 'cbxchangelog-edit ' , $ js_url_part . 'cbxchangelog-edit.js ' , [
612616 'jquery ' ,
@@ -619,19 +623,11 @@ public function enqueue_scripts( $hook ) {
619623
620624 'pickr ' ,
621625 'awesome-notifications ' ,
622- ], $ version , true );
626+ ], $ version , $ in_footer );
623627
624628 //$changelog_id = isset($_REQUEST['id'])? absint($_REQUEST['id']) : 0;
625629 $ changelog_id = isset ( $ post ->ID ) ? absint ( $ post ->ID ) : 0 ;
626630
627-
628- /*$import_modal_html = '<div id="changelog_import_modal_wrap" class="cbx-chota">';
629- $import_modal_html .= '<h2>' . esc_html__( 'Import Setting: Json file', 'cbxchangelog' ) . '</h2>';
630- $import_modal_html .= '<form method="post" id="changelog_import_form" data-post-id="' . absint($changelog_id) . '">';
631- $import_modal_html .= '<input type="file" name="file" id="changelog_import_file" data-post-id="' . absint($changelog_id) . '" />';
632- $import_modal_html .= '</form>';
633- $import_modal_html .= '</div>';*/
634-
635631 wp_localize_script ( 'cbxchangelog-edit ' , 'cbxchangelog_edit ' , apply_filters ( 'cbxchangelog_edit_localize_script ' ,
636632 [
637633 'deleteconfirm ' => esc_html__ ( 'Are you sure? ' , 'cbxchangelog ' ),
@@ -702,8 +698,7 @@ public function enqueue_scripts( $hook ) {
702698 //'import_modal_progress' => '<p>' . esc_html__( 'Please wait, importing', 'cbxchangelog' ) . '</p>',
703699 'nonce ' => wp_create_nonce ( 'cbxchangelog_nonce ' ),
704700 'ajaxurl ' => admin_url ( 'admin-ajax.php ' ),
705- ] )
706- );
701+ ] ));
707702
708703
709704 wp_enqueue_media ();
@@ -720,10 +715,8 @@ public function enqueue_scripts( $hook ) {
720715 wp_enqueue_script ( 'pickr ' );
721716 wp_enqueue_script ( 'awesome-notifications ' );
722717
723- // wp_enqueue_script( 'cbxchangelog-edit' );
724718
725719 wp_enqueue_script ( 'cbxchangelog-edit ' );
726-
727720 }//end only for post add/edit screen
728721
729722
0 commit comments