@@ -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(), |
@@ -91,18 +91,18 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function _setHooks( $aScreenIDs ) { |
93 | 93 | |
94 | - foreach( $aScreenIDs as $_sScreenID ) { |
|
95 | - if ( ! $_sScreenID ) { |
|
94 | + foreach ( $aScreenIDs as $_sScreenID ) { |
|
95 | + if ( !$_sScreenID ) { |
|
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | add_filter( |
99 | - get_class( $this ) . '-' . $_sScreenID, |
|
99 | + get_class( $this ).'-'.$_sScreenID, |
|
100 | 100 | array( $this, '_replyToSetPointer' ) |
101 | 101 | ); |
102 | 102 | |
103 | 103 | } |
104 | 104 | |
105 | - if ( ! $this->_hasBeenCalled() ) { |
|
105 | + if ( !$this->_hasBeenCalled() ) { |
|
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | $_aPointers = $this->_getValidPointers( $this->_getPointers() ); |
149 | 149 | |
150 | - if ( empty( $_aPointers ) || ! is_array( $_aPointers ) ) { |
|
150 | + if ( empty( $_aPointers ) || !is_array( $_aPointers ) ) { |
|
151 | 151 | return; |
152 | 152 | } |
153 | 153 | |
@@ -166,11 +166,11 @@ discard block |
||
166 | 166 | $_oScreen = get_current_screen(); |
167 | 167 | $_sScreenID = $_oScreen->id; |
168 | 168 | if ( in_array( $_sScreenID, $this->aScreenIDs ) ) { |
169 | - return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() ); |
|
169 | + return apply_filters( get_class( $this ).'-'.$_sScreenID, array() ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if ( isset( $_GET[ 'page' ] ) ) { |
173 | - return apply_filters( get_class( $this ) . '-' . $_GET[ 'page' ], array() ); |
|
173 | + return apply_filters( get_class( $this ).'-'.$_GET[ 'page' ], array() ); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | return array(); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | private function _getValidPointers( $_aPointers ) { |
185 | 185 | |
186 | 186 | // Get dismissed pointers |
187 | - $_aDismissed = explode( |
|
187 | + $_aDismissed = explode( |
|
188 | 188 | ',', |
189 | 189 | ( string ) get_user_meta( |
190 | 190 | get_current_user_id(), |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $_aPointer[ 'pointer_id' ] = $_iPointerID; |
213 | 213 | |
214 | 214 | // Add the pointer to $_aValidPointers array |
215 | - $_aValidPointers[] = $_aPointer; |
|
215 | + $_aValidPointers[ ] = $_aPointer; |
|
216 | 216 | |
217 | 217 | } |
218 | 218 | |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | * @since 3.7.0 |
285 | 285 | * @return string |
286 | 286 | */ |
287 | - public function _getInlineScript( $aPointers=array() ) { |
|
287 | + public function _getInlineScript( $aPointers = array() ) { |
|
288 | 288 | |
289 | - $_aJSArray = json_encode( $aPointers ); |
|
289 | + $_aJSArray = json_encode( $aPointers ); |
|
290 | 290 | |
291 | 291 | /** |
292 | 292 | * Checks checkboxes in siblings. |
@@ -134,6 +134,7 @@ discard block |
||
134 | 134 | * Returns a php warning if present. |
135 | 135 | * @since 3.5.3 |
136 | 136 | * @internal |
137 | + * @param string $sType |
|
137 | 138 | * @return string The warning. |
138 | 139 | */ |
139 | 140 | private function _getWarningByType( $sType ) { |
@@ -226,6 +227,7 @@ discard block |
||
226 | 227 | * if it returns non true (false), it stores the subject warning and returns the array holding the warnings. |
227 | 228 | * |
228 | 229 | * @since 3.4.6 |
230 | + * @param string $sFuncName |
|
229 | 231 | * @return array The warning array. |
230 | 232 | */ |
231 | 233 | private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) { |
@@ -285,6 +287,7 @@ discard block |
||
285 | 287 | /** |
286 | 288 | * Deactivates the plugin. |
287 | 289 | * @since 3.4.6 |
290 | + * @param string $sPluginFilePath |
|
288 | 291 | */ |
289 | 292 | public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) { |
290 | 293 |
@@ -278,7 +278,7 @@ |
||
278 | 278 | ? "<strong>" . $this->_sScriptName . "</strong>: " |
279 | 279 | : ''; |
280 | 280 | return $_sScripTitle |
281 | - . implode( '<br />', $_aWarnings ); |
|
281 | + . implode( '<br />', $_aWarnings ); |
|
282 | 282 | |
283 | 283 | } |
284 | 284 |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @since 3.4.6 |
78 | 78 | */ |
79 | - public function __construct( array $aRequirements=array(), $sScriptName='' ) { |
|
79 | + public function __construct( array $aRequirements = array(), $sScriptName = '' ) { |
|
80 | 80 | |
81 | 81 | // Avoid undefined index warnings. |
82 | 82 | $aRequirements = $aRequirements + $this->_aDefaultRequirements; |
83 | 83 | $aRequirements = array_filter( $aRequirements, 'is_array' ); |
84 | - foreach( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
84 | + foreach ( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
85 | 85 | if ( isset( $aRequirements[ $_sName ] ) ) { |
86 | 86 | $aRequirements[ $_sName ] = $aRequirements[ $_sName ] + $this->_aDefaultRequirements[ $_sName ]; |
87 | 87 | } |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | $_aWarnings = array(); |
106 | 106 | |
107 | 107 | // PHP, WordPress, MySQL |
108 | - $_aWarnings[] = $this->_getWarningByType( 'php' ); |
|
109 | - $_aWarnings[] = $this->_getWarningByType( 'wordpress' ); |
|
110 | - $_aWarnings[] = $this->_getWarningByType( 'mysql' ); |
|
108 | + $_aWarnings[ ] = $this->_getWarningByType( 'php' ); |
|
109 | + $_aWarnings[ ] = $this->_getWarningByType( 'wordpress' ); |
|
110 | + $_aWarnings[ ] = $this->_getWarningByType( 'mysql' ); |
|
111 | 111 | |
112 | 112 | // Ensure necessary array elements. |
113 | 113 | $this->_aRequirements = $this->_aRequirements + array( |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | // Check the rest. |
121 | 121 | $_aWarnings = array_merge( |
122 | 122 | $_aWarnings, |
123 | - $this->_checkFunctions( $this->_aRequirements['functions'] ), |
|
124 | - $this->_checkClasses( $this->_aRequirements['classes'] ), |
|
125 | - $this->_checkConstants( $this->_aRequirements['constants'] ), |
|
126 | - $this->_checkFiles( $this->_aRequirements['files'] ) |
|
123 | + $this->_checkFunctions( $this->_aRequirements[ 'functions' ] ), |
|
124 | + $this->_checkClasses( $this->_aRequirements[ 'classes' ] ), |
|
125 | + $this->_checkConstants( $this->_aRequirements[ 'constants' ] ), |
|
126 | + $this->_checkFiles( $this->_aRequirements[ 'files' ] ) |
|
127 | 127 | ); |
128 | 128 | |
129 | 129 | $this->aWarnings = array_filter( $_aWarnings ); // drop empty elements. |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @return string The warning. |
138 | 138 | */ |
139 | 139 | private function _getWarningByType( $sType ) { |
140 | - if ( ! isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
140 | + if ( !isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
141 | 141 | return ''; |
142 | 142 | } |
143 | 143 | if ( $this->_checkPHPVersion( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @since 3.4.6 |
166 | 166 | */ |
167 | 167 | private function _checkWordPressVersion( $sWordPressVersion ) { |
168 | - return version_compare( $GLOBALS['wp_version'], $sWordPressVersion, ">=" ); |
|
168 | + return version_compare( $GLOBALS[ 'wp_version' ], $sWordPressVersion, ">=" ); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | */ |
232 | 232 | private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) { |
233 | 233 | $_aWarnings = array(); |
234 | - foreach( $aSubjects as $_sSubject => $_sWarning ) { |
|
235 | - if ( ! call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
236 | - $_aWarnings[] = sprintf( $_sWarning, $_sSubject ); |
|
234 | + foreach ( $aSubjects as $_sSubject => $_sWarning ) { |
|
235 | + if ( !call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
236 | + $_aWarnings[ ] = sprintf( $_sWarning, $_sSubject ); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function _replyToPrintAdminNotices() { |
256 | 256 | |
257 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
257 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
258 | 258 | if ( empty( $_aWarnings ) ) { |
259 | 259 | return; |
260 | 260 | } |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | */ |
273 | 273 | private function _getWarnings() { |
274 | 274 | |
275 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
275 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
276 | 276 | if ( empty( $_aWarnings ) ) { |
277 | 277 | return ''; |
278 | 278 | } |
279 | - $_sScripTitle = $this->_sScriptName |
|
280 | - ? "<strong>" . $this->_sScriptName . "</strong>: " |
|
279 | + $_sScripTitle = $this->_sScriptName |
|
280 | + ? "<strong>".$this->_sScriptName."</strong>: " |
|
281 | 281 | : ''; |
282 | 282 | |
283 | 283 | return $_sScripTitle |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | * Deactivates the plugin. |
290 | 290 | * @since 3.4.6 |
291 | 291 | */ |
292 | - public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) { |
|
292 | + public function deactivatePlugin( $sPluginFilePath, $sMessage = '', $bIsOnActivation = false ) { |
|
293 | 293 | |
294 | 294 | add_action( 'admin_notices', array( $this, '_replyToPrintAdminNotices' ) ); |
295 | - $this->aWarnings[] = '<strong>' . $sMessage . '</strong>'; |
|
296 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
297 | - if ( ! @include( ABSPATH . '/wp-admin/includes/plugin.php' ) ) { |
|
295 | + $this->aWarnings[ ] = '<strong>'.$sMessage.'</strong>'; |
|
296 | + if ( !function_exists( 'deactivate_plugins' ) ) { |
|
297 | + if ( !@include( ABSPATH.'/wp-admin/includes/plugin.php' ) ) { |
|
298 | 298 | return; |
299 | 299 | } |
300 | 300 | } |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | // Before that, we can display messages to the user. |
305 | 305 | if ( $bIsOnActivation ) { |
306 | 306 | |
307 | - $_sPluginListingPage = add_query_arg( array(), $GLOBALS['pagenow'] ); |
|
308 | - wp_die( $this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
307 | + $_sPluginListingPage = add_query_arg( array(), $GLOBALS[ 'pagenow' ] ); |
|
308 | + wp_die( $this->_getWarnings()."<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
309 | 309 | |
310 | 310 | } |
311 | 311 |
@@ -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( |
@@ -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' ), |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->sTabSlug = $aSectionDefinition[ 'tab_slug' ]; |
48 | 48 | $this->sSectionID = $aSectionDefinition[ 'section_id' ]; |
49 | 49 | |
50 | - if ( ! $this->sSectionID ) { |
|
50 | + if ( !$this->sSectionID ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | $this->_addSection( $oFactory, $sPageSlug, $aSectionDefinition ); |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | |
61 | 61 | add_action( |
62 | 62 | // 'validation_' . $this->sPageSlug . '_' . $this->sTabSlug, |
63 | - 'validation_' . $oFactory->oProp->sClassName . '_' . $this->sSectionID, |
|
63 | + 'validation_'.$oFactory->oProp->sClassName.'_'.$this->sSectionID, |
|
64 | 64 | array( $this, 'validate' ), |
65 | 65 | 10, |
66 | 66 | 4 |
67 | 67 | ); |
68 | 68 | |
69 | 69 | $oFactory->addSettingSections( |
70 | - $sPageSlug, // target page slug |
|
70 | + $sPageSlug, // target page slug |
|
71 | 71 | $aSectionDefinition |
72 | 72 | ); |
73 | 73 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $_aErrors = array(); |
97 | 97 | |
98 | 98 | // An invalid value is found. Set a field error array and an admin notice and return the old values. |
99 | - if ( ! $_bVerified ) { |
|
99 | + if ( !$_bVerified ) { |
|
100 | 100 | $oFactory->setFieldErrors( $_aErrors ); |
101 | 101 | $oFactory->setSettingNotice( __( 'There was something wrong with your input.', 'admin-page-framework-loader' ) ); |
102 | 102 | return $aOldInput; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ? $aTabDefinition[ 'tab_slug' ] |
50 | 50 | : ''; |
51 | 51 | |
52 | - if ( ! $this->sTabSlug ) { |
|
52 | + if ( !$this->sTabSlug ) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ( $aTabDefinition[ 'tab_slug' ] ) { |
74 | 74 | add_action( |
75 | - "load_{$sPageSlug}_{$aTabDefinition['tab_slug']}", |
|
75 | + "load_{$sPageSlug}_{$aTabDefinition[ 'tab_slug' ]}", |
|
76 | 76 | array( $this, 'replyToLoadTab' ) |
77 | 77 | ); |
78 | 78 | add_action( |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | * Stores the option values. |
29 | 29 | */ |
30 | 30 | public $aOptions = array( |
31 | - 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | - 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
31 | + 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | + 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
33 | 33 | 'enable_demo' => false, |
34 | - 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | - 'version_saved' => null, // represents the option version. |
|
34 | + 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | + 'version_saved' => null, // represents the option version. |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @since 3.5.0 |
54 | 54 | */ |
55 | - static public function getInstance( $sOptionKey='' ) { |
|
55 | + static public function getInstance( $sOptionKey = '' ) { |
|
56 | 56 | |
57 | 57 | $sOptionKey = $sOptionKey |
58 | 58 | ? $sOptionKey |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __construct( $sOptionKey ) { |
75 | 75 | |
76 | - $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
76 | + $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
77 | 77 | $this->sOptionKey = $sOptionKey; |
78 | 78 | $this->aOptions = $this->_getFormattedOptions( $sOptionKey ); |
79 | 79 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function hasUpgraded() { |
100 | 100 | |
101 | - $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | - if ( ! $_sOptionVersion ) { |
|
101 | + $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | + if ( !$_sOptionVersion ) { |
|
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | $_sOptionVersion = $this->_getVersionByDepth( $_sOptionVersion ); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * Returns a stating part of version by the given depth. |
112 | 112 | * @since 3.5.0 |
113 | 113 | */ |
114 | - private function _getVersionByDepth( $sVersion, $iDepth=2 ) { |
|
115 | - if ( ! $iDepth ) { |
|
114 | + private function _getVersionByDepth( $sVersion, $iDepth = 2 ) { |
|
115 | + if ( !$iDepth ) { |
|
116 | 116 | return $sVersion; |
117 | 117 | } |
118 | 118 | $_aParts = explode( '.', $sVersion ); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Saves the options. |
134 | 134 | */ |
135 | - public function save( $aOptions=null ) { |
|
135 | + public function save( $aOptions = null ) { |
|
136 | 136 | |
137 | 137 | $_aOptions = $aOptions ? $aOptions : $this->aOptions; |
138 | 138 | return $this->bIsNetworkAdmin |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function set( /* $asKeys, $mValue */ ) { |
153 | 153 | |
154 | - $_aParameters = func_get_args(); |
|
155 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
154 | + $_aParameters = func_get_args(); |
|
155 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
156 | 156 | return; |
157 | 157 | } |
158 | 158 | $_asKeys = $_aParameters[ 0 ]; |
159 | 159 | $_mValue = $_aParameters[ 1 ]; |
160 | 160 | |
161 | 161 | // string, integer, float, boolean |
162 | - if ( ! is_array( $_asKeys ) ) { |
|
162 | + if ( !is_array( $_asKeys ) ) { |
|
163 | 163 | $this->aOptions[ $_asKeys ] = $_mValue; |
164 | 164 | return; |
165 | 165 | } |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function update( /* $asKeys, $mValue */ ) { |
176 | 176 | |
177 | - $_aParameters = func_get_args(); |
|
178 | - call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
177 | + $_aParameters = func_get_args(); |
|
178 | + call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
179 | 179 | $this->save(); |
180 | 180 | |
181 | 181 | } |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | |
190 | 190 | $_mDefault = null; |
191 | 191 | $_aKeys = func_get_args(); |
192 | - if ( ! isset( $_aKeys[ 0 ] ) ) { |
|
192 | + if ( !isset( $_aKeys[ 0 ] ) ) { |
|
193 | 193 | return null; |
194 | 194 | } |
195 | 195 | if ( is_array( $_aKeys[ 0 ] ) ) { |
196 | - $_aKeys = $_aKeys[ 0 ]; |
|
196 | + $_aKeys = $_aKeys[ 0 ]; |
|
197 | 197 | $_mDefault = isset( $_aKeys[ 1 ] ) |
198 | 198 | ? $_aKeys[ 1 ] |
199 | 199 | : null; |
@@ -123,7 +123,7 @@ |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $GLOBALS, |
47 | 47 | array( 'aAdminPageFramework', 'aPageClasses', $this->sClassName ) |
48 | 48 | ), |
49 | - 'options_' . $this->sClassName, // options_{instantiated class name} |
|
49 | + 'options_'.$this->sClassName, // options_{instantiated class name} |
|
50 | 50 | $this->sOptionKey |
51 | 51 | ? get_site_option( $this->sOptionKey, array() ) |
52 | 52 | : array() |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @since 3.1.1 Made it return a boolean value. |
65 | 65 | * @return boolean True if saved; otherwise, false. |
66 | 66 | */ |
67 | - public function updateOption( $aOptions=null ) { |
|
67 | + public function updateOption( $aOptions = null ) { |
|
68 | 68 | |
69 | 69 | if ( $this->_bDisableSavingOptions ) { |
70 | 70 | return; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | parent::__construct( $oProp ); |
29 | 29 | |
30 | - if ( ! $this->oProp->bIsAdmin ) { |
|
30 | + if ( !$this->oProp->bIsAdmin ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | |
39 | 39 | // 3.7.10+ |
40 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
40 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function _isInThePage() { |
52 | 52 | |
53 | - if ( ! $this->oProp->bIsAdmin ) { |
|
53 | + if ( !$this->oProp->bIsAdmin ) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | public function _replyToSetUpHooks( $oFactory ) { |
72 | 72 | |
73 | 73 | // Hooks to display fields. |
74 | - add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
75 | - add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
76 | - add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
74 | + add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
75 | + add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
76 | + add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
77 | 77 | |
78 | 78 | // Hooks to save field values. |
79 | 79 | add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
80 | - add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
81 | - add_action('user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
80 | + add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
81 | + add_action( 'user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
82 | 82 | |
83 | 83 | } |
84 | 84 |