@@ -31,7 +31,7 @@ |
||
31 | 31 | if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
32 | 32 | return self::$_oInstance; |
33 | 33 | |
34 | - self::$aClassNames[] = $oProp->sClassName; |
|
34 | + self::$aClassNames[ ] = $oProp->sClassName; |
|
35 | 35 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_Page( $oProp, $oMsg ); |
36 | 36 | |
37 | 37 | return self::$_oInstance; |
@@ -27,8 +27,9 @@ |
||
27 | 27 | */ |
28 | 28 | public static function instantiate( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
|
31 | - return self::$_oInstance; |
|
30 | + if ( in_array( $oProp->sClassName, self::$aClassNames ) ) { |
|
31 | + return self::$_oInstance; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | self::$aClassNames[] = $oProp->sClassName; |
34 | 35 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_PostType( $oProp, $oMsg ); |
@@ -20,7 +20,6 @@ |
||
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Renders a registered meta box. |
23 | - |
|
24 | 23 | * @return void |
25 | 24 | * @param string $sContext `side`, `normal`, or `advanced`. |
26 | 25 | * @since 3.0.0 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | static $_iContainerID = 1; |
32 | 32 | |
33 | - $_sCurrentScreenID = $this->getCurrentScreenID(); |
|
33 | + $_sCurrentScreenID = $this->getCurrentScreenID(); |
|
34 | 34 | |
35 | 35 | /* If nothing is registered do not render even the container */ |
36 | 36 | $_aMetaBoxes = $this->getElementAsArray( |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function _replyToEnableMetaBox() { |
52 | 52 | |
53 | - if ( ! $this->oFactory->oProp->isPageAdded() ) { |
|
53 | + if ( !$this->oFactory->oProp->isPageAdded() ) { |
|
54 | 54 | return; |
55 | 55 | } |
56 | - if ( ! $this->_isMetaBoxAdded() ) { |
|
56 | + if ( !$this->_isMetaBoxAdded() ) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
60 | - $_sCurrentScreenID = $this->getCurrentScreenID(); |
|
60 | + $_sCurrentScreenID = $this->getCurrentScreenID(); |
|
61 | 61 | |
62 | 62 | // Trigger the add_meta_boxes hooks to allow meta boxes to be added. |
63 | 63 | do_action( "add_meta_boxes_{$_sCurrentScreenID}", null ); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | // the network admin adds '-network' in the screen ID and the hooks with that id won't be triggered so use the 'page_hook' global variable. |
82 | 82 | if ( isset( $GLOBALS[ 'page_hook' ] ) ) { |
83 | 83 | add_action( |
84 | - "admin_footer-{$GLOBALS['page_hook']}", |
|
84 | + "admin_footer-{$GLOBALS[ 'page_hook' ]}", |
|
85 | 85 | array( $this, '_replyToAddMetaboxScript' ) |
86 | 86 | ); |
87 | 87 | } |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * @return boolean |
100 | 100 | */ |
101 | - private function _doesMetaBoxExists( $sContext='' ) { |
|
101 | + private function _doesMetaBoxExists( $sContext = '' ) { |
|
102 | 102 | $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] ); |
103 | 103 | if ( $sContext ) { |
104 | - $_aDimensions[] = $sContext; |
|
104 | + $_aDimensions[ ] = $sContext; |
|
105 | 105 | } |
106 | 106 | $_aMetaBoxes = $this->getElementAsArray( |
107 | 107 | $GLOBALS, |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View_MetaBox`. |
118 | 118 | * @return boolean |
119 | 119 | */ |
120 | - private function _isMetaBoxAdded( $sPageSlug='' ) { |
|
120 | + private function _isMetaBoxAdded( $sPageSlug = '' ) { |
|
121 | 121 | |
122 | 122 | $_aPageMetaBoxClasses = $this->getElementAsArray( |
123 | 123 | $GLOBALS, |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | $sPageSlug = $sPageSlug |
131 | 131 | ? $sPageSlug |
132 | 132 | : $this->getElement( $_GET, 'page', '' ); |
133 | - if ( ! $sPageSlug ) { |
|
133 | + if ( !$sPageSlug ) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
137 | - foreach( $_aPageMetaBoxClasses as $_sClassName => $_oMetaBox ) { |
|
137 | + foreach ( $_aPageMetaBoxClasses as $_sClassName => $_oMetaBox ) { |
|
138 | 138 | if ( $this->_isPageOfMetaBox( $sPageSlug, $_oMetaBox ) ) { |
139 | 139 | return true; |
140 | 140 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function _isPageOfMetaBox( $sPageSlug, $oMetaBox ) { |
154 | 154 | |
155 | - if ( in_array( $sPageSlug , $oMetaBox->oProp->aPageSlugs ) ) { |
|
155 | + if ( in_array( $sPageSlug, $oMetaBox->oProp->aPageSlugs ) ) { |
|
156 | 156 | return true; // for numeric keys with a string value. |
157 | 157 | } |
158 | - if ( ! array_key_exists( $sPageSlug , $oMetaBox->oProp->aPageSlugs ) ) { |
|
158 | + if ( !array_key_exists( $sPageSlug, $oMetaBox->oProp->aPageSlugs ) ) { |
|
159 | 159 | return false; // for keys of page slugs, the key does not exist, it means not added. |
160 | 160 | } |
161 | 161 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function _replyToEnableMetaBox() { |
52 | 52 | |
53 | - if ( ! $this->oFactory->oProp->isPageAdded() ) { |
|
53 | + if ( ! $this->oFactory->oProp->isPageAdded() ) { |
|
54 | 54 | return; |
55 | 55 | } |
56 | 56 | if ( ! $this->_isMetaBoxAdded() ) { |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | $sPageSlug = $sPageSlug |
131 | 131 | ? $sPageSlug |
132 | 132 | : $this->getElement( $_GET, 'page', '' ); |
133 | - if ( ! $sPageSlug ) { |
|
133 | + if ( ! $sPageSlug ) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
137 | 137 | foreach( $_aPageMetaBoxClasses as $_sClassName => $_oMetaBox ) { |
138 | - if ( $this->_isPageOfMetaBox( $sPageSlug, $_oMetaBox ) ) { |
|
138 | + if ( $this->_isPageOfMetaBox( $sPageSlug, $_oMetaBox ) ) { |
|
139 | 139 | return true; |
140 | 140 | } |
141 | 141 | } |
@@ -224,7 +224,7 @@ |
||
224 | 224 | $this->oFactory->oForm->aConditionedFields, |
225 | 225 | array( $this->oFactory, '_replyToGetSectionHeaderOutput' ), |
226 | 226 | array( $this->oFactory, '_replyToGetFieldOutput' ) |
227 | - ); |
|
227 | + ); |
|
228 | 228 | |
229 | 229 | } |
230 | 230 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Do actions before rendering the page. In this order, global -> page -> in-page tab |
49 | 49 | $this->addAndDoActions( |
50 | - $this->oFactory, // the caller object |
|
50 | + $this->oFactory, // the caller object |
|
51 | 51 | $this->getFilterArrayByPrefix( 'do_before_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks |
52 | 52 | $this->oFactory // the argument 1 |
53 | 53 | ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | </div><!-- #post-body --> |
73 | 73 | </div><!-- #poststuff --> |
74 | 74 | |
75 | - <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> |
|
75 | + <?php echo $this->_printFormClosingTag( $_sPageSlug, $_sTabSlug, $this->oFactory->oProp->bEnableForm ); // </form> ?> |
|
76 | 76 | </div><!-- .admin-page-framework-container --> |
77 | 77 | |
78 | 78 | <?php |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | <?php |
84 | 84 | // Do actions after rendering the page. |
85 | 85 | $this->addAndDoActions( |
86 | - $this->oFactory, // the caller object |
|
86 | + $this->oFactory, // the caller object |
|
87 | 87 | $this->getFilterArrayByPrefix( 'do_after_', $this->oFactory->oProp->sClassName, $_sPageSlug, $_sTabSlug, true ), // the action hooks |
88 | 88 | $this->oFactory // the argument 1 |
89 | 89 | ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $_iColumns = $this->getNumberOfScreenColumns(); |
103 | 103 | return $_iColumns |
104 | 104 | ? $_iColumns |
105 | - : 1; // default - this is because generic pages do not have meta boxes. |
|
105 | + : 1; // default - this is because generic pages do not have meta boxes. |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | private function _getContentTop() { |
114 | 114 | |
115 | 115 | // Screen icon, page heading tabs(page title), and in-page tabs. |
116 | - $_oScreenIcon = new AdminPageFramework_View_PageRenderer_ScreenIcon( |
|
116 | + $_oScreenIcon = new AdminPageFramework_View_PageRenderer_ScreenIcon( |
|
117 | 117 | $this->oFactory, |
118 | 118 | $this->sPageSlug, |
119 | 119 | $this->sTabSlug |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->oFactory, |
130 | 130 | $this->sPageSlug |
131 | 131 | ); |
132 | - $_sContentTop .= $_oInPageTabs->get(); |
|
132 | + $_sContentTop .= $_oInPageTabs->get(); |
|
133 | 133 | |
134 | 134 | // Apply filters in this order, in-page tab -> page -> global. |
135 | 135 | return $this->addAndApplyFilters( |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | private function _printMainPageContent( $sPageSlug, $sTabSlug ) { |
158 | 158 | |
159 | 159 | /* Check if a sidebar meta box is registered */ |
160 | - $_bSideMetaboxExists = ( isset( $GLOBALS['wp_meta_boxes'][ $GLOBALS['page_hook'] ][ 'side' ] ) |
|
161 | - && count( $GLOBALS['wp_meta_boxes'][ $GLOBALS['page_hook'] ][ 'side' ] ) > 0 ); |
|
160 | + $_bSideMetaboxExists = ( isset( $GLOBALS[ 'wp_meta_boxes' ][ $GLOBALS[ 'page_hook' ] ][ 'side' ] ) |
|
161 | + && count( $GLOBALS[ 'wp_meta_boxes' ][ $GLOBALS[ 'page_hook' ] ][ 'side' ] ) > 0 ); |
|
162 | 162 | |
163 | 163 | echo "<!-- main admin page content -->"; |
164 | 164 | echo "<div class='admin-page-framework-content'>"; |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | */ |
203 | 203 | private function _getFormOutput( $sPageSlug ) { |
204 | 204 | |
205 | - if ( ! $this->oFactory->oProp->bEnableForm ) { |
|
205 | + if ( !$this->oFactory->oProp->bEnableForm ) { |
|
206 | 206 | return ''; |
207 | 207 | } |
208 | - if ( ! $this->oFactory->oForm->isPageAdded( $sPageSlug ) ) { |
|
208 | + if ( !$this->oFactory->oForm->isPageAdded( $sPageSlug ) ) { |
|
209 | 209 | return ''; |
210 | 210 | } |
211 | 211 | |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | * @internal |
252 | 252 | * @return void |
253 | 253 | */ |
254 | - private function _printFormOpeningTag( $fEnableForm=true ) { |
|
254 | + private function _printFormOpeningTag( $fEnableForm = true ) { |
|
255 | 255 | |
256 | - if ( ! $fEnableForm ) { |
|
256 | + if ( !$fEnableForm ) { |
|
257 | 257 | return; |
258 | 258 | } |
259 | 259 | |
@@ -266,12 +266,12 @@ discard block |
||
266 | 266 | 'action' => wp_unslash( remove_query_arg( 'settings-updated', $this->oFactory->oProp->sTargetFormPage ) ), |
267 | 267 | ) |
268 | 268 | ) |
269 | - . " >" . PHP_EOL; |
|
269 | + . " >".PHP_EOL; |
|
270 | 270 | |
271 | 271 | // [3.5.11+] Insert a mark that indicates the framework form has started. |
272 | 272 | // This will be checked in the validation method with the `is_admin_page_framework` input value which gets inserted at the end of the form |
273 | 273 | // in order to determine all the fields are sent for the PHP max_input_vars limitation set in the server configuration. |
274 | - echo "<input type='hidden' name='admin_page_framework_start' value='1' />" . PHP_EOL; |
|
274 | + echo "<input type='hidden' name='admin_page_framework_start' value='1' />".PHP_EOL; |
|
275 | 275 | |
276 | 276 | // Embed the '_wp_http_referer' hidden field that is checked in the submit data processing method. |
277 | 277 | settings_fields( $this->oFactory->oProp->sOptionKey ); |
@@ -287,19 +287,19 @@ discard block |
||
287 | 287 | * @internal |
288 | 288 | * @return void |
289 | 289 | */ |
290 | - private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm=true ) { |
|
290 | + private function _printFormClosingTag( $sPageSlug, $sTabSlug, $fEnableForm = true ) { |
|
291 | 291 | |
292 | - if ( ! $fEnableForm ) { |
|
292 | + if ( !$fEnableForm ) { |
|
293 | 293 | return; |
294 | 294 | } |
295 | 295 | |
296 | - $_sNonceTransientKey = 'form_' . md5( $this->oFactory->oProp->sClassName . get_current_user_id() ); |
|
297 | - $_sNonce = $this->getTransient( $_sNonceTransientKey, '_admin_page_framework_form_nonce_' . uniqid() ); |
|
298 | - $this->setTransient( $_sNonceTransientKey, $_sNonce, 60*60 ); // 60 minutes |
|
299 | - echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />" . PHP_EOL |
|
300 | - . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />" . PHP_EOL |
|
301 | - . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />" . PHP_EOL |
|
302 | - . "</form><!-- End Form -->" . PHP_EOL; |
|
296 | + $_sNonceTransientKey = 'form_'.md5( $this->oFactory->oProp->sClassName.get_current_user_id() ); |
|
297 | + $_sNonce = $this->getTransient( $_sNonceTransientKey, '_admin_page_framework_form_nonce_'.uniqid() ); |
|
298 | + $this->setTransient( $_sNonceTransientKey, $_sNonce, 60 * 60 ); // 60 minutes |
|
299 | + echo "<input type='hidden' name='page_slug' value='{$sPageSlug}' />".PHP_EOL |
|
300 | + . "<input type='hidden' name='tab_slug' value='{$sTabSlug}' />".PHP_EOL |
|
301 | + . "<input type='hidden' name='_is_admin_page_framework' value='{$_sNonce}' />".PHP_EOL |
|
302 | + . "</form><!-- End Form -->".PHP_EOL; |
|
303 | 303 | |
304 | 304 | } |
305 | 305 |
@@ -244,7 +244,7 @@ |
||
244 | 244 | * @internal |
245 | 245 | * @return void |
246 | 246 | */ |
247 | - private function _printFormOpeningTag( $fEnableForm=true ) { |
|
247 | + private function _printFormOpeningTag( $fEnableForm=true ) { |
|
248 | 248 | |
249 | 249 | if ( ! $fEnableForm ) { |
250 | 250 | return; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $_sTag = $this->_getInPageTabTag( $sTag, $_aPage ); |
74 | 74 | |
75 | 75 | // If the in-page tabs' visibility is set to false, returns the title. |
76 | - if ( ! $_aPage[ 'show_in_page_tabs' ] ) { |
|
76 | + if ( !$_aPage[ 'show_in_page_tabs' ] ) { |
|
77 | 77 | return isset( $aInPageTabs[ $_sCurrentTabSlug ][ 'title' ] ) |
78 | 78 | ? "<{$_sTag}>" |
79 | 79 | . $aInPageTabs[ $_sCurrentTabSlug ][ 'title' ] |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | private function _getInPageTabNavigationBar( array $aTabs, $sActiveTab, $sCurrentPageSlug, $sTag ) { |
101 | 101 | |
102 | 102 | $_oTabBar = new AdminPageFramework_TabNavigationBar( |
103 | - $aTabs, // tabs |
|
103 | + $aTabs, // tabs |
|
104 | 104 | $sActiveTab, // active tab slug |
105 | - $sTag, // container tag |
|
105 | + $sTag, // container tag |
|
106 | 106 | array( // container attributes |
107 | 107 | 'class' => 'in-page-tab', |
108 | 108 | ), |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @since 3.5.10 |
131 | 131 | * @since 3.6.3 Moved from `AdminPageFramework_Page_View`. |
132 | 132 | */ |
133 | - public function _replyToFormatNavigationTabItem_InPageTab( array $aTab, array $aStructure, array $aTabs, array $aArguments=array() ) { |
|
133 | + public function _replyToFormatNavigationTabItem_InPageTab( array $aTab, array $aStructure, array $aTabs, array $aArguments = array() ) { |
|
134 | 134 | $_oFormatter = new AdminPageFramework_Format_NavigationTab_InPageTab( |
135 | 135 | $aTab, |
136 | 136 | $aStructure, |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function _appendInlineAssets( $sInline, &$aContainer ) { |
69 | 69 | $_aInlines = array_unique( $aContainer ); |
70 | - $sInline = PHP_EOL . $sInline; |
|
71 | - foreach( $_aInlines as $_iIndex => $_sInline ) { |
|
72 | - $sInline .= $_sInline . PHP_EOL; |
|
70 | + $sInline = PHP_EOL.$sInline; |
|
71 | + foreach ( $_aInlines as $_iIndex => $_sInline ) { |
|
72 | + $sInline .= $_sInline.PHP_EOL; |
|
73 | 73 | unset( $_aInlines[ $_iIndex ] ); |
74 | 74 | } |
75 | 75 | $aContainer = $_aInlines; // update the container array. |
@@ -83,23 +83,23 @@ discard block |
||
83 | 83 | private function _parseAssets( $oFactory ) { |
84 | 84 | |
85 | 85 | // page |
86 | - $_aPageStyles = $this->getElementAsArray( |
|
86 | + $_aPageStyles = $this->getElementAsArray( |
|
87 | 87 | $oFactory->oProp->aPages, |
88 | 88 | array( $this->sCurrentPageSlug, 'style' ) |
89 | 89 | ); |
90 | 90 | $this->_enqueuePageAssets( $_aPageStyles, 'style' ); |
91 | 91 | |
92 | - $_aPageScripts = $this->getElementAsArray( |
|
92 | + $_aPageScripts = $this->getElementAsArray( |
|
93 | 93 | $oFactory->oProp->aPages, |
94 | 94 | array( $this->sCurrentPageSlug, 'script' ) |
95 | 95 | ); |
96 | 96 | $this->_enqueuePageAssets( $_aPageScripts, 'script' ); |
97 | 97 | |
98 | 98 | // In-page tabs |
99 | - if ( ! $this->sCurrentTabSlug ) { |
|
99 | + if ( !$this->sCurrentTabSlug ) { |
|
100 | 100 | return; |
101 | 101 | } |
102 | - $_aInPageTabStyles = $this->getElementAsArray( |
|
102 | + $_aInPageTabStyles = $this->getElementAsArray( |
|
103 | 103 | $oFactory->oProp->aInPageTabs, |
104 | 104 | array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' ) |
105 | 105 | ); |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | * @since 3.6.3 |
117 | 117 | * @return void |
118 | 118 | */ |
119 | - private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) { |
|
120 | - $_sMathodName = "_enqueueAsset_" . $sType; |
|
121 | - foreach( $aPageAssets as $_asPageAsset ) { |
|
122 | - $this->{$_sMathodName}( $_asPageAsset); |
|
119 | + private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) { |
|
120 | + $_sMathodName = "_enqueueAsset_".$sType; |
|
121 | + foreach ( $aPageAssets as $_asPageAsset ) { |
|
122 | + $this->{$_sMathodName}( $_asPageAsset ); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // Insert the CSS rule in the head tag. |
147 | - $this->aCSSRules[] = $_sSRC; |
|
147 | + $this->aCSSRules[ ] = $_sSRC; |
|
148 | 148 | |
149 | 149 | } |
150 | 150 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | // Insert the scripts in the head tag. |
172 | - $this->aScripts[] = $_sSRC; |
|
172 | + $this->aScripts[ ] = $_sSRC; |
|
173 | 173 | |
174 | 174 | } |
175 | 175 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
35 | 35 | * @return void |
36 | 36 | */ |
37 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
37 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
38 | 38 | |
39 | 39 | if ( empty( $asPostTypeOrScreenID ) ) { |
40 | 40 | return; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | $this->oProp->sMetaBoxID = $sMetaBoxID ? $this->oUtil->sanitizeSlug( $sMetaBoxID ) : strtolower( $_sClassName ); |
56 | 56 | $this->oProp->sTitle = $sTitle; |
57 | - $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
58 | - $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
57 | + $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
58 | + $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
59 | 59 | |
60 | 60 | if ( $this->oProp->bIsAdmin ) { |
61 | 61 | add_action( 'current_screen', array( $this, '_replyToDetermineToLoad' ) ); |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function _isInThePage() { |
75 | 75 | |
76 | - if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
76 | + if ( !in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | |
80 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
80 | + if ( !in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | protected function _isInstantiatable() { |
94 | 94 | |
95 | 95 | // Disable in admin-ajax.php |
96 | - if ( isset( $GLOBALS['pagenow'] ) && 'admin-ajax.php' === $GLOBALS['pagenow'] ) { |
|
96 | + if ( isset( $GLOBALS[ 'pagenow' ] ) && 'admin-ajax.php' === $GLOBALS[ 'pagenow' ] ) { |
|
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | return true; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function _replyToDetermineToLoad( $oScreen ) { |
111 | 111 | |
112 | - if ( ! $this->_isInThePage() ) { |
|
112 | + if ( !$this->_isInThePage() ) { |
|
113 | 113 | return; |
114 | 114 | } |
115 | 115 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
38 | 38 | |
39 | - if ( empty( $asPostTypeOrScreenID ) ) { |
|
39 | + if ( empty( $asPostTypeOrScreenID ) ) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function _isInThePage() { |
75 | 75 | |
76 | - if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
76 | + if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | |
80 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
80 | + if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function _replyToDetermineToLoad( $oScreen ) { |
111 | 111 | |
112 | - if ( ! $this->_isInThePage() ) { |
|
112 | + if ( ! $this->_isInThePage() ) { |
|
113 | 113 | return; |
114 | 114 | } |
115 | 115 |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @since 2.1.5 |
31 | 31 | * @internal |
32 | 32 | */ |
33 | - public function _enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
33 | + public function _enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
34 | 34 | |
35 | 35 | $_aHandleIDs = array(); |
36 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
37 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
36 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
37 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
38 | 38 | } |
39 | 39 | return $_aHandleIDs; |
40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
59 | 59 | * @internal |
60 | 60 | */ |
61 | - public function _enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
61 | + public function _enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
62 | 62 | |
63 | 63 | $sSRC = trim( $sSRC ); |
64 | 64 | if ( empty( $sSRC ) ) { return ''; } |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | 'sSRC' => $sSRC, |
75 | 75 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
76 | 76 | 'sType' => 'style', |
77 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
77 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
78 | 78 | ), |
79 | 79 | self::$_aStructure_EnqueuingResources |
80 | 80 | ); |
81 | 81 | |
82 | 82 | // Store the attributes in another container by url. |
83 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
83 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
84 | 84 | |
85 | 85 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
86 | 86 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | * @since 2.1.5 |
93 | 93 | * @internal |
94 | 94 | */ |
95 | - public function _enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
95 | + public function _enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
96 | 96 | |
97 | 97 | $_aHandleIDs = array(); |
98 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
99 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
98 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
99 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
100 | 100 | } |
101 | 101 | return $_aHandleIDs; |
102 | 102 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
122 | 122 | * @internal |
123 | 123 | */ |
124 | - public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
124 | + public function _enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
125 | 125 | |
126 | 126 | $sSRC = trim( $sSRC ); |
127 | 127 | if ( empty( $sSRC ) ) { return ''; } |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | 'sSRC' => $sSRC, |
138 | 138 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
139 | 139 | 'sType' => 'script', |
140 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
140 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
141 | 141 | ), |
142 | 142 | self::$_aStructure_EnqueuingResources |
143 | 143 | ); |
144 | 144 | |
145 | 145 | // Store the attributes in another container by url. |
146 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
146 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
147 | 147 | |
148 | 148 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
149 | 149 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @since 3.0.0 |
156 | 156 | * @internal |
157 | 157 | */ |
158 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
158 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
159 | 159 | return $this->_enqueueStyle( $sSRC, array(), $aCustomArgs ); |
160 | 160 | } |
161 | 161 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @since 3.0.0 |
165 | 165 | * @internal |
166 | 166 | */ |
167 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
167 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
168 | 168 | return $this->_enqueueScript( $sSRC, array(), $aCustomArgs ); |
169 | 169 | } |
170 | 170 | |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function _enqueueSRCByCondition( $aEnqueueItem ) { |
179 | 179 | |
180 | - $_sCurrentPostType = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ( isset( $GLOBALS['typenow'] ) ? $GLOBALS['typenow'] : null ); |
|
181 | - if ( in_array( $_sCurrentPostType, $aEnqueueItem['aPostTypes'] ) ) { |
|
180 | + $_sCurrentPostType = isset( $_GET[ 'post_type' ] ) ? $_GET[ 'post_type' ] : ( isset( $GLOBALS[ 'typenow' ] ) ? $GLOBALS[ 'typenow' ] : null ); |
|
181 | + if ( in_array( $_sCurrentPostType, $aEnqueueItem[ 'aPostTypes' ] ) ) { |
|
182 | 182 | return $this->_enqueueSRC( $aEnqueueItem ); |
183 | 183 | } |
184 | 184 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since 2.1.0 Moved from the meta box class. |
36 | 36 | * @var string |
37 | 37 | */ |
38 | - public $sMetaBoxID =''; |
|
38 | + public $sMetaBoxID = ''; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Stores the meta box title. |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public $sFieldsType = 'post_meta_box'; |
150 | 150 | |
151 | - public function __construct( $oCaller, $sClassName, $sCapability='edit_posts', $sTextDomain='admin-page-framework', $sFieldsType='post_meta_box' ) { |
|
151 | + public function __construct( $oCaller, $sClassName, $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework', $sFieldsType = 'post_meta_box' ) { |
|
152 | 152 | |
153 | 153 | parent::__construct( $oCaller, null, $sClassName, $sCapability, $sTextDomain, $sFieldsType ); // meta boxes don't need the caller script path. |
154 | 154 |