@@ -26,6 +26,7 @@ |
||
26 | 26 | * Sets up hooks and properties. |
27 | 27 | * |
28 | 28 | * @internal |
29 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
29 | 30 | */ |
30 | 31 | public function __construct( $oFactory ) { |
31 | 32 |
@@ -277,7 +277,7 @@ |
||
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
280 | - /** |
|
280 | + /** |
|
281 | 281 | * Extracts meta box form fields options array from the given options array of an admin page. |
282 | 282 | * |
283 | 283 | * @since 3.5.6 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct( $oFactory ) { |
31 | 31 | |
32 | - if ( ! $this->_shouldProceed( $oFactory ) ) { |
|
32 | + if ( !$this->_shouldProceed( $oFactory ) ) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function _shouldProceed( $oFactory ) { |
56 | 56 | |
57 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
57 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
58 | 58 | return false; |
59 | 59 | } |
60 | - if ( ! $oFactory->oProp->sCallerPath ) { |
|
60 | + if ( !$oFactory->oProp->sCallerPath ) { |
|
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | return 'plugin' === $oFactory->oProp->sScriptType; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | // If the execution flow in the plugin activation hook, schedule flushing rewrite rules. |
90 | - if ( did_action( 'activate_' . plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
90 | + if ( did_action( 'activate_'.plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
91 | 91 | add_action( 'shutdown', array( $this, '_replyToFlushRewriteRules' ) ); |
92 | 92 | } |
93 | 93 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | * @callback action activate_{plugin base name} |
73 | 73 | * @since 3.7.6 |
74 | 74 | */ |
75 | - public function _replyToSetUpPostType() { |
|
75 | + public function _replyToSetUpPostType() { |
|
76 | 76 | do_action( "set_up_{$this->oFactory->oProp->sClassName}", $this ); |
77 | 77 | } |
78 | 78 |
@@ -26,6 +26,7 @@ discard block |
||
26 | 26 | * Sets up hooks and properties. |
27 | 27 | * |
28 | 28 | * @internal |
29 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
29 | 30 | */ |
30 | 31 | public function __construct( $oFactory ) { |
31 | 32 | |
@@ -82,6 +83,7 @@ discard block |
||
82 | 83 | |
83 | 84 | /** |
84 | 85 | * @since 3.7.4 |
86 | + * @param string $sSubMenuSlug |
|
85 | 87 | */ |
86 | 88 | private function _setSubMenuSlugForSorting( $sSubMenuSlug ) { |
87 | 89 | |
@@ -94,6 +96,7 @@ discard block |
||
94 | 96 | |
95 | 97 | /** |
96 | 98 | * @since 3.7.4 |
99 | + * @param string $sSubMenuSlug |
|
97 | 100 | */ |
98 | 101 | private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
99 | 102 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | $this->oFactory = $oFactory; |
33 | 33 | |
34 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
34 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | add_action( |
49 | 49 | 'admin_menu', |
50 | - array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
50 | + array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
51 | 51 | 9999 |
52 | 52 | ); |
53 | 53 | |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | |
63 | 63 | // Check the post type `show_ui` and other related UI arguments. |
64 | 64 | $_bsShowInMeenu = $this->getShowInMenuPostTypeArgument( $this->oFactory->oProp->aPostTypeArgs ); |
65 | - if ( ! $_bsShowInMeenu ) { |
|
65 | + if ( !$_bsShowInMeenu ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | 69 | // If the user sets a menu slug to the 'show_in_menu' argument, use that. |
70 | 70 | // It is used to set a custom post type sub-menu belong to another menu. |
71 | - $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
71 | + $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
72 | 72 | ? $_bsShowInMeenu |
73 | - : 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
73 | + : 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
74 | 74 | |
75 | 75 | // Set the index to the framework specific global array for sorting. |
76 | 76 | $this->_setSubMenuSlugForSorting( $_sSubMenuSlug ); |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | |
132 | 132 | // @remark This is the partial link url set in the third element ( index of 2 ) in the third dimension of submenu global array element. |
133 | 133 | // This is not the submenu slug. |
134 | - $_sLinkSlugManage = 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
134 | + $_sLinkSlugManage = 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
135 | 135 | |
136 | 136 | $_aLinkSlugs = array( |
137 | 137 | $_sLinkSlugManage => $_nSubMenuOrderManage, |
138 | - 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
138 | + 'post-new.php?post_type='.$this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
139 | 139 | ); |
140 | 140 | |
141 | 141 | // If the user does not set a custom value, unset it |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // If the user does not want to show the Add New sub menu, no need to change the order. |
147 | - if ( ! $_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
148 | - unset( $_aLinkSlugs[ 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType ] ); |
|
147 | + if ( !$_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
148 | + unset( $_aLinkSlugs[ 'post-new.php?post_type='.$this->oFactory->oProp->sPostType ] ); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $_aLinkSlugs; |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | */ |
166 | 166 | private function _setSubMenuIndexByLinksSlugs( $sSubMenuSlug, array $aLinkSlugs ) { |
167 | 167 | |
168 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
168 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
169 | 169 | |
170 | - foreach( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
170 | + foreach ( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
171 | 171 | |
172 | 172 | $_bIsSet = $this->_setSubMenuIndexByLinksSlug( $sSubMenuSlug, $_nIndex, $_aSubMenuItem, $_sLinkSlug, $_nOrder ); |
173 | 173 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
194 | 194 | |
195 | 195 | // The third item is the link slug. |
196 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
196 | + if ( !isset( $aSubMenuItem[ 2 ] ) ) { |
|
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @subpackage PostType |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -class AdminPageFramework_PostType_Model__SubMenuOrder extends AdminPageFramework_FrameworkUtility { |
|
18 | +class AdminPageFramework_PostType_Model__SubMenuOrder extends AdminPageFramework_FrameworkUtility { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Stores a post type factory object. |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * @since 3.7.4 |
97 | 97 | */ |
98 | - private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
|
98 | + private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
|
99 | 99 | |
100 | 100 | // Only if custom values are set, set them. |
101 | 101 | $this->_setSubMenuIndexByLinksSlugs( |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
194 | 194 | |
195 | 195 | // The third item is the link slug. |
196 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
196 | + if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @param string $sPluginFilePath The plugin file path. |
39 | 39 | * @param string $sPluginHookPrefix The plugin hook slug without underscore. This will be used to construct hook names. |
40 | 40 | * @param string $sSetUpHook The action hook name for the setUp callback. Default 'plugins_loaded'. |
41 | - * @param string $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
|
41 | + * @param integer $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
|
42 | 42 | */ |
43 | 43 | public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) { |
44 | 44 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param string $sSetUpHook The action hook name for the setUp callback. Default 'plugins_loaded'. |
41 | 41 | * @param string $iPriority The priority. Set a lower number to get loader earlier. Default: `10`. |
42 | 42 | */ |
43 | - public function __construct( $sPluginFilePath, $sPluginHookPrefix='', $sSetUpHook='plugins_loaded', $iPriority=10 ) { |
|
43 | + public function __construct( $sPluginFilePath, $sPluginHookPrefix = '', $sSetUpHook = 'plugins_loaded', $iPriority = 10 ) { |
|
44 | 44 | |
45 | 45 | // Check if it has been loaded. |
46 | 46 | if ( $this->_hasLoaded() ) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) ); |
77 | 77 | |
78 | 78 | // 8. Schedule to load plugin specific components. |
79 | - if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
79 | + if ( !$this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
80 | 80 | $this->_replyToLoadPluginComponents(); |
81 | 81 | } else { |
82 | 82 | add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority ); |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | protected function _registerClasses() { |
117 | 117 | |
118 | 118 | // This class should be used in the framework bootstrap so disabling the auto-load option for performance. |
119 | - if ( ! class_exists( 'AdminPageFramework_RegisterClasses', false ) ) { |
|
119 | + if ( !class_exists( 'AdminPageFramework_RegisterClasses', false ) ) { |
|
120 | 120 | return; |
121 | 121 | } |
122 | 122 | |
123 | 123 | // Register classes |
124 | 124 | new AdminPageFramework_RegisterClasses( |
125 | - $this->getScanningDirs(), // scanning directory paths |
|
126 | - array(), // autoloader options |
|
125 | + $this->getScanningDirs(), // scanning directory paths |
|
126 | + array(), // autoloader options |
|
127 | 127 | $this->getClasses() // pre-generated class list |
128 | 128 | ); |
129 | 129 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | register_deactivation_hook( $this->sFilePath, array( $this, 'replyToPluginDeactivation' ) ); |
77 | 77 | |
78 | 78 | // 8. Schedule to load plugin specific components. |
79 | - if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
79 | + if ( ! $this->sSetUpHook || did_action( $this->sSetUpHook ) ) { |
|
80 | 80 | $this->_replyToLoadPluginComponents(); |
81 | 81 | } else { |
82 | 82 | add_action( $this->sSetUpHook, array( $this, '_replyToLoadPluginComponents' ), $this->iPriority ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | protected function _hasLoaded() { |
101 | 101 | |
102 | 102 | static $_bLoaded = false; |
103 | - if ( $_bLoaded ) { |
|
103 | + if ( $_bLoaded ) { |
|
104 | 104 | return true; |
105 | 105 | } |
106 | 106 | $_bLoaded = true; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | * |
67 | 67 | * @since DEVVER |
68 | 68 | * @see https://codex.wordpress.org/Plugin_API/Admin_Screen_Reference |
69 | - * @param array|strin $asScreenIDs Screen IDs or page slug. |
|
69 | + * @param string[] $asScreenIDs Screen IDs or page slug. |
|
70 | 70 | * @param string $sPointerID A unique pointer ID. |
71 | 71 | * @Param array $aPointerData The pointer data. |
72 | 72 | */ |
@@ -173,7 +173,7 @@ |
||
173 | 173 | get_current_user_id(), |
174 | 174 | 'dismissed_wp_pointers', |
175 | 175 | true |
176 | - ) |
|
176 | + ) |
|
177 | 177 | ); |
178 | 178 | $_aValidPointers = array( |
179 | 179 | 'pointers' => array(), |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function __construct( $asScreenIDs, $sPointerID, array $aPointerData ) { |
63 | 63 | |
64 | 64 | // Bail if the WordPress version is less than 3.3, |
65 | - if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3', '<' ) ) { |
|
65 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.3', '<' ) ) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * |
94 | 94 | */ |
95 | 95 | private function _setHooks( $aScreenIDs ) { |
96 | - foreach( $aScreenIDs as $_sScreenID ) { |
|
96 | + foreach( $aScreenIDs as $_sScreenID ) { |
|
97 | 97 | if ( ! $_sScreenID ) { |
98 | 98 | continue; |
99 | 99 | } |
@@ -112,18 +112,18 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function _setHooks( $aScreenIDs ) { |
114 | 114 | |
115 | - foreach( $aScreenIDs as $_sScreenID ) { |
|
116 | - if ( ! $_sScreenID ) { |
|
115 | + foreach ( $aScreenIDs as $_sScreenID ) { |
|
116 | + if ( !$_sScreenID ) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | add_filter( |
120 | - get_class( $this ) . '-' . $_sScreenID, |
|
120 | + get_class( $this ).'-'.$_sScreenID, |
|
121 | 121 | array( $this, '_replyToSetPointer' ) |
122 | 122 | ); |
123 | 123 | |
124 | 124 | } |
125 | 125 | |
126 | - if ( ! $this->_hasBeenCalled() ) { |
|
126 | + if ( !$this->_hasBeenCalled() ) { |
|
127 | 127 | return; |
128 | 128 | } |
129 | 129 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $_aPointers = $this->_getValidPointers( $this->_getPointers() ); |
172 | 172 | |
173 | - if ( empty( $_aPointers ) || ! is_array( $_aPointers ) ) { |
|
173 | + if ( empty( $_aPointers ) || !is_array( $_aPointers ) ) { |
|
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
@@ -190,11 +190,11 @@ discard block |
||
190 | 190 | $_oScreen = get_current_screen(); |
191 | 191 | $_sScreenID = $_oScreen->id; |
192 | 192 | if ( in_array( $_sScreenID, $this->aScreenIDs ) ) { |
193 | - return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() ); |
|
193 | + return apply_filters( get_class( $this ).'-'.$_sScreenID, array() ); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if ( isset( $_GET[ 'page' ] ) ) { |
197 | - return apply_filters( get_class( $this ) . '-' . $_GET[ 'page' ], array() ); |
|
197 | + return apply_filters( get_class( $this ).'-'.$_GET[ 'page' ], array() ); |
|
198 | 198 | } |
199 | 199 | return array(); |
200 | 200 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | private function _getValidPointers( $_aPointers ) { |
209 | 209 | |
210 | 210 | // Get dismissed pointers |
211 | - $_aDismissed = explode( |
|
211 | + $_aDismissed = explode( |
|
212 | 212 | ',', |
213 | 213 | ( string ) get_user_meta( |
214 | 214 | get_current_user_id(), |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $_aPointer[ 'pointer_id' ] = $_iPointerID; |
237 | 237 | |
238 | 238 | // Add the pointer to $_aValidPointers array |
239 | - $_aValidPointers[] = $_aPointer; |
|
239 | + $_aValidPointers[ ] = $_aPointer; |
|
240 | 240 | |
241 | 241 | } |
242 | 242 | return $_aValidPointers; |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | * @return string |
313 | 313 | * @internal |
314 | 314 | */ |
315 | - public function _getInternalScript( $aPointers=array() ) { |
|
315 | + public function _getInternalScript( $aPointers = array() ) { |
|
316 | 316 | |
317 | - $_aJSArray = json_encode( $aPointers ); |
|
317 | + $_aJSArray = json_encode( $aPointers ); |
|
318 | 318 | |
319 | 319 | /** |
320 | 320 | * Checks check-boxes in siblings. |
@@ -25,6 +25,7 @@ |
||
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Sets up hooks and properties. |
28 | + * @param AdminPageFrameworkLoader_AdminPage $oFactory |
|
28 | 29 | */ |
29 | 30 | public function __construct( $oFactory, array $aPageArguments ) { |
30 | 31 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function __construct( $oFactory, array $aPageArguments ) { |
30 | 30 | |
31 | 31 | $this->oFactory = $oFactory; |
32 | - $this->sPageSlug = $aPageArguments['page_slug']; |
|
32 | + $this->sPageSlug = $aPageArguments[ 'page_slug' ]; |
|
33 | 33 | $this->_addPage( $aPageArguments ); |
34 | 34 | $this->construct( $oFactory ); |
35 | 35 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function replyToLoadResources( $oFactory ) { |
60 | 60 | |
61 | - $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/' . $this->sPageSlug . '.css'; |
|
62 | - if ( ! file_exists( $_sCSSPath ) ) { |
|
61 | + $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/'.$this->sPageSlug.'.css'; |
|
62 | + if ( !file_exists( $_sCSSPath ) ) { |
|
63 | 63 | return; |
64 | 64 | } |
65 | 65 | $this->oFactory->enqueueStyle( |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public function getClasses() { |
32 | 32 | |
33 | 33 | // Include the include lists. The including file reassigns the list(array) to the $_aClassFiles variable. |
34 | - $_aClassFiles = array(); |
|
35 | - include( dirname( $this->sFilePath ) . '/include/loader-class-list.php' ); |
|
34 | + $_aClassFiles = array(); |
|
35 | + include( dirname( $this->sFilePath ).'/include/loader-class-list.php' ); |
|
36 | 36 | $this->_aClassFiles = $_aClassFiles; |
37 | 37 | return $_aClassFiles; |
38 | 38 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ( $_oRequirementCheck->check() ) { |
61 | 61 | $_oRequirementCheck->deactivatePlugin( |
62 | 62 | $this->sFilePath, |
63 | - __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
63 | + __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
64 | 64 | true // is in the activation hook. This will exit the script. |
65 | 65 | ); |
66 | 66 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function setLocalization() { |
76 | 76 | |
77 | 77 | // This plugin does not have messages to be displayed in the front end. |
78 | - if ( ! $this->bIsAdmin ) { |
|
78 | + if ( !$this->bIsAdmin ) { |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | load_plugin_textdomain( |
84 | 84 | AdminPageFrameworkLoader_Registry::TEXT_DOMAIN, |
85 | 85 | false, |
86 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
86 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 | load_plugin_textdomain( |
90 | 90 | 'admin-page-framework', |
91 | 91 | false, |
92 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
92 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
93 | 93 | ); |
94 | 94 | |
95 | 95 | } |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | |
113 | 113 | // Loader plugin admin pages. |
114 | 114 | new AdminPageFrameworkLoader_AdminPage( |
115 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
115 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
116 | 116 | $this->sFilePath // caller script path |
117 | 117 | ); |
118 | 118 | |
119 | 119 | // Network admin pages. |
120 | 120 | if ( is_network_admin() ) { |
121 | 121 | new AdminPageFrameworkLoader_NetworkAdmin( |
122 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
122 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
123 | 123 | $this->sFilePath // caller script path |
124 | 124 | ); |
125 | 125 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | private function _shouldShowAdminPages() { |
141 | 141 | |
142 | - if ( ! $this->bIsAdmin ) { |
|
142 | + if ( !$this->bIsAdmin ) { |
|
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | if ( AdminPageFrameworkLoader_Utility::isSilentMode() ) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | AdminPageFrameworkLoader_Registry::NAME |
59 | 59 | ); |
60 | 60 | |
61 | - if ( $_oRequirementCheck->check() ) { |
|
61 | + if ( $_oRequirementCheck->check() ) { |
|
62 | 62 | $_oRequirementCheck->deactivatePlugin( |
63 | 63 | $this->sFilePath, |
64 | 64 | __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function setLocalization() { |
77 | 77 | |
78 | 78 | // This plugin does not have messages to be displayed in the front end. |
79 | - if ( ! $this->bIsAdmin ) { |
|
79 | + if ( ! $this->bIsAdmin ) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function start() { |
27 | 27 | |
28 | - if ( ! is_admin() ) { |
|
28 | + if ( !is_admin() ) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // When newly installed, the 'welcomed' value is not set. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
50 | + if ( !$_oOption->get( 'welcomed' ) ) { |
|
51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
52 | 52 | $this->_goToWelcomePage(); // will exit |
53 | 53 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | private function _goToWelcomePage() { |
74 | 74 | |
75 | 75 | $_sWelcomePageURL = apply_filters( |
76 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
|
76 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_welcome_redirect_url', |
|
77 | 77 | add_query_arg( |
78 | 78 | array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] ), |
79 | 79 | admin_url( 'index.php' ) // Dashboard |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | public function setUp() { |
94 | 94 | |
95 | 95 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
96 | - if ( ! $_oOption->get( 'enable_admin_pages' ) ) { |
|
96 | + if ( !$_oOption->get( 'enable_admin_pages' ) ) { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
100 | - $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
100 | + $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
101 | 101 | |
102 | 102 | // Root page |
103 | 103 | $this->setRootMenuPage( |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $this->addSubMenuItems( |
109 | 109 | array( |
110 | 110 | 'title' => AdminPageFrameworkLoader_Registry::SHORTNAME, |
111 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
111 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
112 | 112 | 'show_in_menu' => false, |
113 | 113 | 'style' => array( |
114 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/about.css', |
|
115 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css', |
|
116 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.css', |
|
114 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/about.css', |
|
115 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css', |
|
116 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.css', |
|
117 | 117 | version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) |
118 | 118 | ? ".about-wrap .introduction h2 { |
119 | 119 | padding: 1em; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | }", |
128 | 128 | ), |
129 | 129 | 'script' => array( |
130 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.js', |
|
130 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.js', |
|
131 | 131 | "jQuery( document ).ready( function() { |
132 | 132 | jQuery( '.apf-badge-image' ).mflip(); |
133 | 133 | } );", |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it. |
139 | 139 | |
140 | 140 | // Hook |
141 | - add_action( "load_" . $this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
142 | - add_action( "load_" . AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
141 | + add_action( "load_".$this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
142 | + add_action( "load_".AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | |
166 | 166 | $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
167 | 167 | new AdminPageFrameworkLoader_AdminPageWelcome_Welcome( |
168 | - $this, // factory object |
|
169 | - $_sPageSlug, // page slug |
|
168 | + $this, // factory object |
|
169 | + $_sPageSlug, // page slug |
|
170 | 170 | array( |
171 | 171 | 'tab_slug' => 'welcome', |
172 | 172 | // 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
173 | 173 | 'style' => array( |
174 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css', |
|
175 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
174 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css', |
|
175 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
176 | 176 | ), |
177 | 177 | ) |
178 | 178 | ); |
@@ -201,24 +201,24 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function replyToFilterContentTop( $sContent ) { |
203 | 203 | |
204 | - $_sVersion = '- ' . AdminPageFrameworkLoader_Registry::VERSION; |
|
205 | - $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME . ' ' . $_sVersion; |
|
204 | + $_sVersion = '- '.AdminPageFrameworkLoader_Registry::VERSION; |
|
205 | + $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME.' '.$_sVersion; |
|
206 | 206 | |
207 | 207 | $_sBadgeURL = esc_url( AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/icon-128x128.png' ) ); |
208 | 208 | |
209 | 209 | $_aOutput = array(); |
210 | - $_aOutput[] = "<h1>" |
|
210 | + $_aOutput[ ] = "<h1>" |
|
211 | 211 | . sprintf( __( 'Welcome to %1$s', 'admin-page-framework-loader' ), $_sPluginName ) |
212 | 212 | . "</h1>"; |
213 | - $_aOutput[] = "<div class='about-text'>" |
|
213 | + $_aOutput[ ] = "<div class='about-text'>" |
|
214 | 214 | . sprintf( __( 'Thank you for updating to the latest version! %1$s is ready to make your plugin or theme development faster, more organized and better!', 'admin-page-framework-loader' ), $_sPluginName ) |
215 | 215 | . "</div>"; |
216 | - $_aOutput[] = '' |
|
216 | + $_aOutput[ ] = '' |
|
217 | 217 | . "<div class='apf-badge'>" |
218 | 218 | . "<div class='apf-badge-image m-flip'>" |
219 | 219 | . "<img src='{$_sBadgeURL}' />" |
220 | 220 | . "</div>" |
221 | - . "<span class='label'>" . sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion ) . "</span>" |
|
221 | + . "<span class='label'>".sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion )."</span>" |
|
222 | 222 | . "</div>"; |
223 | 223 | |
224 | 224 | return implode( PHP_EOL, $_aOutput ) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // When newly installed, the 'welcomed' value is not set. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
50 | + if ( ! $_oOption->get( 'welcomed' ) ) { |
|
51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
52 | 52 | $this->_goToWelcomePage(); // will exit |
53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - private function _goToWelcomePage() { |
|
73 | + private function _goToWelcomePage() { |
|
74 | 74 | |
75 | 75 | $_sWelcomePageURL = apply_filters( |
76 | 76 | AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function start() { |
20 | 20 | |
21 | - if ( ! $this->oProp->bIsAdmin ) { |
|
21 | + if ( !$this->oProp->bIsAdmin ) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Allows the user to switch the menu visibility. |
26 | - if ( isset( $_GET['enable_apfl_admin_pages'] ) ) { |
|
26 | + if ( isset( $_GET[ 'enable_apfl_admin_pages' ] ) ) { |
|
27 | 27 | |
28 | 28 | // Update the options and reload the page |
29 | 29 | $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
@@ -67,15 +67,15 @@ discard block |
||
67 | 67 | public function setUp() { |
68 | 68 | |
69 | 69 | $_aOptions = $this->oProp->aOptions; |
70 | - $_bAdminPageEnabled = ! is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
71 | - || ( isset( $_aOptions['enable_admin_pages'] ) && $_aOptions['enable_admin_pages'] ); |
|
70 | + $_bAdminPageEnabled = !is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
71 | + || ( isset( $_aOptions[ 'enable_admin_pages' ] ) && $_aOptions[ 'enable_admin_pages' ] ); |
|
72 | 72 | |
73 | 73 | // Set up pages |
74 | 74 | if ( $_bAdminPageEnabled ) { |
75 | 75 | |
76 | 76 | $this->setRootMenuPage( |
77 | - AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
78 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/image/wp-logo_16x16.png', // menu icon |
|
77 | + AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
78 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/image/wp-logo_16x16.png', // menu icon |
|
79 | 79 | 4 // menu position |
80 | 80 | ); |
81 | 81 | |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
87 | 87 | 'title' => __( 'Tools', 'admin-page-framework-loader' ), |
88 | 88 | 'style' => array( |
89 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
90 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
89 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
90 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
91 | 91 | ), |
92 | 92 | ) |
93 | 93 | ); |
94 | 94 | new AdminPageFrameworkLoader_AdminPage_Addon( |
95 | 95 | $this, |
96 | 96 | array( |
97 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
97 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
98 | 98 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
99 | 99 | 'style' => array( |
100 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
101 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
100 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
101 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
102 | 102 | ), |
103 | 103 | ) |
104 | 104 | ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | 'title' => __( 'Help', 'admin-page-framework-loader' ), |
110 | 110 | 'order' => 1000, // to be the last menu item |
111 | 111 | 'style' => array( |
112 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
113 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
112 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
113 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
114 | 114 | ), |
115 | 115 | ) |
116 | 116 | ); |
117 | 117 | |
118 | - add_action( 'load_' . $this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
118 | + add_action( 'load_'.$this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | private function _addActionLinks( $_bAdminPageEnabled, $_aOptions ) { |
130 | 130 | |
131 | - if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
131 | + if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
@@ -152,24 +152,24 @@ discard block |
||
152 | 152 | * @return string |
153 | 153 | */ |
154 | 154 | private function _getAdminURLTools( $_bAdminPageEnabled ) { |
155 | - if ( ! $_bAdminPageEnabled ) { |
|
155 | + if ( !$_bAdminPageEnabled ) { |
|
156 | 156 | return; |
157 | 157 | } |
158 | - $_sLink = esc_url( |
|
158 | + $_sLink = esc_url( |
|
159 | 159 | add_query_arg( |
160 | 160 | array( |
161 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'], |
|
161 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
|
162 | 162 | ), |
163 | 163 | admin_url( 'admin.php' ) |
164 | 164 | ) |
165 | 165 | ); |
166 | - return "<a href='{$_sLink}'>" . __( 'Tools', 'admin-page-framework-loader' ) . "</a>"; |
|
166 | + return "<a href='{$_sLink}'>".__( 'Tools', 'admin-page-framework-loader' )."</a>"; |
|
167 | 167 | } |
168 | 168 | /** |
169 | 169 | * Returns the Enable /Disable Admin Pages link. |
170 | 170 | */ |
171 | 171 | private function _getAdminPageSwitchLink( $bEnabled ) { |
172 | - $_sLink = esc_url( |
|
172 | + $_sLink = esc_url( |
|
173 | 173 | add_query_arg( |
174 | 174 | array( |
175 | 175 | 'enable_apfl_admin_pages' => $bEnabled ? 0 : 1, |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | ) |
178 | 178 | ); |
179 | 179 | return $bEnabled |
180 | - ? "<a href='{$_sLink}'>" . __( 'Disable Admin Pages', 'admin-page-framework-loader' ) . "</a>" |
|
181 | - : "<a href='{$_sLink}'>" . __( 'Enable Admin Pages', 'admin-page-framework-loader' ) . "</a>"; |
|
180 | + ? "<a href='{$_sLink}'>".__( 'Disable Admin Pages', 'admin-page-framework-loader' )."</a>" |
|
181 | + : "<a href='{$_sLink}'>".__( 'Enable Admin Pages', 'admin-page-framework-loader' )."</a>"; |
|
182 | 182 | } |
183 | 183 | /** |
184 | 184 | * Returns the switch link of the demo pages. |
185 | 185 | */ |
186 | - private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions=array() ) { |
|
186 | + private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions = array() ) { |
|
187 | 187 | |
188 | - if ( ! $_bAdminPageEnabled ) { |
|
188 | + if ( !$_bAdminPageEnabled ) { |
|
189 | 189 | return ''; |
190 | 190 | } |
191 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
192 | - $_sLink = esc_url( |
|
191 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
192 | + $_sLink = esc_url( |
|
193 | 193 | add_query_arg( |
194 | 194 | array( |
195 | 195 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | ) |
198 | 198 | ); |
199 | 199 | return $_bEnabled |
200 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
201 | - : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
200 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
201 | + : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
202 | 202 | |
203 | 203 | } |
204 | 204 | |
@@ -214,14 +214,14 @@ discard block |
||
214 | 214 | |
215 | 215 | // Page meta boxes |
216 | 216 | new AdminPageFrameworkLoader_AdminPageMetaBox_Notification( |
217 | - null, // meta box id - passing null will make it auto generate |
|
217 | + null, // meta box id - passing null will make it auto generate |
|
218 | 218 | __( 'Notification', 'admin-page-framework-loader' ), // title |
219 | 219 | array( // page slugs |
220 | 220 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
221 | 221 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], |
222 | 222 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
223 | 223 | ), |
224 | - 'side', // context |
|
224 | + 'side', // context |
|
225 | 225 | 'default' // priority |
226 | 226 | ); |
227 | 227 |
@@ -19,8 +19,8 @@ |
||
19 | 19 | public function replyToLoadPage( $oFactory ) { |
20 | 20 | |
21 | 21 | new AdminPageFrameworkLoader_AdminPage_Addon_Top( |
22 | - $oFactory, // factory object |
|
23 | - $this->sPageSlug, // page slug |
|
22 | + $oFactory, // factory object |
|
23 | + $this->sPageSlug, // page slug |
|
24 | 24 | array( // tab definition |
25 | 25 | 'tab_slug' => 'top', |
26 | 26 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |