PluginProbe
Nested Pages / 1.6.4
Nested Pages v1.6.4
3.3.1 3.2.15 3.2.14 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 All 106 releases
wp-nested-pages / app / Bootstrap.php

Bootstrap.php in Nested Pages 1.6.4, at app/Bootstrap.php

74 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace NestedPages;
4
5 /**
6 * Primary Plugin Bootstrap
7 */
8 class Bootstrap
9 {
10
11 public function __construct()
12 {
13 $this->initializePlugin();
14 add_action( 'wp_loaded', array($this, 'wpLoaded'));
15 add_action( 'init', array($this, 'initializeWordPress') );
16 add_filter( 'plugin_action_links_' . 'wp-nested-pages/nestedpages.php', array($this, 'settingsLink' ) );
17 }
18
19 /**
20 * WP Loaded
21 */
22 public function wpLoaded()
23 {
24 new Activation\Activate;
25 new Redirects;
26 new RedirectsFrontEnd;
27 }
28
29 /**
30 * Initialize Plugin
31 */
32 private function initializePlugin()
33 {
34 new Entities\PostType\RegisterPostTypes;
35 new Entities\Post\PostTrashActions;
36 new Entities\Listing\ListingActions;
37 new Entities\NavMenu\NavMenuActions;
38 new Entities\NavMenu\NavMenuTrashActions;
39 new Form\Events;
40 new Config\Settings;
41 }
42
43 /**
44 * Wordpress Initialization Actions
45 */
46 public function initializeWordPress()
47 {
48 new Entities\AdminMenu\AdminMenu;
49 new Entities\DefaultList\DefaultListFactory;
50 $this->addLocalization();
51 }
52
53 /**
54 * Localization Domain
55 */
56 public function addLocalization()
57 {
58 load_plugin_textdomain(
59 'wp-nested-pages',
60 false,
61 dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages' );
62 }
63
64 /**
65 * Add a link to the settings on the plugin page
66 */
67 public function settingsLink($links)
68 {
69 $settings_link = '<a href="options-general.php?page=nested-pages-settings">' . __('Settings') . '</a>';
70 array_unshift($links, $settings_link);
71 return $links;
72 }
73
74 }