PluginProbe
Nested Pages / 1.1.2
Nested Pages v1.1.2
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 / includes / class-nestedpages.php

class-nestedpages.php in Nested Pages 1.1.2, at includes/class-nestedpages.php

87 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Activate and Check Versions
3 require_once('class-np-activate.php');
4
5 // Form Handlers
6 require_once('class-np-handler-sort.php');
7 require_once('class-np-handler-quickedit.php');
8 require_once('class-np-handler-quickedit-redirect.php');
9 require_once('class-np-handler-newredirect.php');
10 require_once('class-np-handler-syncmenu.php');
11 require_once('class-np-handler-nesttoggle.php');
12
13 // Required Classes
14 require_once('class-np-dependencies.php');
15 require_once('class-np-pagelisting.php');
16 require_once('class-np-newpage.php');
17 require_once('class-np-redirects.php');
18 require_once('class-np-posttypes.php');
19 require_once('class-np-settings.php');
20
21 /**
22 * Primary Plugin Class
23 */
24 class NestedPages {
25
26
27 public function __construct()
28 {
29 $this->init();
30 $this->formActions();
31 add_action('init', array($this, 'addLocalization') );
32 add_filter( 'plugin_action_links_' . 'wp-nested-pages/nestedpages.php', array($this, 'settingsLink' ) );
33 }
34
35
36 /**
37 * Initialize Plugin
38 */
39 public function init()
40 {
41 new NP_Activate;
42 new NP_Dependencies;
43 new NP_PageListing;
44 new NP_NewPage;
45 new NP_Redirects;
46 new NP_PostTypes;
47 new NP_Settings;
48 }
49
50
51 /**
52 * Set Form Actions & Handlers
53 */
54 public function formActions()
55 {
56 if ( is_admin() ) {
57 add_action( 'wp_ajax_npsort', 'nestedpages_sort_handler' );
58 add_action( 'wp_ajax_npquickedit', 'nestedpages_quickedit_handler' );
59 add_action( 'wp_ajax_npsyncmenu', 'nestedpages_syncmenu_handler' );
60 add_action( 'wp_ajax_npnesttoggle', 'nestedpages_nesttoggle_handler' );
61 add_action( 'wp_ajax_npquickeditredirect', 'nestedpages_quickedit_redirect_handler' );
62 add_action( 'wp_ajax_npnewredirect', 'nestedpages_new_redirect');
63 }
64 }
65
66
67 /**
68 * Localization Domain
69 */
70 public function addLocalization()
71 {
72 load_plugin_textdomain('nestedpages', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages' );
73 }
74
75
76 /**
77 * Add a link to the settings on the plugin page
78 */
79 public function settingsLink($links)
80 {
81 $settings_link = '<a href="options-general.php?page=nested-pages-settings">' . __('Settings','nestedpages') . '</a>';
82 array_unshift($links, $settings_link);
83 return $links;
84 }
85
86
87 }