| @@ -52,19 +52,21 @@ | ||
| 52 | 52 | $parent = 'wp-coder'; |
| 53 | 53 | $title = WPCoder::info( 'name' ) . ' version ' . WPCoder::info( 'version' ); |
| 54 | 54 | $main_title = WPCoder::info( 'name' ); |
| 55 | 55 | $menu_title = 'All Codes'; |
| 56 | - $capability = 'unfiltered_html'; | |
| 56 | + $capability = 'manage_options'; | |
| 57 | 57 | $slug = WPCoder::SLUG; |
| 58 | 58 | $url_update = 'https://wpcoder.pro/pricing/?utm_source=wordpress&utm_medium=admin-menu&utm_campaign=upgrade-to-pro'; |
| 59 | 59 | |
| 60 | - add_menu_page( $main_title, $main_title, 'unfiltered_html', $slug, [ __CLASS__, 'plugin_page' ], $icon ); | |
| 60 | + add_menu_page( $main_title, $main_title, 'manage_options', $slug, [ __CLASS__, 'plugin_page' ], $icon ); | |
| 61 | 61 | |
| 62 | 62 | add_submenu_page( $slug, $title, $menu_title, $capability, $slug, [ __CLASS__, 'plugin_page' ] ); |
| 63 | 63 | |
| 64 | 64 | add_submenu_page( $slug, $title, 'Add new', $capability, $slug . '-settings', [ __CLASS__, 'settings' ] ); |
| 65 | + add_submenu_page( $slug, $title, 'Snippets', $capability, $slug . '-snippets', [ __CLASS__, 'snippets' ] ); | |
| 66 | + add_submenu_page( $slug, $title, 'Tools', $capability, $slug . '-tools', [ __CLASS__, 'tools' ] ); | |
| 65 | 67 | add_submenu_page( $slug, $title, 'Global PHP', $capability, $slug . '-global', [ __CLASS__, 'global_php' ] ); |
| 66 | - add_submenu_page( $slug, $title, 'Tools', $capability, $slug . '-tools', [ __CLASS__, 'tools' ] ); | |
| 68 | + add_submenu_page( $slug, $title, 'Import / Export', $capability, $slug . '-import-export', [ __CLASS__, 'import_export' ] ); | |
| 67 | 69 | add_submenu_page( $slug, $title, 'Support', $capability, $slug . '-support', [ __CLASS__, 'support' ] ); |
| 68 | 70 | add_submenu_page( $slug, $title, 'Upgrade to Pro', $capability, $url_update ); |
| 69 | 71 | } |
| 70 | 72 | |
| @@ -87,8 +89,16 @@ | ||
| 87 | 89 | require_once $page_path; |
| 88 | 90 | } |
| 89 | 91 | } |
| 90 | 92 | |
| 93 | + public static function snippets() { | |
| 94 | + $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/3.snippets.php'; | |
| 95 | + | |
| 96 | + if ( file_exists( $page_path ) ) { | |
| 97 | + require_once $page_path; | |
| 98 | + } | |
| 99 | + } | |
| 100 | + | |
| 91 | 101 | public static function global_php() { |
| 92 | 102 | $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/global-php.php'; |
| 93 | 103 | |
| 94 | 104 | if ( file_exists( $page_path ) ) { |
| @@ -96,9 +106,17 @@ | ||
| 96 | 106 | } |
| 97 | 107 | } |
| 98 | 108 | |
| 99 | 109 | public static function tools() { |
| 100 | - $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/3.tools.php'; | |
| 110 | + $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/4.tools.php'; | |
| 111 | + | |
| 112 | + if ( file_exists( $page_path ) ) { | |
| 113 | + require_once $page_path; | |
| 114 | + } | |
| 115 | + } | |
| 116 | + | |
| 117 | + public static function import_export() { | |
| 118 | + $page_path = DashboardHelper::get_folder_path( 'pages' ) . '/4.import-export.php'; | |
| 101 | 119 | |
| 102 | 120 | if ( file_exists( $page_path ) ) { |
| 103 | 121 | require_once $page_path; |
| 104 | 122 | } |