Advertisement
daymobrew

Table Sorter plugin - fix wp_enqueue_scripts warning

May 1st, 2015
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.29 KB | None | 0 0
  1. --- table-sorter.orig.php   2015-05-01 13:41:41.000000000 +0100
  2. +++ table-sorter.php    2015-05-01 23:24:18.008095400 +0100
  3. @@ -9,10 +9,14 @@
  4.   * License: Commercial
  5.   */
  6.  
  7. -wp_register_script('table-sorter',plugins_url('table-sorter/jquery.tablesorter.min.js','table-sorter'),array('jquery'));
  8. -wp_enqueue_script('table-sorter-metadata',plugins_url('table-sorter/jquery.metadata.js','table-sorter'),array('table-sorter'));
  9. -wp_enqueue_script('table-sorter-custom-js',plugins_url('table-sorter/wp-script.js','table-sorter'));
  10. -wp_enqueue_style('table-sorter-custom-css',plugins_url('table-sorter/wp-style.css'));
  11. +
  12. +function my_enqueue_scripts() {
  13. +    wp_register_script('table-sorter',plugins_url('table-sorter/jquery.tablesorter.min.js','table-sorter'),array('jquery'));
  14. +    wp_enqueue_script('table-sorter-metadata',plugins_url('table-sorter/jquery.metadata.js','table-sorter'),array('table-sorter'));
  15. +    wp_enqueue_script('table-sorter-custom-js',plugins_url('table-sorter/wp-script.js','table-sorter'));
  16. +    wp_enqueue_style('table-sorter-custom-css',plugins_url('table-sorter/wp-style.css'));
  17. +}
  18. +add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts' );
  19.  
  20.  function my_plugin_menu(){
  21.     add_options_page( 'Table Sorter', 'Table Sorter', 'manage_options', 'table-sorter', 'tablesorter_callback');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement