| @@ -1,23 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | if ( ! defined( 'ABSPATH' ) ) |
| 3 | 3 | exit; |
| 4 | - | |
| 5 | -if(isset($_GET['action']) && $_GET['action']=='snippet-status' ){ | |
| 6 | - ob_start(); | |
| 7 | -} | |
| 8 | - | |
| 9 | -if(isset($_GET['action']) && $_GET['action']=='snippet-add' ){ | |
| 10 | - ob_start(); | |
| 11 | -} | |
| 12 | - | |
| 13 | -if(isset($_GET['action']) && $_GET['action']=='snippet-delete' ){ | |
| 14 | - ob_start(); | |
| 15 | -} | |
| 16 | - | |
| 17 | -if(isset($_GET['action']) && $_GET['action']=='snippet-edit' ){ | |
| 18 | - ob_start(); | |
| 19 | -} | |
| 20 | 4 | if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-suggest-features' ){ |
| 21 | 5 | ob_start(); |
| 22 | 6 | } |
| 23 | 7 | if(isset($_GET['page']) && $_GET['page']=='insert-html-snippet-manage' ){ |
| @@ -26,11 +10,11 @@ | ||
| 26 | 10 | add_action('admin_menu', 'xyz_ihs_menu'); |
| 27 | 11 | |
| 28 | 12 | |
| 29 | 13 | function xyz_ihs_menu(){ |
| 30 | - | |
| 31 | - add_menu_page('insert-html-snippet', 'XYZ Html', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets',plugins_url('images/logo.png',XYZ_INSERT_HTML_PLUGIN_FILE)); | |
| 32 | 14 | |
| 15 | + add_menu_page('insert-html-snippet', 'Insert Html Snippet', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets',plugins_url('images/logo.png',XYZ_INSERT_HTML_PLUGIN_FILE)); | |
| 16 | + | |
| 33 | 17 | add_submenu_page('insert-html-snippet-manage', 'HTML Snippets', 'HTML Snippets', 'manage_options', 'insert-html-snippet-manage','xyz_ihs_snippets'); |
| 34 | 18 | add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - Manage settings', 'Settings', 'manage_options', 'insert-html-snippet-settings' ,'xyz_ihs_settings'); |
| 35 | 19 | add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - About', 'About', 'manage_options', 'insert-html-snippet-about' ,'xyz_ihs_about'); |
| 36 | 20 | add_submenu_page('insert-html-snippet-manage', 'HTML Snippets - Suggest Feature', 'Suggest a Feature', 'manage_options', 'insert-html-snippet-suggest-features' ,'xyz_ihs_suggest_feature'); |
| @@ -91,16 +75,17 @@ | ||
| 91 | 75 | |
| 92 | 76 | function xyz_ihs_add_style_script(){ |
| 93 | 77 | |
| 94 | 78 | wp_enqueue_script('jquery'); |
| 79 | + $current_version = xyz_ihs_plugin_get_version(); | |
| 80 | + // Register and enqueue script with versioning | |
| 81 | + wp_register_script( 'xyz_ihs_notice_script', plugins_url('js/notice.js', XYZ_INSERT_HTML_PLUGIN_FILE ),array(),$current_version); | |
| 82 | + wp_enqueue_script( 'xyz_ihs_notice_script' ); | |
| 95 | 83 | |
| 96 | - wp_register_script( 'xyz_notice_script', plugins_url('js/notice.js', XYZ_INSERT_HTML_PLUGIN_FILE )); | |
| 97 | - wp_enqueue_script( 'xyz_notice_script' ); | |
| 98 | 84 | |
| 99 | - | |
| 100 | 85 | // Register stylesheets |
| 101 | - wp_register_style('xyz_ihs_style',plugins_url('css/xyz_ihs_styles.css', XYZ_INSERT_HTML_PLUGIN_FILE )); | |
| 86 | + wp_register_style('xyz_ihs_style',plugins_url('css/xyz_ihs_styles.css', XYZ_INSERT_HTML_PLUGIN_FILE ),array(),$current_version); | |
| 102 | 87 | wp_enqueue_style('xyz_ihs_style'); |
| 103 | 88 | } |
| 104 | 89 | add_action('admin_enqueue_scripts', 'xyz_ihs_add_style_script'); |
| 105 | 90 | |
| 106 | -?> | |
| 91 | +?> | |