| @@ -1,17 +1,25 @@ | ||
| 1 | 1 | <?php |
| 2 | +if ( ! defined( 'ABSPATH' ) ) | |
| 3 | + exit; | |
| 2 | 4 | |
| 5 | + if(isset($_GET['page']) && $_GET['page']=='insert-php-code-snippet-manage' ){ | |
| 6 | + ob_start(); | |
| 7 | + } | |
| 8 | + | |
| 9 | +if(isset($_GET['page']) && $_GET['page']=='insert-php-code-snippet-suggest-features' ){ | |
| 10 | + ob_start(); | |
| 11 | +} | |
| 3 | 12 | add_action('admin_menu', 'xyz_ips_menu'); |
| 4 | 13 | |
| 5 | - | |
| 6 | 14 | function xyz_ips_menu(){ |
| 7 | 15 | |
| 8 | - add_menu_page('insert-php-code-snippet', 'XYZ PHP Code', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets',plugins_url('insert-php-code-snippet/images/logo.png')); | |
| 16 | + add_menu_page('insert-php-code-snippet', 'Insert PHP Code Snippet', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets',plugins_url('images/logo.png',XYZ_INSERT_PHP_PLUGIN_FILE)); | |
| 9 | 17 | |
| 10 | 18 | add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets', 'PHPCode Snippets', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets'); |
| 11 | 19 | add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets - Manage settings', 'Settings', 'manage_options', 'insert-php-code-snippet-settings' ,'xyz_ips_settings'); |
| 12 | 20 | add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets - About', 'About', 'manage_options', 'insert-php-code-snippet-about' ,'xyz_ips_about'); |
| 13 | - | |
| 21 | + add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets - Suggest Feature', 'Suggest a Feature', 'manage_options', 'insert-php-code-snippet-suggest-features' ,'xyz_ips_suggest_feature'); | |
| 14 | 22 | } |
| 15 | 23 | |
| 16 | 24 | function xyz_ips_snippets(){ |
| 17 | 25 | $formflag = 0; |
| @@ -27,9 +35,9 @@ | ||
| 27 | 35 | require( dirname( __FILE__ ) . '/footer.php' ); |
| 28 | 36 | $formflag=1; |
| 29 | 37 | } |
| 30 | 38 | if(isset($_GET['action']) && $_GET['action']=='snippet-add' ) |
| 31 | - { | |
| 39 | + { | |
| 32 | 40 | require( dirname( __FILE__ ) . '/header.php' ); |
| 33 | 41 | require( dirname( __FILE__ ) . '/snippet-add.php' ); |
| 34 | 42 | require( dirname( __FILE__ ) . '/footer.php' ); |
| 35 | 43 | $formflag=1; |
| @@ -59,22 +67,25 @@ | ||
| 59 | 67 | require( dirname( __FILE__ ) . '/about.php' ); |
| 60 | 68 | require( dirname( __FILE__ ) . '/footer.php' ); |
| 61 | 69 | } |
| 62 | 70 | |
| 71 | +function xyz_ips_suggest_feature(){ | |
| 72 | + require( dirname( __FILE__ ) . '/header.php' ); | |
| 73 | + require( dirname( __FILE__ ) . '/suggest_feature.php' ); | |
| 74 | + require( dirname( __FILE__ ) . '/footer.php' ); | |
| 75 | +} | |
| 63 | 76 | |
| 64 | 77 | function xyz_ips_add_style_script(){ |
| 65 | - | |
| 78 | + | |
| 66 | 79 | wp_enqueue_script('jquery'); |
| 80 | + $current_version = xyz_ips_plugin_get_version(); | |
| 81 | + // Register and enqueue script with versioning | |
| 82 | + wp_register_script( 'xyz_ips_notice_script', plugins_url ('js/notice.js' , XYZ_INSERT_PHP_PLUGIN_FILE ),array(),$current_version); | |
| 83 | + wp_enqueue_script( 'xyz_ips_notice_script' ); | |
| 67 | 84 | |
| 68 | - wp_register_script( 'xyz_notice_script', plugins_url('insert-php-code-snippet/js/notice.js') ); | |
| 69 | - wp_enqueue_script( 'xyz_notice_script' ); | |
| 70 | - | |
| 71 | 85 | // Register stylesheets |
| 72 | - wp_register_style('xyz_ips_style', plugins_url('insert-php-code-snippet/css/xyz_ips_styles.css')); | |
| 86 | + wp_register_style('xyz_ips_style', plugins_url('css/xyz_ips_styles.css', XYZ_INSERT_PHP_PLUGIN_FILE),array(),$current_version); | |
| 73 | 87 | wp_enqueue_style('xyz_ips_style'); |
| 74 | 88 | } |
| 75 | 89 | add_action('admin_enqueue_scripts', 'xyz_ips_add_style_script'); |
| 76 | 90 | |
| 77 | - | |
| 78 | - | |
| 79 | - | |
| 80 | -?> | |
| 91 | +?> | |