Skip to content

Instantly share code, notes, and snippets.

@MrFent
Created April 13, 2016 20:08
Show Gist options
  • Save MrFent/af2e1131d8d091372a9066a4e16456fb to your computer and use it in GitHub Desktop.
Save MrFent/af2e1131d8d091372a9066a4e16456fb to your computer and use it in GitHub Desktop.
//line 199, function admin_head() should be changed from this:
function admin_head() {
if ( !isset( $_GET['page'] ) || 'customer-editor' != $_GET['page'] )
return;
wp_enqueue_script( 'jquery-ui-datepicker' );
?>
<style type="text/css" title="currentStyle">
@import "<?php echo $this->plugin_url ?>/assets/css/admin.css";
@import "<?php echo $this->plugin_url ?>/assets/css/datatables.css";
@import "<?php echo $this->plugin_url ?>/assets/css/TableTools.css";
@import "<?php echo $this->plugin_url ?>/assets/css/jquery-ui-1.10.0.custom.min.css";
</style>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.datatables.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.editable.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.datatables.editable.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.editable.datepicker.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.jeditable.checkbox.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/jquery.column.filter.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/ZeroClipboard.js"></script>
<script type="text/javascript" language="javascript" src="<?php echo $this->plugin_url ?>/assets/js/TableTools.min.js"></script>
<?php
}
// To something like this:
function admin_head() {
if ( !isset( $_GET['page'] ) || 'customer-editor' != $_GET['page'] )
return;
wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_style( 'admin.css', plugins_url( '/assets/css/admin.css' , __FILE__ ));
wp_enqueue_style( 'datatables.css', plugins_url( '/assets/css/datatables.css' , __FILE__ ));
wp_enqueue_style( 'TableTools.css', plugins_url( '/assets/css/TableTools.css' , __FILE__ ));
wp_enqueue_style( 'jquery-ui-1.10.0.custom.min.css', plugins_url( '/assets/css/jquery-ui-1.10.0.custom.min.css' , __FILE__ ));
wp_enqueue_script( 'datatables', plugin_dir_url(__FILE__) . 'assets/js/jquery.datatables.js' );
wp_enqueue_script( 'editable', plugin_dir_url(__FILE__) . 'assets/js/jquery.editable.js' );
wp_enqueue_script( 'datatables.editable', plugin_dir_url(__FILE__) . 'assets/js/jquery.datatables.editable.js' );
wp_enqueue_script( 'editable.datepicker', plugin_dir_url(__FILE__) . 'assets/js/jquery.editable.datepicker.js' );
wp_enqueue_script( 'jeditable.checkbox', plugin_dir_url(__FILE__) . 'assets/js/jquery.jeditable.checkbox.js' );
wp_enqueue_script( 'column.filter', plugin_dir_url(__FILE__) . 'assets/js/jquery.column.filter.js' );
wp_enqueue_script( 'ZeroClipboard', plugin_dir_url(__FILE__) . 'assets/js/ZeroClipboard.js' );
wp_enqueue_script( 'TableTools', plugin_dir_url(__FILE__) . 'assets/js/TableTools.min.js' );
}
// Also, on each instance of this:
"sSwfPath": "<?php echo $this->plugin_url ?>/assets/swf/copy_csv_xls_pdf.swf"
Should be changed to this:
"sSwfPath": "<?php echo plugins_url( 'assets/swf/copy_csv_xls_pdf.swf', __FILE__ ); ?>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment