PluginProbe
BetterLinks – Link Shortener, Link Cloaking, Redirects, Affiliate Link Manager & MCP / trunk
BetterLinks – Link Shortener, Link Cloaking, Redirects, Affiliate Link Manager & MCP vtrunk
3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 3.0.0 2.4.13 2.4.12 2.4.11 2.4.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 110 releases
betterlinks / includes / Admin / Menu.php

Menu.php in BetterLinks – Link Shortener, Link Cloaking, Redirects, Affiliate Link Manager & MCP trunk, at includes/Admin/Menu.php

42 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BetterLinks\Admin;
4 if ( ! defined( 'ABSPATH' ) ) { exit; }
5
6 use BetterLinks\Helper;
7
8 class Menu
9 {
10 /**
11 * add plugin menu page and submenu pages
12 */
13 public function __construct()
14 {
15 add_action('admin_menu', [$this, 'admin_menu']);
16 }
17
18 /**
19 * add admin menu page
20 * @return hooks
21 */
22 public function admin_menu()
23 {
24 add_menu_page(
25 'BetterLinks',
26 sprintf('BetterLinks %1$s', Helper::btl_menu_notice() ? '<span class="btl-menu-notice">1</span>' : ''),
27 apply_filters('betterlinks/admin/menu_capability', 'manage_options'),
28 BETTERLINKS_PLUGIN_SLUG,
29 [$this, 'load_main_template'],
30 BETTERLINKS_ASSETS_URI . 'images/logo.svg',
31 30
32 );
33 foreach (Helper::get_menu_items() as $key => $item) {
34 add_submenu_page(BETTERLINKS_PLUGIN_SLUG, $item['title'], $item['title'], apply_filters("betterlinks/admin/".$key."_menu_capability", $item['capability']), $key, [$this, 'load_main_template']);
35 }
36 }
37 public function load_main_template()
38 {
39 echo '<div id="betterlinksbody" class="betterlinks-body"></div>';
40 }
41 }
42