| 1 |
<?php |
| 2 |
/** |
| 3 |
* Templates |
| 4 |
* |
| 5 |
* @package Gutenify |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Gutenify_Admin_Menu |
| 10 |
*/ |
| 11 |
class Gutenify_Admin_Menu { |
| 12 |
/** |
| 13 |
* Gutenify_Admin_Menu constructor. |
| 14 |
*/ |
| 15 |
public function __construct() { |
| 16 |
// Register custom post type. |
| 17 |
add_action( 'admin_menu', array( $this, 'register_sub_menu' ) ); |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* Register Admin menu. |
| 22 |
*/ |
| 23 |
public function register_sub_menu() { |
| 24 |
add_menu_page( |
| 25 |
__( 'Gutenify: Getting Started' ), |
| 26 |
'Gutenify', |
| 27 |
'manage_options', |
| 28 |
'gutenify', |
| 29 |
array( &$this, 'getting_started_page_callback' ), |
| 30 |
'data:image/svg+xml;base64,' . base64_encode( file_get_contents( GUTENIFY_PLUGIN_DIR . 'assets/images/gutenify-logo.svg' ) ), |
| 31 |
90 |
| 32 |
); |
| 33 |
add_submenu_page( |
| 34 |
'gutenify', |
| 35 |
__( 'Gutenify Template Kits' ), |
| 36 |
__( 'Template Kits' ), |
| 37 |
'manage_options', |
| 38 |
'gutenify-template-kits', |
| 39 |
array( &$this, 'template_kits_page_callback' ) |
| 40 |
); |
| 41 |
// add_submenu_page( 'gutenify', __( 'Gutenify Templates' ), __( 'Templates' ), 'manage_options', 'edit.php?post_type=gutenify_template' ); |
| 42 |
add_submenu_page( |
| 43 |
'gutenify', |
| 44 |
__( 'Gutenify Settings' ), |
| 45 |
__( 'Settings' ), |
| 46 |
'manage_options', |
| 47 |
'gutenify-settings', |
| 48 |
array( &$this, 'settings_page_callback' ) |
| 49 |
); |
| 50 |
// add_submenu_page( |
| 51 |
// 'themes.php', __( 'Gutenify Site Options' ), __( 'Site Options' ), 'manage_options', 'gutenify-site-options', array(&$this, 'site_options_page_callback') |
| 52 |
// ); |
| 53 |
// add_submenu_page('edit.php?post_type=entertainment', 'Genre', 'Genre', 'manage_options', 'edit-tags.php?taxonomy=genre&post_type=entertainment'); |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Render submenu. |
| 58 |
* |
| 59 |
* @return void |
| 60 |
*/ |
| 61 |
public function settings_page_callback() { |
| 62 |
echo '<div class="wrap">'; |
| 63 |
echo '<div id="gutenify-settings-app">Loading...</div>'; |
| 64 |
echo '</div>'; |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Render submenu. |
| 69 |
* |
| 70 |
* @return void |
| 71 |
*/ |
| 72 |
public function template_kits_page_callback() { |
| 73 |
echo '<div class="wrap">'; |
| 74 |
echo '<div id="gutenify-template-kit-app">Loading...</div>'; |
| 75 |
echo '</div>'; |
| 76 |
} |
| 77 |
|
| 78 |
/** |
| 79 |
* Render getting started page.. |
| 80 |
* |
| 81 |
* @return void |
| 82 |
*/ |
| 83 |
public function getting_started_page_callback() { |
| 84 |
echo '<div class="wrap">'; |
| 85 |
echo '<div id="gutenify-getting-started-app">Loading...</div>'; |
| 86 |
echo '</div>'; |
| 87 |
} |
| 88 |
|
| 89 |
/** |
| 90 |
* Render submenu. |
| 91 |
* |
| 92 |
* @return void |
| 93 |
*/ |
| 94 |
public function site_options_page_callback() { |
| 95 |
echo '<div class="wrap">'; |
| 96 |
echo '<div id="gutenify-site-options-app">Loading...</div>'; |
| 97 |
echo '</div>'; |
| 98 |
} |
| 99 |
|
| 100 |
} |
| 101 |
|
| 102 |
new Gutenify_Admin_Menu(); |
| 103 |
|