@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * Defines the field type slugs used for this field type. |
66 | 66 | */ |
67 | - public $aFieldTypeSlugs = array( 'image', ); |
|
67 | + public $aFieldTypeSlugs = array( 'image',); |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Defines the default key-values of this field type. |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected $aDefaultKeys = array( |
75 | 75 | 'attributes_to_store' => array(), // ( array ) This is for the image and media field type. The attributes to save besides URL. e.g. ( for the image field type ) array( 'title', 'alt', 'width', 'height', 'caption', 'id', 'align', 'link' ). |
76 | - 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
77 | - 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
76 | + 'show_preview' => true, // ( boolean ) Indicates whether the image preview should be displayed or not. |
|
77 | + 'allow_external_source' => true, // ( boolean ) Indicates whether the media library box has the From URL tab. |
|
78 | 78 | 'mime_types' => array( // [3.9.1] To display files of different file types, add MIME types |
79 | 79 | 'image' => 'image', |
80 | 80 | // 'text' => 'text/plain', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'maxlength' => 400, |
89 | 89 | ), |
90 | 90 | 'button' => array(), |
91 | - 'remove_button' => array(), // 3.2.0+ |
|
91 | + 'remove_button' => array(), // 3.2.0+ |
|
92 | 92 | 'preview' => array(), |
93 | 93 | ), |
94 | 94 | ); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | protected function doOnFieldRegistration( $aField ) { |
106 | 106 | self::$aMimeTypes = $this->getElementAsArray( $aField, array( 'mime_types' ) ) + self::$aMimeTypes; |
107 | - if ( ! $this->hasBeenCalled( get_class( $this ) . '/upload_mimes' ) ) { |
|
107 | + if ( !$this->hasBeenCalled( get_class( $this ).'/upload_mimes' ) ) { |
|
108 | 108 | add_filter( 'upload_mimes', array( $this, 'replyToGetAllowedFileTypesToUpload' ) ); |
109 | 109 | } |
110 | 110 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @return array |
115 | 115 | */ |
116 | 116 | static public function replyToGetAllowedFileTypesToUpload( $aMimeTypes ) { |
117 | - unset( self::$aMimeTypes[ 'image' ] ); // the default 'image' is for the custom uploader and the format is different |
|
117 | + unset( self::$aMimeTypes[ 'image' ] ); // the default 'image' is for the custom uploader and the format is different |
|
118 | 118 | return $aMimeTypes + self::$aMimeTypes; |
119 | 119 | } |
120 | 120 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | return array( |
135 | 135 | array( |
136 | 136 | 'handle_id' => 'admin-page-framework-field-type-image', |
137 | - 'src' => dirname( __FILE__ ) . '/js/image.bundle.js', |
|
137 | + 'src' => dirname( __FILE__ ).'/js/image.bundle.js', |
|
138 | 138 | 'in_footer' => true, |
139 | 139 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
140 | 140 | 'translation_var' => 'AdminPageFrameworkImageFieldType', |
@@ -180,14 +180,14 @@ discard block |
||
180 | 180 | . "<label for='{$aField[ 'input_id' ]}'>" |
181 | 181 | . $aField[ 'before_input' ] |
182 | 182 | . $this->getAOrB( |
183 | - $aField[ 'label' ] && ! $aField[ 'repeatable' ], |
|
184 | - "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
183 | + $aField[ 'label' ] && !$aField[ 'repeatable' ], |
|
184 | + "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
185 | 185 | . $aField[ 'label' ] |
186 | 186 | . "</span>", |
187 | 187 | '' |
188 | 188 | ) |
189 | - . "<input " . $this->getAttributes( $this->___getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) ) . " />" |
|
190 | - . $this->_getUploaderButtonHTML( $aField[ 'input_id' ], $_aUploadButtonAttributes, ! empty( $aField[ 'repeatable' ] ), $aField[ 'allow_external_source' ] ) |
|
189 | + . "<input ".$this->getAttributes( $this->___getImageInputAttributes( $aField, $_iCountAttributes, $_sImageURL, $_aBaseAttributes ) )." />" |
|
190 | + . $this->_getUploaderButtonHTML( $aField[ 'input_id' ], $_aUploadButtonAttributes, !empty( $aField[ 'repeatable' ] ), $aField[ 'allow_external_source' ] ) |
|
191 | 191 | . $this->_getRemoveButtonHTMLByType( $aField[ 'input_id' ], $_aRemoveButtonAttributes, strtolower( $this->getFirstElement( $this->aFieldTypeSlugs ) ) ) |
192 | 192 | . $aField[ 'after_input' ] |
193 | 193 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | * @return array The generated base attribute array. |
211 | 211 | */ |
212 | 212 | private function ___getBaseAttributes( array $aField ) { |
213 | - $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
213 | + $_aBaseAttributes = $aField[ 'attributes' ] + array( 'class' => null ); |
|
214 | 214 | unset( |
215 | - $_aBaseAttributes[ 'input' ], $_aBaseAttributes[ 'button' ], |
|
216 | - $_aBaseAttributes[ 'preview' ], $_aBaseAttributes[ 'name' ], |
|
217 | - $_aBaseAttributes[ 'value' ], $_aBaseAttributes[ 'type' ], |
|
215 | + $_aBaseAttributes[ 'input' ], $_aBaseAttributes[ 'button' ], |
|
216 | + $_aBaseAttributes[ 'preview' ], $_aBaseAttributes[ 'name' ], |
|
217 | + $_aBaseAttributes[ 'value' ], $_aBaseAttributes[ 'type' ], |
|
218 | 218 | $_aBaseAttributes[ 'remove_button' ] |
219 | 219 | ); |
220 | 220 | return $_aBaseAttributes; |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | */ |
268 | 268 | protected function getExtraInputFields( array $aField ) { |
269 | 269 | $_aOutputs = array(); |
270 | - foreach( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
271 | - $_aOutputs[] = "<input " . $this->getAttributes( |
|
270 | + foreach ( $this->getElementAsArray( $aField, 'attributes_to_store' ) as $sAttribute ) { |
|
271 | + $_aOutputs[ ] = "<input ".$this->getAttributes( |
|
272 | 272 | array( |
273 | 273 | 'id' => "{$aField[ 'input_id' ]}_{$sAttribute}", |
274 | 274 | 'type' => 'hidden', |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | '' |
285 | 285 | ), |
286 | 286 | ) |
287 | - ) . "/>"; |
|
287 | + )."/>"; |
|
288 | 288 | } |
289 | 289 | return implode( PHP_EOL, $_aOutputs ); |
290 | 290 | } |
@@ -295,15 +295,15 @@ discard block |
||
295 | 295 | * @return string |
296 | 296 | */ |
297 | 297 | protected function _getPreviewContainer( $aField, $sImageURL, $aPreviewAttributes ) { |
298 | - if ( ! $aField[ 'show_preview' ] ) { |
|
298 | + if ( !$aField[ 'show_preview' ] ) { |
|
299 | 299 | return ''; |
300 | 300 | } |
301 | 301 | $sImageURL = esc_url( $this->getResolvedSRC( $sImageURL, true ) ); |
302 | - return "<div " . $this->getAttributes( |
|
302 | + return "<div ".$this->getAttributes( |
|
303 | 303 | array( |
304 | 304 | 'id' => "image_preview_container_{$aField[ 'input_id' ]}", |
305 | - 'class' => 'image_preview ' . $this->getElement( $aPreviewAttributes, 'class', '' ), |
|
306 | - 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
305 | + 'class' => 'image_preview '.$this->getElement( $aPreviewAttributes, 'class', '' ), |
|
306 | + 'style' => $this->getAOrB( $sImageURL, '', "display: none; " ) |
|
307 | 307 | . $this->getElement( $aPreviewAttributes, 'style', '' ), |
308 | 308 | ) + $aPreviewAttributes |
309 | 309 | ) |
@@ -326,12 +326,12 @@ discard block |
||
326 | 326 | */ |
327 | 327 | protected function _getUploaderButtonScript( $sInputID, $abRepeatable, $bExternalSource, array $aButtonAttributes ) { |
328 | 328 | |
329 | - $_bRepeatable = ! empty( $abRepeatable ); |
|
329 | + $_bRepeatable = !empty( $abRepeatable ); |
|
330 | 330 | |
331 | 331 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
332 | 332 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
333 | 333 | // which causes the PHP syntax error. |
334 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ) . '"'; |
|
334 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML( $sInputID, $aButtonAttributes, $_bRepeatable, $bExternalSource ).'"'; |
|
335 | 335 | $_sRepeatable = $this->getAOrB( $_bRepeatable, 'true', 'false' ); |
336 | 336 | $_bExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
337 | 337 | $_sScript = <<<JAVASCRIPTS |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | . '/* <![CDATA[ */' |
348 | 348 | . $_sScript |
349 | 349 | . '/* ]]> */' |
350 | - . "</script>". PHP_EOL; |
|
350 | + . "</script>".PHP_EOL; |
|
351 | 351 | |
352 | 352 | } |
353 | 353 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $bRepeatable, |
366 | 366 | $bExternalSource |
367 | 367 | ); |
368 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
368 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
369 | 369 | . ( $_bIsLabelSet |
370 | 370 | ? $_aAttributes[ 'data-label' ] |
371 | 371 | : ( strrpos( $_aAttributes[ 'class' ], 'dashicons' ) |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * @return array The formatted upload button attributes array. |
383 | 383 | */ |
384 | 384 | protected function _getFormattedUploadButtonAttributes( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bRepeatable, $bExternalSource ) { |
385 | - $_aAttributes = array( |
|
385 | + $_aAttributes = array( |
|
386 | 386 | 'id' => "select_image_{$sInputID}", |
387 | 387 | 'href' => '#', |
388 | 388 | 'data-input_id' => $sInputID, |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | : $this->oMsg->get( 'select_image' ), |
398 | 398 | 'data-label' => null, |
399 | 399 | ); |
400 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
400 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
401 | 401 | 'select_image button button-small ', |
402 | 402 | $this->getAOrB( |
403 | 403 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -425,16 +425,16 @@ discard block |
||
425 | 425 | * @internal |
426 | 426 | * @deprecatead 3.9.0 Currently, not used but Kept for backward compatibility. |
427 | 427 | */ |
428 | - protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
428 | + protected function _getRemoveButtonScript( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
429 | 429 | |
430 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
430 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
431 | 431 | return ''; |
432 | 432 | } |
433 | 433 | |
434 | 434 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
435 | 435 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
436 | 436 | // which causes the PHP syntax error. |
437 | - $_sButtonHTML = '"' . $this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ) . '"'; |
|
437 | + $_sButtonHTML = '"'.$this->_getRemoveButtonHTMLByType( $sInputID, $aButtonAttributes, $sType ).'"'; |
|
438 | 438 | $_sScript = <<<JAVASCRIPTS |
439 | 439 | if ( 0 === jQuery( 'a#remove_{$sType}_{$sInputID}' ).length ) { |
440 | 440 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | . '/* <![CDATA[ */' |
446 | 446 | . $_sScript |
447 | 447 | . '/* ]]> */' |
448 | - . "</script>". PHP_EOL; |
|
448 | + . "</script>".PHP_EOL; |
|
449 | 449 | |
450 | 450 | } |
451 | 451 | |
@@ -455,10 +455,10 @@ discard block |
||
455 | 455 | * @return string The generated HTML remove button output. |
456 | 456 | * @internal |
457 | 457 | */ |
458 | - protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType='image' ) { |
|
458 | + protected function _getRemoveButtonHTMLByType( $sInputID, array $aButtonAttributes, $sType = 'image' ) { |
|
459 | 459 | $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
460 | 460 | $_aAttributes = $this->_getFormattedRemoveButtonAttributesByType( $sInputID, $aButtonAttributes, $_bIsLabelSet, $sType ); |
461 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
461 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
462 | 462 | . ( $_bIsLabelSet |
463 | 463 | ? $_aAttributes[ 'data-label' ] |
464 | 464 | : $this->getAOrB( |
@@ -476,10 +476,10 @@ discard block |
||
476 | 476 | * @return array The formatted remove button attributes array. |
477 | 477 | * @internal |
478 | 478 | */ |
479 | - protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType='image' ) { |
|
479 | + protected function _getFormattedRemoveButtonAttributesByType( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $sType = 'image' ) { |
|
480 | 480 | |
481 | 481 | // $_sOnClickFunctionName = 'removeInputValuesFor' . ucfirst( $sType ); // @deprecated |
482 | - $_aAttributes = array( |
|
482 | + $_aAttributes = array( |
|
483 | 483 | 'id' => "remove_{$sType}_{$sInputID}", |
484 | 484 | 'href' => '#', |
485 | 485 | 'data-input_id' => $sInputID, |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | ? $aButtonAttributes[ 'data-label' ] |
494 | 494 | : $this->oMsg->get( 'remove_value' ), |
495 | 495 | ); |
496 | - $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
496 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
497 | 497 | "remove_value remove_{$sType} button button-small", |
498 | 498 | $this->getAOrB( |
499 | 499 | trim( $aButtonAttributes[ 'class' ] ), |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @return string |
41 | 41 | */ |
42 | 42 | private function _getTransientKey() { |
43 | - return 'apf_ntc_' . get_current_user_id(); |
|
43 | + return 'apf_ntc_'.get_current_user_id(); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
53 | 53 | * @return boolean True if a setting notice is set; otherwise, false. |
54 | 54 | */ |
55 | - public function hasNotice( $sType='' ) { |
|
55 | + public function hasNotice( $sType = '' ) { |
|
56 | 56 | |
57 | - if ( ! $sType ) { |
|
57 | + if ( !$sType ) { |
|
58 | 58 | return ( boolean ) count( self::$_aNotices ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Check if there is a message of the type. |
62 | - foreach( self::$_aNotices as $_aNotice ) { |
|
62 | + foreach ( self::$_aNotices as $_aNotice ) { |
|
63 | 63 | $_sClassAttribute = $this->getElement( |
64 | 64 | $_aNotice, |
65 | 65 | array( |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @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. |
97 | 97 | * @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. |
98 | 98 | */ |
99 | - public function set( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
99 | + public function set( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
100 | 100 | |
101 | 101 | // If the array is empty, schedule the task of saving the array at shutdown. |
102 | 102 | if ( empty( self::$_aNotices ) ) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $_sID = md5( trim( $sMessage ) ); |
107 | 107 | |
108 | 108 | // If the override is false and a message is already set, do not add. |
109 | - if ( ! $bOverride && isset( self::$_aNotices[ $_sID ] ) ) { |
|
109 | + if ( !$bOverride && isset( self::$_aNotices[ $_sID ] ) ) { |
|
110 | 110 | return; |
111 | 111 | } |
112 | 112 | |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | $_aAttributes = $this->getAsArray( $asAttributes ); |
119 | - if ( is_string( $asAttributes ) && ! empty( $asAttributes ) ) { |
|
119 | + if ( is_string( $asAttributes ) && !empty( $asAttributes ) ) { |
|
120 | 120 | $_aAttributes[ 'id' ] = $asAttributes; |
121 | 121 | } |
122 | 122 | self::$_aNotices[ $_sID ] = array( |
123 | 123 | 'sMessage' => $sMessage, |
124 | 124 | 'aAttributes' => $_aAttributes + array( |
125 | 125 | 'class' => $sType, |
126 | - 'id' => 'form_submit_notice_' . $_sID, |
|
126 | + 'id' => 'form_submit_notice_'.$_sID, |
|
127 | 127 | ), |
128 | 128 | ); |
129 | 129 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
164 | - if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
164 | + if ( isset( $_GET[ 'settings-notice' ] ) && !$_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
165 | 165 | return; |
166 | 166 | } |
167 | 167 |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @callback add_action() shutdown |
138 | 138 | */ |
139 | 139 | public function _replyToSaveNotices() { |
140 | - if ( empty( self::$_aNotices ) ) { |
|
140 | + if ( empty( self::$_aNotices ) ) { |
|
141 | 141 | return; |
142 | 142 | } |
143 | 143 | $_bResult = $this->setTransient( |
@@ -156,12 +156,13 @@ discard block |
||
156 | 156 | |
157 | 157 | // Retrieve the notifications set in a transient. |
158 | 158 | $_aNotices = $this->_getNotices(); |
159 | - if ( false === $_aNotices ) { |
|
159 | + if ( false === $_aNotices ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
163 | 163 | // By setting false to the 'settings-notice' key, it's possible to disable the notifications set with the framework. |
164 | - if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { // sanitization unnecessary |
|
164 | + if ( isset( $_GET[ 'settings-notice' ] ) && ! $_GET[ 'settings-notice' ] ) { |
|
165 | +// sanitization unnecessary |
|
165 | 166 | return; |
166 | 167 | } |
167 | 168 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function get() { |
33 | 33 | |
34 | 34 | $this->sCapability = $this->callBack( $this->aCallbacks[ 'capability' ], '' ); |
35 | - if ( ! $this->canUserView( $this->sCapability ) ) { |
|
35 | + if ( !$this->canUserView( $this->sCapability ) ) { |
|
36 | 36 | return ''; |
37 | 37 | } |
38 | 38 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @since 3.7.9 Added the second parameter to accept an action hook name. |
26 | 26 | */ |
27 | 27 | |
28 | - public function __construct( $oFactory, $sActionHookName='admin_notices' ) { |
|
28 | + public function __construct( $oFactory, $sActionHookName = 'admin_notices' ) { |
|
29 | 29 | $this->oFactory = $oFactory; |
30 | 30 | add_action( $sActionHookName, array( $this, '_replyToPrintSettingNotice' ) ); |
31 | 31 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @callback add_action() admin_notices |
41 | 41 | */ |
42 | 42 | public function _replyToPrintSettingNotice() { |
43 | - if ( ! $this->___shouldProceed() ) { |
|
43 | + if ( !$this->___shouldProceed() ) { |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | $this->oFactory->oForm->printSubmitNotices(); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function ___shouldProceed() { |
55 | 55 | |
56 | - if ( ! $this->oFactory->isInThePage() ) { |
|
56 | + if ( !$this->oFactory->isInThePage() ) { |
|
57 | 57 | return false; |
58 | 58 | } |
59 | 59 |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Call the user constructor. |
172 | - $this->start(); // defined in the controller class. |
|
173 | - $this->oUtil->addAndDoAction( $this, 'start_' . $this->oProp->sClassName, $this ); |
|
172 | + $this->start(); // defined in the controller class. |
|
173 | + $this->oUtil->addAndDoAction( $this, 'start_'.$this->oProp->sClassName, $this ); |
|
174 | 174 | |
175 | 175 | } |
176 | 176 | /** |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | * @return array |
180 | 180 | */ |
181 | 181 | private function ___getSubClassNames() { |
182 | - foreach( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
183 | - $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix . $this->_sStructureType; |
|
182 | + foreach ( $this->_aSubClassPrefixes as $_sObjectVariableName => $_sPrefix ) { |
|
183 | + $this->aSubClassNames[ $_sObjectVariableName ] = $_sPrefix.$this->_sStructureType; |
|
184 | 184 | } |
185 | 185 | return $this->aSubClassNames + $this->_aSubClassNames; |
186 | 186 | } |
@@ -194,15 +194,15 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function _replyToLoadComponents( /* $oScreen */ ) { |
196 | 196 | |
197 | - if ( ! $this->_isInThePage() ) { |
|
197 | + if ( !$this->_isInThePage() ) { |
|
198 | 198 | return; |
199 | 199 | } |
200 | 200 | |
201 | - if ( ! isset( $this->oResource ) ) { |
|
201 | + if ( !isset( $this->oResource ) ) { |
|
202 | 202 | $this->oResource = $this->_replyTpSetAndGetInstance_oResource(); |
203 | 203 | } |
204 | 204 | |
205 | - if ( ! isset( $this->oLink ) ) { |
|
205 | + if ( !isset( $this->oLink ) ) { |
|
206 | 206 | $this->oLink = $this->_replyTpSetAndGetInstance_oLink(); |
207 | 207 | } |
208 | 208 | |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | * Calls the load method and callbacks. |
217 | 217 | * @since 3.8.14 |
218 | 218 | */ |
219 | - protected function _load( $aActions=array() ) { |
|
219 | + protected function _load( $aActions = array() ) { |
|
220 | 220 | $aActions = empty( $aActions ) |
221 | 221 | ? array( |
222 | - 'load_' . $this->oProp->sClassName, |
|
222 | + 'load_'.$this->oProp->sClassName, |
|
223 | 223 | ) |
224 | 224 | : $aActions; |
225 | 225 | $this->load(); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | protected function _setUp() { |
233 | 233 | $aActions = array( |
234 | - 'set_up_' . $this->oProp->sClassName, |
|
234 | + 'set_up_'.$this->oProp->sClassName, |
|
235 | 235 | ); |
236 | 236 | $this->setUp(); |
237 | 237 | $this->oUtil->addAndDoActions( $this, $aActions, $this ); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * @internal |
247 | 247 | */ |
248 | 248 | protected function _isInstantiatable() { |
249 | - if ( ! empty( $GLOBALS[ 'pagenow' ] ) && 'async-upload.php' === $GLOBALS[ 'pagenow' ] ) { // 3.9.1 |
|
249 | + if ( !empty( $GLOBALS[ 'pagenow' ] ) && 'async-upload.php' === $GLOBALS[ 'pagenow' ] ) { // 3.9.1 |
|
250 | 250 | return true; |
251 | 251 | } |
252 | 252 | if ( $this->_isWordPressCoreAjaxRequest() ) { |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | * @since 3.8.19 |
262 | 262 | */ |
263 | 263 | protected function _isWordPressCoreAjaxRequest() { |
264 | - if ( ! isset( $GLOBALS[ 'pagenow' ] ) ) { |
|
264 | + if ( !isset( $GLOBALS[ 'pagenow' ] ) ) { |
|
265 | 265 | return false; |
266 | 266 | } |
267 | 267 | if ( 'admin-ajax.php' !== $GLOBALS[ 'pagenow' ] ) { |
268 | 268 | return false; |
269 | 269 | } |
270 | 270 | return in_array( |
271 | - isset( $_POST[ 'action' ] ) ? $_POST[ 'action' ] : '', // sanitization unnecessary as just checking |
|
271 | + isset( $_POST[ 'action' ] ) ? $_POST[ 'action' ] : '', // sanitization unnecessary as just checking |
|
272 | 272 | array( 'heartbeat', 'closed-postboxes', 'meta-box-order' ), |
273 | 273 | true |
274 | 274 | ); |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @return boolean |
297 | 297 | */ |
298 | 298 | protected function _isValidAjaxReferrer() { |
299 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
299 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
300 | 300 | return false; |
301 | 301 | } |
302 | 302 | return true; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public function _replyToDetermineToLoad() { |
314 | 314 | |
315 | - if ( ! $this->_isInThePage() ) { |
|
315 | + if ( !$this->_isInThePage() ) { |
|
316 | 316 | return; |
317 | 317 | } |
318 | 318 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | // Set and return the sub class object instance. |
379 | 379 | if ( isset( $this->aSubClassNames[ $sPropertyName ] ) ) { |
380 | 380 | return call_user_func( |
381 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
381 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
382 | 382 | ); |
383 | 383 | } |
384 | 384 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | */ |
413 | 413 | public function _replyTpSetAndGetInstance_oMsg() { |
414 | 414 | $this->oMsg = call_user_func_array( |
415 | - array( $this->aSubClassNames[ 'oMsg' ], 'getInstance'), |
|
415 | + array( $this->aSubClassNames[ 'oMsg' ], 'getInstance' ), |
|
416 | 416 | array( $this->oProp->sTextDomain ) // parameters |
417 | 417 | ); |
418 | 418 | return $this->oMsg; |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | * |
478 | 478 | * @internal |
479 | 479 | */ |
480 | - public function __call( $sMethodName, $aArguments=null ) { |
|
480 | + public function __call( $sMethodName, $aArguments = null ) { |
|
481 | 481 | |
482 | 482 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
483 | 483 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | |
508 | 508 | // Check if the method name does not contain a backslash. |
509 | 509 | if ( false === strpos( $sMethodName, "\\" ) ) { |
510 | - return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
510 | + return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | // If the method name contains a backslash, the user may be using a name space. |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | array( $this, $_sAutoCallbackMethodName ), |
519 | 519 | $aArguments |
520 | 520 | ) |
521 | - : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
521 | + : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
522 | 522 | |
523 | 523 | } |
524 | 524 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | private function _triggerUndefinedMethodWarning( $sMethodName ) { |
530 | 530 | trigger_error( |
531 | - AdminPageFramework_Registry::NAME . ': ' |
|
531 | + AdminPageFramework_Registry::NAME.': ' |
|
532 | 532 | . sprintf( |
533 | 533 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
534 | 534 | $sMethodName |
@@ -246,7 +246,8 @@ |
||
246 | 246 | * @internal |
247 | 247 | */ |
248 | 248 | protected function _isInstantiatable() { |
249 | - if ( ! empty( $GLOBALS[ 'pagenow' ] ) && 'async-upload.php' === $GLOBALS[ 'pagenow' ] ) { // 3.9.1 |
|
249 | + if ( ! empty( $GLOBALS[ 'pagenow' ] ) && 'async-upload.php' === $GLOBALS[ 'pagenow' ] ) { |
|
250 | +// 3.9.1 |
|
250 | 251 | return true; |
251 | 252 | } |
252 | 253 | if ( $this->_isWordPressCoreAjaxRequest() ) { |
@@ -319,17 +319,17 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
322 | - * Adds form fields. |
|
323 | - * |
|
324 | - * It inserts the given field definition arrays into the class property and later they are parsed when fields are registered. The field definition array requires specific keys. Refer to the parameter section of this method. |
|
325 | - * |
|
326 | - * @since 2.0.0 |
|
327 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
328 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
329 | - * @param array the field definition array. |
|
330 | - * @param array (optional) another field array. |
|
331 | - * @param array (optional) add more field arrays to the next parameters as many as necessary. |
|
332 | - */ |
|
322 | + * Adds form fields. |
|
323 | + * |
|
324 | + * It inserts the given field definition arrays into the class property and later they are parsed when fields are registered. The field definition array requires specific keys. Refer to the parameter section of this method. |
|
325 | + * |
|
326 | + * @since 2.0.0 |
|
327 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
328 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
329 | + * @param array the field definition array. |
|
330 | + * @param array (optional) another field array. |
|
331 | + * @param array (optional) add more field arrays to the next parameters as many as necessary. |
|
332 | + */ |
|
333 | 333 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
334 | 334 | foreach( func_get_args() as $_aFieldset ) { |
335 | 335 | $this->addSettingField( $_aFieldset ); |
@@ -360,167 +360,167 @@ discard block |
||
360 | 360 | * @return void |
361 | 361 | * @remark The $oForm property should be created in each extended class. |
362 | 362 | * @param array|string $asField A field definition array or a string of the target section id. |
363 | - * <h4>Built-in Field Types</h4> |
|
364 | - * <ul> |
|
365 | - * <li>[text](./class-AdminPageFramework_FieldType_text.html) - a normal field to enter short text input.</li> |
|
366 | - * <li>[password](./class-AdminPageFramework_FieldType_text.html) - a masked text input field.</li> |
|
367 | - * <li>[textarea](./class-AdminPageFramework_FieldType_textarea.html) - a text input field with multiple lines. It supports rich text editors.</li> |
|
368 | - * <li>[radio](./class-AdminPageFramework_FieldType_radio.html) - a set of radio buttons that lets the user pick an option.</li> |
|
369 | - * <li>[checkbox](./class-AdminPageFramework_FieldType_checkbox.html) - a check box that lets the user enable/disable an item.</li> |
|
370 | - * <li>[select](./class-AdminPageFramework_FieldType_select.html) - a drop-down list that lest the user pick one or more item(s) from a list.</li> |
|
371 | - * <li>[hidden](./class-AdminPageFramework_FieldType_hidden.html) - a field with invisible input values.</li> |
|
372 | - * <li>[file](./class-AdminPageFramework_FieldType_file.html) - a file uploader that lets the user upload files.</li> |
|
373 | - * <li>[image](./class-AdminPageFramework_FieldType_image.html) - a text field with an image uploader that lets the user set the image URL.</li> |
|
374 | - * <li>[media](./class-AdminPageFramework_FieldType_media.html) - a text field with a media uploader that lets the user set the file URL.</li> |
|
375 | - * <li>[color](./class-AdminPageFramework_FieldType_color.html) - a text field with a color picker.</li> |
|
376 | - * <li>[submit](./class-AdminPageFramework_FieldType_submit.html) - a submit button that lets the user send the form.</li> |
|
377 | - * <li>[export](./class-AdminPageFramework_FieldType_export.html) - a custom submit field that lets the user export stored data.</li> |
|
378 | - * <li>[import](./class-AdminPageFramework_FieldType_import.html) - a custom combination field of file and submit fields that let the user import data.</li> |
|
379 | - * <li>[posttype](./class-AdminPageFramework_FieldType_posttype.html) - a check-list of post types enabled on the site.</li> |
|
380 | - * <li>[taxonomy](./class-AdminPageFramework_FieldType_taxonomy.html) - a set of check-lists of taxonomies enabled on the site in a tabbed box.</li> |
|
381 | - * <li>[size](./class-AdminPageFramework_FieldType_size.html) - a combination field of the text and the select fields that let the user set sizes with a selectable unit.</li> |
|
382 | - * <li>[section_title](./class-AdminPageFramework_FieldType_section_title.html) - [3.0.0+] a text field type that will be placed in the section title so that it lets the user set the section title. Note that only one field with this field type is allowed per a section.</li> |
|
383 | - * <li>[system](./class-AdminPageFramework_FieldType_system.html) - [3.3.0+] a custom text area field that displays the system information including the PHP settings, the framework version, MySQL version etc.</li> |
|
384 | - * <li>[inline_mixed](./class-AdminPageFramework_FieldType_inline_mixed.html) - [3.8.0+] a field that include inner fields with different field types. </li> |
|
385 | - * </ul> |
|
386 | - * <h4>Field Definition Arguments</h4> |
|
387 | - * <ul> |
|
388 | - * <li>**field_id** - (required, string) the field ID. Avoid using non-alphabetic characters except underscore and numbers.</li> |
|
389 | - * <li>**type** - (optional, string) the type of the field. The supported types are listed below. When creating nested fields, this argument can be omitted.</li> |
|
390 | - * <li>**section_id** - (optional, string) the section ID that the field belongs to. If not set, the internal `_default` section ID will be assigned.</li> |
|
391 | - * <li>**title** - (optional, string) the title of the section.</li> |
|
392 | - * <li>**description** - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
393 | - * <li>**tip** - (optional, string) the tip for the field which is displayed when the mouse is hovered over the field title.</li> |
|
394 | - * <li>**capability** - (optional, string) the <a href="http://codex.wordpress.org/Roles_and_Capabilities">access level</a> of the section. If the page visitor does not have sufficient capability, the section will be invisible to them.</li> |
|
395 | - * <li>**error_message** - (optional, string) the error message to display above the input field.</li> |
|
396 | - * <li>**before_field** - (optional, string) the HTML string to insert before the input field output.</li> |
|
397 | - * <li>**after_field** - (optional, string) the HTML string to insert after the input field output.</li> |
|
398 | - * <li>**if** - (optional, boolean) if the passed value is false, the section will not be registered.</li> |
|
399 | - * <li>**order** - (optional, integer) the order number of the section. The higher the number is, the lower the position it gets.</li> |
|
400 | - * <li>**label** - (optional, string) the text label(s) associated with and displayed along with the input field. Some input types can ignore this key.</li> |
|
401 | - * <li>**default** - (optional, string|array) the default value(s) assigned to the input tag's value attribute.</li> |
|
402 | - * <li>**value** - (optional, string|array) the value(s) assigned to the input tag's `value` attribute to override the default and the stored value.</li> |
|
403 | - * <li>**delimiter** - (optional, string) the HTML string that delimits multiple elements. This is available if the <var>label</var> key is passed as array. It will be enclosed in inline-block elements so the passed HTML string should not contain block elements.</li> |
|
404 | - * <li>**before_input** - (optional, string) the HTML string inserted right before the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
405 | - * <li>**after_input** - (optional, string) the HTML string inserted right after the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
406 | - * <li>**label_min_width** - (optional, string) the inline style property of the `min-width` of the label tag for the field. If the unit is not specified, 'px' is applied. Default: `120`. e.g. `100%`</li> |
|
407 | - * <li>**help** - (optional, string) the help description added to the contextual help tab.</li> |
|
408 | - * <li>**help_aside** - (optional, string) the additional help description for the side bar of the contextual help tab.</li> |
|
409 | - * <li>**repeatable** - [3.0.0+] (optional, array|boolean) whether the fields should be repeatable. If it yields true, the plus and the minus buttons appear next to each field that lets the user add/remove the fields. Optionally an setting array can be passed. |
|
410 | - * <h5>Repeatable Fields Setting Array</h5> |
|
411 | - * <ul> |
|
412 | - * <li>**max** - the allowed maximum number of fields to be repeated.</li> |
|
413 | - * <li>**min** - the allowed minimum number of fields to be repeated.</li> |
|
414 | - * <li>**disabled** - (optional, boolean|array) [3.8.13+] |
|
415 | - * <ul> |
|
416 | - * <li>**message** - (optional, string) the message to show when the user clicks on the `Add` repeatable button.</li> |
|
417 | - * <li>**caption** - (optional, string) the title of the modal window that displays the message. Default: Warning</li> |
|
418 | - * <li>**box_width** - (optional, integer) the width of the modal window that displays the message. Default: 300</li> |
|
419 | - * <li>**box_width** - (optional, integer) the height of the modal window that displays the message. Default: 100.</li> |
|
420 | - * <ul> |
|
421 | - * </li> |
|
422 | - * </ul> |
|
423 | - * </li> |
|
424 | - * <li>**sortable** - [3.0.0+] (optional, boolean) whether the fields should be sortable. If it yields true, the fields will be enclosed in a draggable box. |
|
425 | - * <li>**attributes** - [3.0.0+] (optional, array) holds key-value pairs representing the attribute and its property. Note that some field types have specific keys in the first dimensions. e.g. `array( 'class' => 'my_custom_class_selector', 'style' => 'background-color:#777', 'size' => 20, )` Every field holds the following nested attribute definition arrays. |
|
426 | - * <ul> |
|
427 | - * <li>**fieldrow** - the `td` tag element containing the field output.</li> |
|
428 | - * <li>**fieldset** - the `fieldset` tag element containing the field output.</li> |
|
429 | - * <li>**fields** - the `div` tag element containing the sub-fields and the main field.</li> |
|
430 | - * <li>**field** - the `div` tag element containing each field.</li> |
|
431 | - * </ul> |
|
432 | - * </li> |
|
433 | - * <li>**show_title_column** - [3.0.0+] (optional, boolean) If true, the field title column will be omitted from the output.</li> |
|
434 | - * <li>**hidden** - [3.0.0+] (optional, boolean) If true, the entire field row output will be invisible with the inline style attribute of `style="display:none"`.</li> |
|
435 | - * <li>**save** - [3.6.0+] (optional, boolean) If `false`, the field value will not be saved. Default: `true`</li> |
|
436 | - * <li>**content** - (optional, string|array) [3.6.1+] a custom section output. [3.8.0+] Supports an array to be passed for nested and inline-mixed fields. If an array holding field definitions is set, those fields will be nested. |
|
437 | - * <h4>Example</h4> |
|
438 | - * <pre><code> |
|
439 | - * $this->addSettingFields( |
|
440 | - * 'my_section_id', // the target section ID - pass dimensional keys of the section |
|
441 | - * array( |
|
442 | - * 'field_id' => 'Y', |
|
443 | - * 'title' => __( 'Y', 'admin-page-framework-loader' ), |
|
444 | - * 'description' => __( 'By passing an array of field definition to the <code>content</code> argument, you can nest fields.', 'admin-page-framework-loader' ) |
|
445 | - * . ' ' . __( 'Also the <code>type</code> argument can be omitted.', 'admin-page-framework-loader' ), |
|
446 | - * 'content' => array( |
|
447 | - * array( |
|
448 | - * 'field_id' => 'i', |
|
449 | - * 'title' => __( 'i', 'admin-page-framework-loader' ), |
|
450 | - * 'type' => 'textarea', |
|
451 | - * ), |
|
452 | - * array( |
|
453 | - * 'field_id' => 'ii', |
|
454 | - * 'title' => __( 'ii', 'admin-page-framework-loader' ), |
|
455 | - * 'type' => 'color', |
|
456 | - * ), |
|
457 | - * array( |
|
458 | - * 'field_id' => 'iii', |
|
459 | - * 'title' => __( 'iii', 'admin-page-framework-loader' ), |
|
460 | - * 'repeatable' => true, |
|
461 | - * 'sortable' => true, |
|
462 | - * 'content' => array( |
|
463 | - * array( |
|
464 | - * 'field_id' => 'a', |
|
465 | - * 'title' => __( 'a', 'admin-page-framework-loader' ), |
|
466 | - * 'type' => 'image', |
|
467 | - * 'attributes' => array( |
|
468 | - * 'preview' => array( |
|
469 | - * 'style' => 'max-width: 200px;', |
|
470 | - * ), |
|
471 | - * ), |
|
472 | - * ), |
|
473 | - * array( |
|
474 | - * 'field_id' => 'b', |
|
475 | - * 'title' => __( 'b', 'admin-page-framework-loader' ), |
|
476 | - * 'content' => array( |
|
477 | - * array( |
|
478 | - * 'field_id' => 'first', |
|
479 | - * 'title' => __( '1st', 'admin-page-framework-loader' ), |
|
480 | - * 'type' => 'color', |
|
481 | - * 'repeatable' => true, |
|
482 | - * 'sortable' => true, |
|
483 | - * ), |
|
484 | - * array( |
|
485 | - * 'field_id' => 'second', |
|
486 | - * 'title' => __( '2nd', 'admin-page-framework-loader' ), |
|
487 | - * 'type' => 'size', |
|
488 | - * ), |
|
489 | - * array( |
|
490 | - * 'field_id' => 'third', |
|
491 | - * 'title' => __( '3rd', 'admin-page-framework-loader' ), |
|
492 | - * 'type' => 'select', |
|
493 | - * 'label' => array( |
|
494 | - * 'x' => 'X', |
|
495 | - * 'y' => 'Y', |
|
496 | - * 'z' => 'Z', |
|
497 | - * ), |
|
498 | - * ), |
|
499 | - * ), |
|
500 | - * // 'description' => '', |
|
501 | - * ), |
|
502 | - * array( |
|
503 | - * 'field_id' => 'c', |
|
504 | - * 'title' => __( 'c', 'admin-page-framework-loader' ), |
|
505 | - * 'type' => 'radio', |
|
506 | - * 'label' => array( |
|
507 | - * 'a' => __( 'Apple', 'admin-page-framework-loader' ), |
|
508 | - * 'b' => __( 'Banana', 'admin-page-framework-loader' ), |
|
509 | - * 'c' => __( 'Cherry', 'admin-page-framework-loader' ), |
|
510 | - * ), |
|
511 | - * 'default' => 'b', |
|
512 | - * ), |
|
513 | - * ) |
|
514 | - * ), |
|
515 | - * ), |
|
516 | - * ) |
|
517 | - * ); |
|
518 | - * </code></pre> |
|
519 | - * </li> |
|
520 | - * <li>**placement** - [3.8.0+] (optional, string) Specifies where the field is rendered. Either `normal` `section_title` or `field_title` is accepted. `field_title` can only be used by nested fields defined in the `content` argument. Default: `normal`</li> |
|
521 | - * <li>**show_debug_info** - (optional, boolean) [3.8.8+] Whether to show debug information such as field definition tool-tips. Default: `true`.</li> |
|
522 | - * </ul> |
|
523 | - */ |
|
363 | + * <h4>Built-in Field Types</h4> |
|
364 | + * <ul> |
|
365 | + * <li>[text](./class-AdminPageFramework_FieldType_text.html) - a normal field to enter short text input.</li> |
|
366 | + * <li>[password](./class-AdminPageFramework_FieldType_text.html) - a masked text input field.</li> |
|
367 | + * <li>[textarea](./class-AdminPageFramework_FieldType_textarea.html) - a text input field with multiple lines. It supports rich text editors.</li> |
|
368 | + * <li>[radio](./class-AdminPageFramework_FieldType_radio.html) - a set of radio buttons that lets the user pick an option.</li> |
|
369 | + * <li>[checkbox](./class-AdminPageFramework_FieldType_checkbox.html) - a check box that lets the user enable/disable an item.</li> |
|
370 | + * <li>[select](./class-AdminPageFramework_FieldType_select.html) - a drop-down list that lest the user pick one or more item(s) from a list.</li> |
|
371 | + * <li>[hidden](./class-AdminPageFramework_FieldType_hidden.html) - a field with invisible input values.</li> |
|
372 | + * <li>[file](./class-AdminPageFramework_FieldType_file.html) - a file uploader that lets the user upload files.</li> |
|
373 | + * <li>[image](./class-AdminPageFramework_FieldType_image.html) - a text field with an image uploader that lets the user set the image URL.</li> |
|
374 | + * <li>[media](./class-AdminPageFramework_FieldType_media.html) - a text field with a media uploader that lets the user set the file URL.</li> |
|
375 | + * <li>[color](./class-AdminPageFramework_FieldType_color.html) - a text field with a color picker.</li> |
|
376 | + * <li>[submit](./class-AdminPageFramework_FieldType_submit.html) - a submit button that lets the user send the form.</li> |
|
377 | + * <li>[export](./class-AdminPageFramework_FieldType_export.html) - a custom submit field that lets the user export stored data.</li> |
|
378 | + * <li>[import](./class-AdminPageFramework_FieldType_import.html) - a custom combination field of file and submit fields that let the user import data.</li> |
|
379 | + * <li>[posttype](./class-AdminPageFramework_FieldType_posttype.html) - a check-list of post types enabled on the site.</li> |
|
380 | + * <li>[taxonomy](./class-AdminPageFramework_FieldType_taxonomy.html) - a set of check-lists of taxonomies enabled on the site in a tabbed box.</li> |
|
381 | + * <li>[size](./class-AdminPageFramework_FieldType_size.html) - a combination field of the text and the select fields that let the user set sizes with a selectable unit.</li> |
|
382 | + * <li>[section_title](./class-AdminPageFramework_FieldType_section_title.html) - [3.0.0+] a text field type that will be placed in the section title so that it lets the user set the section title. Note that only one field with this field type is allowed per a section.</li> |
|
383 | + * <li>[system](./class-AdminPageFramework_FieldType_system.html) - [3.3.0+] a custom text area field that displays the system information including the PHP settings, the framework version, MySQL version etc.</li> |
|
384 | + * <li>[inline_mixed](./class-AdminPageFramework_FieldType_inline_mixed.html) - [3.8.0+] a field that include inner fields with different field types. </li> |
|
385 | + * </ul> |
|
386 | + * <h4>Field Definition Arguments</h4> |
|
387 | + * <ul> |
|
388 | + * <li>**field_id** - (required, string) the field ID. Avoid using non-alphabetic characters except underscore and numbers.</li> |
|
389 | + * <li>**type** - (optional, string) the type of the field. The supported types are listed below. When creating nested fields, this argument can be omitted.</li> |
|
390 | + * <li>**section_id** - (optional, string) the section ID that the field belongs to. If not set, the internal `_default` section ID will be assigned.</li> |
|
391 | + * <li>**title** - (optional, string) the title of the section.</li> |
|
392 | + * <li>**description** - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
393 | + * <li>**tip** - (optional, string) the tip for the field which is displayed when the mouse is hovered over the field title.</li> |
|
394 | + * <li>**capability** - (optional, string) the <a href="http://codex.wordpress.org/Roles_and_Capabilities">access level</a> of the section. If the page visitor does not have sufficient capability, the section will be invisible to them.</li> |
|
395 | + * <li>**error_message** - (optional, string) the error message to display above the input field.</li> |
|
396 | + * <li>**before_field** - (optional, string) the HTML string to insert before the input field output.</li> |
|
397 | + * <li>**after_field** - (optional, string) the HTML string to insert after the input field output.</li> |
|
398 | + * <li>**if** - (optional, boolean) if the passed value is false, the section will not be registered.</li> |
|
399 | + * <li>**order** - (optional, integer) the order number of the section. The higher the number is, the lower the position it gets.</li> |
|
400 | + * <li>**label** - (optional, string) the text label(s) associated with and displayed along with the input field. Some input types can ignore this key.</li> |
|
401 | + * <li>**default** - (optional, string|array) the default value(s) assigned to the input tag's value attribute.</li> |
|
402 | + * <li>**value** - (optional, string|array) the value(s) assigned to the input tag's `value` attribute to override the default and the stored value.</li> |
|
403 | + * <li>**delimiter** - (optional, string) the HTML string that delimits multiple elements. This is available if the <var>label</var> key is passed as array. It will be enclosed in inline-block elements so the passed HTML string should not contain block elements.</li> |
|
404 | + * <li>**before_input** - (optional, string) the HTML string inserted right before the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
405 | + * <li>**after_input** - (optional, string) the HTML string inserted right after the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
406 | + * <li>**label_min_width** - (optional, string) the inline style property of the `min-width` of the label tag for the field. If the unit is not specified, 'px' is applied. Default: `120`. e.g. `100%`</li> |
|
407 | + * <li>**help** - (optional, string) the help description added to the contextual help tab.</li> |
|
408 | + * <li>**help_aside** - (optional, string) the additional help description for the side bar of the contextual help tab.</li> |
|
409 | + * <li>**repeatable** - [3.0.0+] (optional, array|boolean) whether the fields should be repeatable. If it yields true, the plus and the minus buttons appear next to each field that lets the user add/remove the fields. Optionally an setting array can be passed. |
|
410 | + * <h5>Repeatable Fields Setting Array</h5> |
|
411 | + * <ul> |
|
412 | + * <li>**max** - the allowed maximum number of fields to be repeated.</li> |
|
413 | + * <li>**min** - the allowed minimum number of fields to be repeated.</li> |
|
414 | + * <li>**disabled** - (optional, boolean|array) [3.8.13+] |
|
415 | + * <ul> |
|
416 | + * <li>**message** - (optional, string) the message to show when the user clicks on the `Add` repeatable button.</li> |
|
417 | + * <li>**caption** - (optional, string) the title of the modal window that displays the message. Default: Warning</li> |
|
418 | + * <li>**box_width** - (optional, integer) the width of the modal window that displays the message. Default: 300</li> |
|
419 | + * <li>**box_width** - (optional, integer) the height of the modal window that displays the message. Default: 100.</li> |
|
420 | + * <ul> |
|
421 | + * </li> |
|
422 | + * </ul> |
|
423 | + * </li> |
|
424 | + * <li>**sortable** - [3.0.0+] (optional, boolean) whether the fields should be sortable. If it yields true, the fields will be enclosed in a draggable box. |
|
425 | + * <li>**attributes** - [3.0.0+] (optional, array) holds key-value pairs representing the attribute and its property. Note that some field types have specific keys in the first dimensions. e.g. `array( 'class' => 'my_custom_class_selector', 'style' => 'background-color:#777', 'size' => 20, )` Every field holds the following nested attribute definition arrays. |
|
426 | + * <ul> |
|
427 | + * <li>**fieldrow** - the `td` tag element containing the field output.</li> |
|
428 | + * <li>**fieldset** - the `fieldset` tag element containing the field output.</li> |
|
429 | + * <li>**fields** - the `div` tag element containing the sub-fields and the main field.</li> |
|
430 | + * <li>**field** - the `div` tag element containing each field.</li> |
|
431 | + * </ul> |
|
432 | + * </li> |
|
433 | + * <li>**show_title_column** - [3.0.0+] (optional, boolean) If true, the field title column will be omitted from the output.</li> |
|
434 | + * <li>**hidden** - [3.0.0+] (optional, boolean) If true, the entire field row output will be invisible with the inline style attribute of `style="display:none"`.</li> |
|
435 | + * <li>**save** - [3.6.0+] (optional, boolean) If `false`, the field value will not be saved. Default: `true`</li> |
|
436 | + * <li>**content** - (optional, string|array) [3.6.1+] a custom section output. [3.8.0+] Supports an array to be passed for nested and inline-mixed fields. If an array holding field definitions is set, those fields will be nested. |
|
437 | + * <h4>Example</h4> |
|
438 | + * <pre><code> |
|
439 | + * $this->addSettingFields( |
|
440 | + * 'my_section_id', // the target section ID - pass dimensional keys of the section |
|
441 | + * array( |
|
442 | + * 'field_id' => 'Y', |
|
443 | + * 'title' => __( 'Y', 'admin-page-framework-loader' ), |
|
444 | + * 'description' => __( 'By passing an array of field definition to the <code>content</code> argument, you can nest fields.', 'admin-page-framework-loader' ) |
|
445 | + * . ' ' . __( 'Also the <code>type</code> argument can be omitted.', 'admin-page-framework-loader' ), |
|
446 | + * 'content' => array( |
|
447 | + * array( |
|
448 | + * 'field_id' => 'i', |
|
449 | + * 'title' => __( 'i', 'admin-page-framework-loader' ), |
|
450 | + * 'type' => 'textarea', |
|
451 | + * ), |
|
452 | + * array( |
|
453 | + * 'field_id' => 'ii', |
|
454 | + * 'title' => __( 'ii', 'admin-page-framework-loader' ), |
|
455 | + * 'type' => 'color', |
|
456 | + * ), |
|
457 | + * array( |
|
458 | + * 'field_id' => 'iii', |
|
459 | + * 'title' => __( 'iii', 'admin-page-framework-loader' ), |
|
460 | + * 'repeatable' => true, |
|
461 | + * 'sortable' => true, |
|
462 | + * 'content' => array( |
|
463 | + * array( |
|
464 | + * 'field_id' => 'a', |
|
465 | + * 'title' => __( 'a', 'admin-page-framework-loader' ), |
|
466 | + * 'type' => 'image', |
|
467 | + * 'attributes' => array( |
|
468 | + * 'preview' => array( |
|
469 | + * 'style' => 'max-width: 200px;', |
|
470 | + * ), |
|
471 | + * ), |
|
472 | + * ), |
|
473 | + * array( |
|
474 | + * 'field_id' => 'b', |
|
475 | + * 'title' => __( 'b', 'admin-page-framework-loader' ), |
|
476 | + * 'content' => array( |
|
477 | + * array( |
|
478 | + * 'field_id' => 'first', |
|
479 | + * 'title' => __( '1st', 'admin-page-framework-loader' ), |
|
480 | + * 'type' => 'color', |
|
481 | + * 'repeatable' => true, |
|
482 | + * 'sortable' => true, |
|
483 | + * ), |
|
484 | + * array( |
|
485 | + * 'field_id' => 'second', |
|
486 | + * 'title' => __( '2nd', 'admin-page-framework-loader' ), |
|
487 | + * 'type' => 'size', |
|
488 | + * ), |
|
489 | + * array( |
|
490 | + * 'field_id' => 'third', |
|
491 | + * 'title' => __( '3rd', 'admin-page-framework-loader' ), |
|
492 | + * 'type' => 'select', |
|
493 | + * 'label' => array( |
|
494 | + * 'x' => 'X', |
|
495 | + * 'y' => 'Y', |
|
496 | + * 'z' => 'Z', |
|
497 | + * ), |
|
498 | + * ), |
|
499 | + * ), |
|
500 | + * // 'description' => '', |
|
501 | + * ), |
|
502 | + * array( |
|
503 | + * 'field_id' => 'c', |
|
504 | + * 'title' => __( 'c', 'admin-page-framework-loader' ), |
|
505 | + * 'type' => 'radio', |
|
506 | + * 'label' => array( |
|
507 | + * 'a' => __( 'Apple', 'admin-page-framework-loader' ), |
|
508 | + * 'b' => __( 'Banana', 'admin-page-framework-loader' ), |
|
509 | + * 'c' => __( 'Cherry', 'admin-page-framework-loader' ), |
|
510 | + * ), |
|
511 | + * 'default' => 'b', |
|
512 | + * ), |
|
513 | + * ) |
|
514 | + * ), |
|
515 | + * ), |
|
516 | + * ) |
|
517 | + * ); |
|
518 | + * </code></pre> |
|
519 | + * </li> |
|
520 | + * <li>**placement** - [3.8.0+] (optional, string) Specifies where the field is rendered. Either `normal` `section_title` or `field_title` is accepted. `field_title` can only be used by nested fields defined in the `content` argument. Default: `normal`</li> |
|
521 | + * <li>**show_debug_info** - (optional, boolean) [3.8.8+] Whether to show debug information such as field definition tool-tips. Default: `true`.</li> |
|
522 | + * </ul> |
|
523 | + */ |
|
524 | 524 | public function addSettingField( $asFieldset ) { |
525 | 525 | if ( method_exists( $this->oForm, 'addField' ) ) { |
526 | 526 | $this->oForm->addField( $asFieldset ); |
@@ -583,26 +583,26 @@ discard block |
||
583 | 583 | } |
584 | 584 | |
585 | 585 | /** |
586 | - * Sets the given message to be displayed in the next page load. |
|
587 | - * |
|
588 | - * This is used to inform users about the submitted input data, such as "Updated successfully." or "Problem occurred." etc. |
|
589 | - * and normally used in validation callback methods. |
|
590 | - * |
|
591 | - * <h4>Example</h4> |
|
592 | - * ` |
|
593 | - * if ( ! $bVerified ) { |
|
594 | - * $this->setFieldErrors( $aErrors ); |
|
595 | - * $this->setSettingNotice( 'There was an error in your input.' ); |
|
596 | - * return $aOldPageOptions; |
|
597 | - * } |
|
598 | - * ` |
|
599 | - * |
|
600 | - * @since 3.0.4 |
|
601 | - * @param string $sMessage the text message to be displayed. |
|
602 | - * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
603 | - * @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. |
|
604 | - * @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. |
|
605 | - */ |
|
586 | + * Sets the given message to be displayed in the next page load. |
|
587 | + * |
|
588 | + * This is used to inform users about the submitted input data, such as "Updated successfully." or "Problem occurred." etc. |
|
589 | + * and normally used in validation callback methods. |
|
590 | + * |
|
591 | + * <h4>Example</h4> |
|
592 | + * ` |
|
593 | + * if ( ! $bVerified ) { |
|
594 | + * $this->setFieldErrors( $aErrors ); |
|
595 | + * $this->setSettingNotice( 'There was an error in your input.' ); |
|
596 | + * return $aOldPageOptions; |
|
597 | + * } |
|
598 | + * ` |
|
599 | + * |
|
600 | + * @since 3.0.4 |
|
601 | + * @param string $sMessage the text message to be displayed. |
|
602 | + * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
603 | + * @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. |
|
604 | + * @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. |
|
605 | + */ |
|
606 | 606 | public function setSettingNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
607 | 607 | $this->oForm->setSubmitNotice( $sMessage, $sType, $asAttributes, $bOverride ); |
608 | 608 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @return array|string |
50 | 50 | * @since 3.7.0 |
51 | 51 | */ |
52 | - public function getMessage( $sKey='' ) { |
|
52 | + public function getMessage( $sKey = '' ) { |
|
53 | 53 | return $this->oMsg->get( $sKey ); |
54 | 54 | } |
55 | 55 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * @since 2.1.0 |
182 | 182 | * @remark This method just adds the given text into the class property. The actual registration will be performed with the `replyToRegisterHelpTabTextForMetaBox()` method. |
183 | 183 | */ |
184 | - public function addHelpText( $sHTMLContent, $sHTMLSidebarContent="" ) { |
|
184 | + public function addHelpText( $sHTMLContent, $sHTMLSidebarContent = "" ) { |
|
185 | 185 | if ( method_exists( $this->oHelpPane, '_addHelpText' ) ) { |
186 | 186 | $this->oHelpPane->_addHelpText( $sHTMLContent, $sHTMLSidebarContent ); |
187 | 187 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
217 | 217 | |
218 | - foreach( func_get_args() as $_asSectionset ) { |
|
218 | + foreach ( func_get_args() as $_asSectionset ) { |
|
219 | 219 | $this->addSettingSection( $_asSectionset ); |
220 | 220 | } |
221 | 221 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function addSettingSection( $aSectionset ) { |
301 | 301 | |
302 | - if ( ! is_array( $aSectionset ) ) { |
|
302 | + if ( !is_array( $aSectionset ) ) { |
|
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * @param array (optional) add more field arrays to the next parameters as many as necessary. |
332 | 332 | */ |
333 | 333 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
334 | - foreach( func_get_args() as $_aFieldset ) { |
|
334 | + foreach ( func_get_args() as $_aFieldset ) { |
|
335 | 335 | $this->addSettingField( $_aFieldset ); |
336 | 336 | } |
337 | 337 | } |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | * @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. |
604 | 604 | * @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. |
605 | 605 | */ |
606 | - public function setSettingNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
606 | + public function setSettingNotice( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
607 | 607 | $this->oForm->setSubmitNotice( $sMessage, $sType, $asAttributes, $bOverride ); |
608 | 608 | } |
609 | 609 | |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
618 | 618 | * @return boolean True if a setting notice is set; otherwise, false. |
619 | 619 | */ |
620 | - public function hasSettingNotice( $sType='' ) { |
|
620 | + public function hasSettingNotice( $sType = '' ) { |
|
621 | 621 | return $this->oForm->hasSubmitNotice( $sType ); |
622 | 622 | } |
623 | 623 |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.9.1'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.9.1'; // <--- 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 = 'https://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', |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | * @since 3.5.0 |
153 | 153 | * @return string |
154 | 154 | */ |
155 | - public static function getPluginURL( $sRelativePath='' ) { |
|
155 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
156 | 156 | if ( isset( self::$_sPluginURLCache ) ) { |
157 | - return self::$_sPluginURLCache . $sRelativePath; |
|
157 | + return self::$_sPluginURLCache.$sRelativePath; |
|
158 | 158 | } |
159 | 159 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
160 | - return self::$_sPluginURLCache . $sRelativePath; |
|
160 | + return self::$_sPluginURLCache.$sRelativePath; |
|
161 | 161 | } |
162 | 162 | /** |
163 | 163 | * @since 3.7.9 |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | * Sets an admin notice. |
186 | 186 | * @since 3.5.0 |
187 | 187 | */ |
188 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
189 | - if ( ! is_admin() ) { |
|
188 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
189 | + if ( !is_admin() ) { |
|
190 | 190 | return; |
191 | 191 | } |
192 | - self::$_aAdminNotices[] = array( |
|
192 | + self::$_aAdminNotices[ ] = array( |
|
193 | 193 | 'message' => $sMessage, |
194 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
194 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
195 | 195 | ); |
196 | 196 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
197 | 197 | } |
@@ -200,12 +200,12 @@ discard block |
||
200 | 200 | * @since 3.5.0 |
201 | 201 | */ |
202 | 202 | static public function _replyToSetAdminNotice() { |
203 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
204 | - echo "<div class='" . esc_attr( $_aAdminNotice[ 'class_attribute' ] ) . " notice is-dismissible'>" |
|
203 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
204 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
205 | 205 | ."<p>" |
206 | 206 | . sprintf( |
207 | - '<strong>%1$s</strong>: ' . $_aAdminNotice[ 'message' ], |
|
208 | - self::NAME . ' ' . self::VERSION |
|
207 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
208 | + self::NAME.' '.self::VERSION |
|
209 | 209 | ) |
210 | 210 | . "</p>" |
211 | 211 | . "</div>"; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
218 | 218 | |
219 | 219 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
220 | -if ( ! defined( 'ABSPATH' ) ) { |
|
220 | +if ( !defined( 'ABSPATH' ) ) { |
|
221 | 221 | return; |
222 | 222 | } |
223 | 223 | if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) { |
@@ -229,8 +229,8 @@ discard block |
||
229 | 229 | |
230 | 230 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
231 | 231 | if ( |
232 | - ! $_bFrameworkLoaded |
|
233 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
232 | + !$_bFrameworkLoaded |
|
233 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
234 | 234 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
235 | 235 | ) { |
236 | 236 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -248,18 +248,18 @@ discard block |
||
248 | 248 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
249 | 249 | |
250 | 250 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
251 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
251 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
252 | 252 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
253 | 253 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
254 | 254 | include( |
255 | 255 | $_bLoadDevelopmentVersion |
256 | 256 | ? $_sDevelopmentVersionPath |
257 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
257 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
258 | 258 | ); |
259 | 259 | |
260 | 260 | // Include the framework loader plugin components. |
261 | 261 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
262 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
262 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
263 | 263 | new AdminPageFrameworkLoader_Bootstrap( |
264 | 264 | AdminPageFrameworkLoader_Registry::$sFilePath, |
265 | 265 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |