@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | public function __construct( $oProp ) { |
142 | 142 | |
143 | 143 | // Set sub-class names. |
144 | - foreach( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
145 | - $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix . $this->_sStructureType; |
|
144 | + foreach ( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
145 | + $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix.$this->_sStructureType; |
|
146 | 146 | } |
147 | 147 | $this->aSubClassNames = $this->aSubClassNames + $this->_aSubClassNames; |
148 | 148 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // Required sub-class objects |
162 | 162 | $this->oProp = $oProp; |
163 | 163 | |
164 | - if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
|
164 | + if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) { |
|
165 | 165 | if ( did_action( 'current_screen' ) ) { |
166 | 166 | $this->_replyToLoadComponents(); |
167 | 167 | } else { |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // Call the user constructor. |
173 | - $this->start(); // defined in the controller class. |
|
174 | - $this->oUtil->addAndDoAction( $this, 'start_' . $this->oProp->sClassName, $this ); |
|
173 | + $this->start(); // defined in the controller class. |
|
174 | + $this->oUtil->addAndDoAction( $this, 'start_'.$this->oProp->sClassName, $this ); |
|
175 | 175 | |
176 | 176 | } |
177 | 177 | |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function _replyToLoadComponents( /* $oScreen */ ) { |
186 | 186 | |
187 | - if ( ! $this->_isInThePage() ) { |
|
187 | + if ( !$this->_isInThePage() ) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
191 | - if ( ! isset( $this->oResource ) ) { |
|
191 | + if ( !isset( $this->oResource ) ) { |
|
192 | 192 | $this->oResource = $this->_replyTpSetAndGetInstance_oResource(); |
193 | 193 | } |
194 | 194 | |
195 | - if ( ! isset( $this->oLink ) ) { |
|
195 | + if ( !isset( $this->oLink ) ) { |
|
196 | 196 | $this->oLink = $this->_replyTpSetAndGetInstance_oLink(); |
197 | 197 | } |
198 | 198 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function _replyToDetermineToLoad() { |
242 | 242 | |
243 | - if ( ! $this->_isInThePage() ) { |
|
243 | + if ( !$this->_isInThePage() ) { |
|
244 | 244 | return; |
245 | 245 | } |
246 | 246 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | // Set and return the sub class object instance. |
313 | 313 | if ( isset( $this->aSubClassNames[ $sPropertyName ] ) ) { |
314 | 314 | return call_user_func( |
315 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
315 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
316 | 316 | ); |
317 | 317 | } |
318 | 318 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function _replyTpSetAndGetInstance_oMsg() { |
348 | 348 | $this->oMsg = call_user_func_array( |
349 | - array( $this->aSubClassNames[ 'oMsg' ], 'getInstance'), |
|
349 | + array( $this->aSubClassNames[ 'oMsg' ], 'getInstance' ), |
|
350 | 350 | array( $this->oProp->sTextDomain ) // parameters |
351 | 351 | ); |
352 | 352 | return $this->oMsg; |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * |
412 | 412 | * @internal |
413 | 413 | */ |
414 | - public function __call( $sMethodName, $aArguments=null ) { |
|
414 | + public function __call( $sMethodName, $aArguments = null ) { |
|
415 | 415 | |
416 | 416 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
417 | 417 | |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | |
442 | 442 | // Check if the method name does not contain a backslash. |
443 | 443 | if ( false === strpos( $sMethodName, "\\" ) ) { |
444 | - return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
444 | + return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | // If the method name contains a backslash, the user may be using a name space. |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | array( $this, $_sAutoCallbackMethodName ), |
453 | 453 | $aArguments |
454 | 454 | ) |
455 | - : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
455 | + : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
456 | 456 | |
457 | 457 | } |
458 | 458 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | */ |
463 | 463 | private function _triggerUndefinedMethodWarning( $sMethodName ) { |
464 | 464 | trigger_error( |
465 | - AdminPageFramework_Registry::NAME . ': ' |
|
465 | + AdminPageFramework_Registry::NAME.': ' |
|
466 | 466 | . sprintf( |
467 | 467 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
468 | 468 | $sMethodName |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
165 | 165 | if ( did_action( 'current_screen' ) ) { |
166 | 166 | $this->_replyToLoadComponents(); |
167 | - } else { |
|
167 | + } else { |
|
168 | 168 | add_action( 'current_screen', array( $this, '_replyToLoadComponents' ) ); |
169 | 169 | } |
170 | 170 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function _replyToLoadComponents( /* $oScreen */ ) { |
186 | 186 | |
187 | - if ( ! $this->_isInThePage() ) { |
|
187 | + if ( ! $this->_isInThePage() ) { |
|
188 | 188 | return; |
189 | 189 | } |
190 | 190 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @since 3.1.0 |
212 | 212 | * @internal |
213 | 213 | */ |
214 | - protected function _isInstantiatable() { |
|
214 | + protected function _isInstantiatable() { |
|
215 | 215 | return true; |
216 | 216 | } |
217 | 217 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @todo Change the visibility scope to `protected` as the public version of the method `isInThePage()` has been introduced to make the design consitent. |
227 | 227 | * @internal |
228 | 228 | */ |
229 | - public function _isInThePage() { |
|
229 | + public function _isInThePage() { |
|
230 | 230 | return true; |
231 | 231 | } |
232 | 232 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function _replyToDetermineToLoad() { |
242 | 242 | |
243 | - if ( ! $this->_isInThePage() ) { |
|
243 | + if ( ! $this->_isInThePage() ) { |
|
244 | 244 | return; |
245 | 245 | } |
246 | 246 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * |
412 | 412 | * @internal |
413 | 413 | */ |
414 | - public function __call( $sMethodName, $aArguments=null ) { |
|
414 | + public function __call( $sMethodName, $aArguments=null ) { |
|
415 | 415 | |
416 | 416 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
417 | 417 |
@@ -39,16 +39,16 @@ |
||
39 | 39 | * @since 3.7.4 Changed the default capability value to `read`. |
40 | 40 | * @todo Examine the appropriate default capability level. |
41 | 41 | */ |
42 | - public function __construct( $sCapability='read', $sTextDomain='admin-page-framework' ) { |
|
42 | + public function __construct( $sCapability = 'read', $sTextDomain = 'admin-page-framework' ) { |
|
43 | 43 | |
44 | 44 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
45 | 45 | ? $this->aSubClassNames[ 'oProp' ] |
46 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
46 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
47 | 47 | $this->oProp = new $_sProprtyClassName( |
48 | - $this, // the caller object |
|
49 | - get_class( $this ), // the caller class name |
|
50 | - $sCapability, // the capability level |
|
51 | - $sTextDomain, // the text domain |
|
48 | + $this, // the caller object |
|
49 | + get_class( $this ), // the caller class name |
|
50 | + $sCapability, // the capability level |
|
51 | + $sTextDomain, // the text domain |
|
52 | 52 | $this->_sStructureType // the structure type |
53 | 53 | ); |
54 | 54 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Defines the field type slugs used for this field type. |
23 | 23 | */ |
24 | - public $aFieldTypeSlugs = array( 'media', ); |
|
24 | + public $aFieldTypeSlugs = array( 'media',); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Defines the default key-values of this field type. |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return |
54 | 54 | $this->_getScript_MediaUploader( |
55 | 55 | "admin_page_framework" |
56 | - ) . PHP_EOL |
|
56 | + ).PHP_EOL |
|
57 | 57 | . $this->_getScript_RegisterCallbacks(); |
58 | 58 | } |
59 | 59 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
149 | 149 | |
150 | 150 | // If the WordPress version is 3.4.x or below |
151 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
151 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
152 | 152 | return <<<JAVASCRIPTS |
153 | 153 | /** |
154 | 154 | * Bind/rebinds the thickbox script the given selector element. |
@@ -388,10 +388,10 @@ discard block |
||
388 | 388 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
389 | 389 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
390 | 390 | // which causes the PHP syntax error. |
391 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ) . '"'; |
|
392 | - $_sRpeatable = $this->getAOrB( ! empty( $abRepeatable ), 'true', 'false' ); |
|
391 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ).'"'; |
|
392 | + $_sRpeatable = $this->getAOrB( !empty( $abRepeatable ), 'true', 'false' ); |
|
393 | 393 | $_sExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
394 | - $_sScript = <<<JAVASCRIPTS |
|
394 | + $_sScript = <<<JAVASCRIPTS |
|
395 | 395 | if ( jQuery( 'a#select_media_{$sInputID}' ).length == 0 ) { |
396 | 396 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
397 | 397 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | . '/* <![CDATA[ */' |
405 | 405 | . $_sScript |
406 | 406 | . '/* ]]> */' |
407 | - . "</script>". PHP_EOL; |
|
407 | + . "</script>".PHP_EOL; |
|
408 | 408 | |
409 | 409 | } |
410 | 410 | /** |
@@ -414,19 +414,19 @@ discard block |
||
414 | 414 | */ |
415 | 415 | private function _getUploaderButtonHTML_Media( $sInputID, array $aButtonAttributes, $bExternalSource ) { |
416 | 416 | |
417 | - $_bIsLabelSet = isset( $aButtonAttributes['data-label'] ) && $aButtonAttributes['data-label']; |
|
417 | + $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
|
418 | 418 | $_aAttributes = $this->_getFormattedUploadButtonAttributes_Media( |
419 | 419 | $sInputID, |
420 | 420 | $aButtonAttributes, |
421 | 421 | $_bIsLabelSet, |
422 | 422 | $bExternalSource |
423 | 423 | ); |
424 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
424 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
425 | 425 | . $this->getAOrB( |
426 | 426 | $_bIsLabelSet, |
427 | - $_aAttributes['data-label'], |
|
427 | + $_aAttributes[ 'data-label' ], |
|
428 | 428 | $this->getAOrB( |
429 | - strrpos( $_aAttributes['class'], 'dashicons' ), |
|
429 | + strrpos( $_aAttributes[ 'class' ], 'dashicons' ), |
|
430 | 430 | '', |
431 | 431 | $this->oMsg->get( 'select_file' ) |
432 | 432 | ) |
@@ -441,26 +441,26 @@ discard block |
||
441 | 441 | */ |
442 | 442 | private function _getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource ) { |
443 | 443 | |
444 | - $_aAttributes = array( |
|
444 | + $_aAttributes = array( |
|
445 | 445 | 'id' => "select_media_{$sInputID}", |
446 | 446 | 'href' => '#', |
447 | - 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
448 | - 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
447 | + 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
448 | + 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
449 | 449 | ) |
450 | 450 | + $aButtonAttributes |
451 | 451 | + array( |
452 | 452 | 'title' => $_bIsLabelSet |
453 | - ? $aButtonAttributes['data-label'] |
|
453 | + ? $aButtonAttributes[ 'data-label' ] |
|
454 | 454 | : $this->oMsg->get( 'select_file' ), |
455 | 455 | 'data-label' => null, |
456 | 456 | ); |
457 | - $_aAttributes['class'] = $this->getClassAttribute( |
|
457 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
458 | 458 | 'select_media button button-small ', |
459 | 459 | $this->getAOrB( |
460 | - trim( $aButtonAttributes['class'] ), |
|
461 | - $aButtonAttributes['class'], |
|
460 | + trim( $aButtonAttributes[ 'class' ] ), |
|
461 | + $aButtonAttributes[ 'class' ], |
|
462 | 462 | $this->getAOrB( |
463 | - ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ), |
|
463 | + !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ), |
|
464 | 464 | 'dashicons dashicons-portfolio', |
465 | 465 | '' |
466 | 466 | ) |
@@ -190,7 +190,7 @@ |
||
190 | 190 | * @return void |
191 | 191 | */ |
192 | 192 | static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
193 | - if ( ! is_admin() ) { |
|
193 | + if ( ! is_admin() ) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | 196 | self::$_aAdminNotices[] = array( |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.8.0'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.8.0'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
57 | 57 | */ |
58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
62 | 62 | * |
63 | 63 | * @remark The ending underscore is not necessary. |
64 | 64 | */ |
65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The text domain slug and its path. |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | static public $aAdminPages = array( |
118 | 118 | // key => 'page slug' |
119 | - 'about' => 'apfl_about', // the welcome page |
|
119 | + 'about' => 'apfl_about', // the welcome page |
|
120 | 120 | 'addon' => 'apfl_addons', |
121 | 121 | 'tool' => 'apfl_tools', |
122 | 122 | 'help' => 'apfl_contact', |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | * @since 3.5.0 |
155 | 155 | * @return string |
156 | 156 | */ |
157 | - public static function getPluginURL( $sRelativePath='' ) { |
|
157 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
158 | 158 | if ( isset( self::$_sPluginURLCache ) ) { |
159 | - return self::$_sPluginURLCache . $sRelativePath; |
|
159 | + return self::$_sPluginURLCache.$sRelativePath; |
|
160 | 160 | } |
161 | 161 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
163 | 163 | } |
164 | 164 | /** |
165 | 165 | * @since 3.7.9 |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | * @since 3.5.0 |
190 | 190 | * @return void |
191 | 191 | */ |
192 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
193 | - if ( ! is_admin() ) { |
|
192 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
193 | + if ( !is_admin() ) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | - self::$_aAdminNotices[] = array( |
|
196 | + self::$_aAdminNotices[ ] = array( |
|
197 | 197 | 'message' => $sMessage, |
198 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
198 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
199 | 199 | ); |
200 | 200 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | * @return void |
206 | 206 | */ |
207 | 207 | static public function _replyToSetAdminNotice() { |
208 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
208 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
210 | 210 | ."<p>" |
211 | 211 | . sprintf( |
212 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
213 | - self::NAME . ' ' . self::VERSION |
|
212 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
213 | + self::NAME.' '.self::VERSION |
|
214 | 214 | ) |
215 | 215 | . "</p>" |
216 | 216 | . "</div>"; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
223 | 223 | |
224 | 224 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
225 | -if ( ! defined( 'ABSPATH' ) ) { |
|
225 | +if ( !defined( 'ABSPATH' ) ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | if ( defined( 'DOING_UNINSTALL' ) ) { |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | |
235 | 235 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
236 | 236 | if ( |
237 | - ! $_bFrameworkLoaded |
|
238 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
237 | + !$_bFrameworkLoaded |
|
238 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
239 | 239 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
240 | 240 | ) { |
241 | 241 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
254 | 254 | |
255 | 255 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
256 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
256 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
257 | 257 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
258 | 258 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
259 | 259 | include( |
260 | 260 | $_bLoadDevelopmentVersion |
261 | 261 | ? $_sDevelopmentVersionPath |
262 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
262 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
263 | 263 | ); |
264 | 264 | |
265 | 265 | // Include the framework loader plugin components. |
266 | 266 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
267 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
267 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
268 | 268 | new AdminPageFrameworkLoader_Bootstrap( |
269 | 269 | AdminPageFrameworkLoader_Registry::$sFilePath, |
270 | 270 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | parent::__construct( $oProp ); |
30 | 30 | |
31 | - if ( ! $this->oProp->bIsAdmin ) { |
|
31 | + if ( !$this->oProp->bIsAdmin ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ); |
40 | 40 | |
41 | 41 | add_action( |
42 | - 'set_up_' . $this->oProp->sClassName, |
|
42 | + 'set_up_'.$this->oProp->sClassName, |
|
43 | 43 | array( $this, '_replyToSetUpHooks' ) |
44 | 44 | ); |
45 | 45 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | return true; |
60 | 60 | } |
61 | 61 | |
62 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
62 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | |
66 | - if ( isset( $_GET[ 'taxonomy' ] ) && ! in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
66 | + if ( isset( $_GET[ 'taxonomy' ] ) && !in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
67 | 67 | return false; |
68 | 68 | } |
69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function _replyToSetUpHooks( $oFactory ) { |
82 | 82 | |
83 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | + foreach ( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
84 | 84 | |
85 | 85 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
86 | 86 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | public function _replyToSetUpHooks( $oFactory ) { |
82 | 82 | |
83 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | + foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
84 | 84 | |
85 | 85 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
86 | 86 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -173,6 +173,7 @@ |
||
173 | 173 | * |
174 | 174 | * @internal |
175 | 175 | * @since 3.5.3 |
176 | + * @param integer $iObjectID |
|
176 | 177 | * @return void |
177 | 178 | */ |
178 | 179 | private function _updateMetaDatumByFuncitonName( $iObjectID, $_vValue, array $aSavedMeta, $_sSectionOrFieldID, $_sFunctionName ) { |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * The callback function name or the callable object to retrieve meta data. |
25 | 25 | */ |
26 | - protected $osCallable = 'get_post_meta'; |
|
26 | + protected $osCallable = 'get_post_meta'; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * The object ID such as post ID, user ID, and term ID. |
30 | 30 | */ |
31 | - public $iObjectID = 0; |
|
31 | + public $iObjectID = 0; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * A form fieldsets array. |
35 | 35 | */ |
36 | - public $aFieldsets = array(); |
|
36 | + public $aFieldsets = array(); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Sets up properties. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function get() { |
59 | 59 | |
60 | - if ( ! $this->iObjectID ) { |
|
60 | + if ( !$this->iObjectID ) { |
|
61 | 61 | return array(); |
62 | 62 | } |
63 | 63 | return $this->_getSavedDataFromFieldsets( |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | |
77 | 77 | $_aMetaKeys = $this->_getMetaKeys( $iObjectID ); |
78 | 78 | $_aMetaData = array(); |
79 | - foreach( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
79 | + foreach ( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
80 | 80 | |
81 | - if ( '_default' == $_sSectionID ) { |
|
82 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
83 | - if ( ! in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
81 | + if ( '_default' == $_sSectionID ) { |
|
82 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
83 | + if ( !in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | $_aMetaData[ $_aFieldset[ 'field_id' ] ] = call_user_func_array( |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ); |
94 | 94 | } |
95 | 95 | } |
96 | - if ( ! in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
96 | + if ( !in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
97 | 97 | continue; |
98 | 98 | } |
99 | 99 | $_aMetaData[ $_sSectionID ] = call_user_func_array( |
@@ -60,10 +60,6 @@ discard block |
||
60 | 60 | * ` |
61 | 61 | * @since DEVVER |
62 | 62 | * @access public |
63 | - * @param string $sMessage the text message to be displayed. |
|
64 | - * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
65 | - * @param array $asAttributes (optional) the tag attribute array applied to the message container HTML element. If a string is given, it is used as the ID attribute value. |
|
66 | - * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
|
67 | 63 | * @return void |
68 | 64 | */ |
69 | 65 | public function set( $aErrors ) { |
@@ -107,7 +103,6 @@ discard block |
||
107 | 103 | * Retrieves the settings error array set by the user in the validation callback. |
108 | 104 | * |
109 | 105 | * @since DEVVER |
110 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
111 | 106 | * @return array |
112 | 107 | */ |
113 | 108 | public function get() { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
47 | 47 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
48 | 48 | $_sUserID = get_current_user_id(); |
49 | - return "apf_fe_" . md5( |
|
49 | + return "apf_fe_".md5( |
|
50 | 50 | $_sPageNow |
51 | 51 | . $_sPageSlug |
52 | 52 | . $_sTabSlug |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function get() { |
135 | 135 | |
136 | 136 | // Use a cache if exists. |
137 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
137 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
138 | 138 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
139 | 139 | : $this->getTransient( $this->sTransientKey ); |
140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @since 3.7.0 |
152 | 152 | */ |
153 | 153 | public function delete() { |
154 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
154 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
155 | 155 | return; |
156 | 156 | } |
157 | 157 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |
@@ -112,7 +112,7 @@ |
||
112 | 112 | * @return void |
113 | 113 | */ |
114 | 114 | public function _replyToSave() { |
115 | - if ( empty( self::$_aErrors ) ) { |
|
115 | + if ( empty( self::$_aErrors ) ) { |
|
116 | 116 | return; |
117 | 117 | } |
118 | 118 | $this->setTransient( |
@@ -196,7 +196,6 @@ |
||
196 | 196 | * For common hooks throughout the other factory components, see [Base Factory](./package-AdminPageFramework.Common.Factory.html). |
197 | 197 | * |
198 | 198 | * <h3>Factory Specific Hooks</h3> |
199 | - |
|
200 | 199 | * <h4> Action Hooks</h4> |
201 | 200 | * <ul> |
202 | 201 | * <li>**load_{page slug}** – [2.1.0+] triggered when the framework's page is loaded before the header gets sent. This will not be triggered in the admin pages that are not registered by the framework. The first parameter: class object [3.1.2+].</li> |
@@ -83,4 +83,4 @@ |
||
83 | 83 | * @subpackage Factory/NetworkAdmin |
84 | 84 | * @heading Network Admin Page |
85 | 85 | */ |
86 | -abstract class AdminPageFramework_NetworkAdmin_Documentation extends AdminPageFramework_Documentaiton{} |
|
86 | +abstract class AdminPageFramework_NetworkAdmin_Documentation extends AdminPageFramework_Documentaiton {} |