@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @since 3.8.9 |
| 29 | 29 | * @return void |
| 30 | 30 | **/ |
| 31 | - static protected function _log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) { |
|
| 31 | + static protected function _log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) { |
|
| 32 | 32 | |
| 33 | 33 | static $_fPreviousTimeStamp = 0; |
| 34 | 34 | |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time |
| 55 | 55 | $_sCallerClass, |
| 56 | 56 | $_sCallerFunction |
| 57 | - ) . PHP_EOL |
|
| 58 | - . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) . PHP_EOL; |
|
| 57 | + ).PHP_EOL |
|
| 58 | + . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ).PHP_EOL; |
|
| 59 | 59 | } |
| 60 | 60 | /** |
| 61 | 61 | * @since 3.8.9 |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | static private function ___getCallerFunctionName( $oCallerInfo, $iTrace ) { |
| 65 | 65 | return self::getElement( |
| 66 | - $oCallerInfo, // subject array |
|
| 66 | + $oCallerInfo, // subject array |
|
| 67 | 67 | array( 2 + $iTrace, 'function' ), // key |
| 68 | 68 | '' // default |
| 69 | 69 | ); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | static private function ___getCallerClassName( $oCallerInfo, $iTrace ) { |
| 76 | 76 | return self::getElement( |
| 77 | - $oCallerInfo, // subject array |
|
| 77 | + $oCallerInfo, // subject array |
|
| 78 | 78 | array( 2 + $iTrace, 'class' ), // key |
| 79 | 79 | '' // default |
| 80 | 80 | ); |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | static private function ___getLogFilePath( $bsFilePathOrName, $sCallerClass ) { |
| 91 | 91 | |
| 92 | - $_sWPContentDir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR; |
|
| 92 | + $_sWPContentDir = WP_CONTENT_DIR.DIRECTORY_SEPARATOR; |
|
| 93 | 93 | |
| 94 | 94 | // It is a partial file name |
| 95 | - if ( is_string( $bsFilePathOrName ) && ! self::hasSlash( $bsFilePathOrName ) ) { |
|
| 96 | - return $_sWPContentDir . $bsFilePathOrName . '_' . date( "Ymd" ) . '.log'; |
|
| 95 | + if ( is_string( $bsFilePathOrName ) && !self::hasSlash( $bsFilePathOrName ) ) { |
|
| 96 | + return $_sWPContentDir.$bsFilePathOrName.'_'.date( "Ymd" ).'.log'; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | // Try creating a file. |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // Return a generated default log path. |
| 108 | 108 | $_sClassBaseName = $sCallerClass ? basename( $sCallerClass ) : basename( get_class() ); |
| 109 | - return $_sWPContentDir . $_sClassBaseName . '_' . date( "Ymd" ) . '.log'; |
|
| 109 | + return $_sWPContentDir.$_sClassBaseName.'_'.date( "Ymd" ).'.log'; |
|
| 110 | 110 | |
| 111 | 111 | } |
| 112 | 112 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @internal |
| 116 | 116 | */ |
| 117 | 117 | static private function ___createFile( $sFilePath ) { |
| 118 | - if ( ! $sFilePath || true === $sFilePath ) { |
|
| 118 | + if ( !$sFilePath || true === $sFilePath ) { |
|
| 119 | 119 | return false; |
| 120 | 120 | } |
| 121 | 121 | if ( file_exists( $sFilePath ) ) { |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | $_nNow = $fCurrentTimeStamp + ( self::___getSiteGMTOffset() * 60 * 60 ); |
| 138 | 138 | $_nMicroseconds = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' ); |
| 139 | 139 | $_aOutput = array( |
| 140 | - date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds, |
|
| 140 | + date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds, |
|
| 141 | 141 | self::___getFormattedElapsedTime( $nElapsed ), |
| 142 | 142 | self::___getPageLoadID(), |
| 143 | 143 | self::getFrameworkVersion(), |
| 144 | - $sCallerClass . '::' . $sCallerFunction, |
|
| 144 | + $sCallerClass.'::'.$sCallerFunction, |
|
| 145 | 145 | current_filter(), |
| 146 | 146 | self::getCurrentURL(), |
| 147 | 147 | ); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | static private function ___getSiteGMTOffset() { |
| 158 | 158 | static $_nGMTOffset; |
| 159 | - $_nGMTOffset = isset( $_nGMTOffset ) |
|
| 159 | + $_nGMTOffset = isset( $_nGMTOffset ) |
|
| 160 | 160 | ? $_nGMTOffset |
| 161 | 161 | : get_option( 'gmt_offset' ); |
| 162 | 162 | return $_nGMTOffset; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | static private function ___getPageLoadID() { |
| 169 | 169 | static $_sPageLoadID; |
| 170 | - $_sPageLoadID = $_sPageLoadID |
|
| 170 | + $_sPageLoadID = $_sPageLoadID |
|
| 171 | 171 | ? $_sPageLoadID |
| 172 | 172 | : uniqid(); |
| 173 | 173 | return $_sPageLoadID; |
@@ -191,15 +191,15 @@ discard block |
||
| 191 | 191 | 3, |
| 192 | 192 | '0' |
| 193 | 193 | ); |
| 194 | - $_sElapsed = self::getElement( |
|
| 195 | - $_aElapsedParts, // subject array |
|
| 196 | - 0, // key |
|
| 194 | + $_sElapsed = self::getElement( |
|
| 195 | + $_aElapsedParts, // subject array |
|
| 196 | + 0, // key |
|
| 197 | 197 | 0 // default |
| 198 | 198 | ); |
| 199 | - $_sElapsed = strlen( $_sElapsed ) > 1 |
|
| 200 | - ? '+' . substr( $_sElapsed, -1, 2 ) |
|
| 201 | - : ' ' . $_sElapsed; |
|
| 202 | - return $_sElapsed . '.' . $_sElapsedFloat; |
|
| 199 | + $_sElapsed = strlen( $_sElapsed ) > 1 |
|
| 200 | + ? '+'.substr( $_sElapsed, -1, 2 ) |
|
| 201 | + : ' '.$_sElapsed; |
|
| 202 | + return $_sElapsed.'.'.$_sElapsedFloat; |
|
| 203 | 203 | |
| 204 | 204 | } |
| 205 | 205 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $aField = $this->aFieldset; |
| 71 | 71 | |
| 72 | - if ( ! $aField[ 'show_title_column' ] ) { |
|
| 72 | + if ( !$aField[ 'show_title_column' ] ) { |
|
| 73 | 73 | return ''; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'for' => $_oInputTagIDGenerator->get(), |
| 84 | 84 | ); |
| 85 | 85 | $_sOutput .= $aField[ 'title' ] |
| 86 | - ? "<label " . $this->getAttributes( $_aLabelAttributes ) . "'>" |
|
| 86 | + ? "<label ".$this->getAttributes( $_aLabelAttributes )."'>" |
|
| 87 | 87 | . "<a id='{$aField[ 'field_id' ]}'></a>" // to allow the browser to link to the element. |
| 88 | 88 | . "<span title='" |
| 89 | 89 | . esc_attr( |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function _getFieldOutputsInFieldTitleAreaFromNestedFields( $aField ) { |
| 115 | 115 | |
| 116 | - if ( ! $this->hasNestedFields( $aField ) ) { |
|
| 116 | + if ( !$this->hasNestedFields( $aField ) ) { |
|
| 117 | 117 | return ''; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $_sOutput = ''; |
| 121 | - foreach( $aField[ 'content' ] as $_aNestedField ) { |
|
| 121 | + foreach ( $aField[ 'content' ] as $_aNestedField ) { |
|
| 122 | 122 | |
| 123 | 123 | if ( 'field_title' !== $_aNestedField[ 'placement' ] ) { |
| 124 | 124 | continue; |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
| 128 | 128 | $_aNestedField, |
| 129 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
| 129 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
| 130 | 130 | $this->aFieldErrors, |
| 131 | 131 | $this->aFieldTypeDefinitions, |
| 132 | 132 | $this->oMsg, |
| 133 | 133 | $this->aCallbacks // field output element callables. |
| 134 | 134 | ); |
| 135 | - $_sOutput .= $_oFieldset->get(); // field output |
|
| 135 | + $_sOutput .= $_oFieldset->get(); // field output |
|
| 136 | 136 | |
| 137 | 137 | } |
| 138 | 138 | return $_sOutput; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @since 3.7.0 |
| 145 | 145 | */ |
| 146 | 146 | private function _getToolTip( $asTip, $sElementID ) { |
| 147 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
| 147 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
| 148 | 148 | $asTip, |
| 149 | 149 | $sElementID |
| 150 | 150 | ); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | private function _getTitleColon( $aField ) { |
| 159 | 159 | |
| 160 | - if ( ! isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
| 160 | + if ( !isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
| 161 | 161 | return ''; |
| 162 | 162 | } |
| 163 | 163 | if ( |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | $aField[ '_structure_type' ], |
| 166 | 166 | array( 'widget', 'post_meta_box', 'page_meta_box' ) |
| 167 | 167 | ) |
| 168 | - ){ |
|
| 169 | - return "<span class='title-colon'>:</span>" ; |
|
| 168 | + ) { |
|
| 169 | + return "<span class='title-colon'>:</span>"; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | } |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
| 19 | 19 | |
| 20 | - public $aArguments = array( |
|
| 20 | + public $aArguments = array( |
|
| 21 | 21 | 'title' => null, |
| 22 | 22 | 'tag' => null, |
| 23 | 23 | 'section_index' => null, |
| 24 | 24 | |
| 25 | 25 | 'sectionset' => array(), |
| 26 | 26 | ); |
| 27 | - public $aFieldsets = array(); |
|
| 27 | + public $aFieldsets = array(); |
|
| 28 | 28 | public $aSavedData = array(); |
| 29 | 29 | public $aFieldErrors = array(); |
| 30 | 30 | public $aFieldTypeDefinitions = array(); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
| 91 | 91 | * @return string The section title output. |
| 92 | 92 | */ |
| 93 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
| 93 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
| 94 | 94 | |
| 95 | 95 | $_aSectionTitleFieldset = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
| 96 | 96 | $_sFieldsInSectionTitle = $this->_getFieldsetsOutputInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $_bHasOtherFields = $_sFieldsInSectionTitle |
| 101 | 101 | ? ' has-fields' |
| 102 | 102 | : ''; |
| 103 | - $_sOutput = $_sTitle . $_sFieldsInSectionTitle; |
|
| 103 | + $_sOutput = $_sTitle.$_sFieldsInSectionTitle; |
|
| 104 | 104 | return $_sOutput |
| 105 | 105 | ? "<div class='section-title-height-fixer'></div>" |
| 106 | 106 | . "<div class='section-title-outer-container'>" // 3.8.13+ For vertical alignment |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @return string |
| 129 | 129 | */ |
| 130 | 130 | private function _getToolTip( $_aSectionset ) { |
| 131 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
| 131 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
| 132 | 132 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
| 133 | 133 | $_aSectionset[ 'tip' ], |
| 134 | 134 | $_sSectionTitleTagID |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 161 | 161 | |
| 162 | 162 | $_sOutput = ''; |
| 163 | - foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
| 164 | - if ( empty( $_aFieldset ) ) { |
|
| 163 | + foreach ( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
| 164 | + if ( empty( $_aFieldset ) ) { |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | private function _getFieldsetsInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 178 | 178 | |
| 179 | 179 | $_aFieldsetsInSectionTitle = array(); |
| 180 | - foreach( $aFieldsets as $_aFieldset ) { |
|
| 180 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
| 181 | 181 | |
| 182 | 182 | if ( 'section_title' !== $_aFieldset[ 'placement' ] ) { |
| 183 | 183 | continue; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $iSectionIndex, |
| 189 | 189 | $aFieldTypeDefinitions |
| 190 | 190 | ); |
| 191 | - $_aFieldsetsInSectionTitle[] = $_oFieldsetOutputFormatter->get(); |
|
| 191 | + $_aFieldsetsInSectionTitle[ ] = $_oFieldsetOutputFormatter->get(); |
|
| 192 | 192 | |
| 193 | 193 | } |
| 194 | 194 | return $_aFieldsetsInSectionTitle; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
| 209 | 209 | |
| 210 | - foreach( $aFieldsets as $_aFieldset ) { |
|
| 210 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
| 211 | 211 | |
| 212 | 212 | if ( 'section_title' !== $_aFieldset[ 'type' ] ) { |
| 213 | 213 | continue; |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | CSSRULES; |
| 283 | 283 | |
| 284 | 284 | } |
| 285 | - private function ___getForWP38OrBelow(){ |
|
| 285 | + private function ___getForWP38OrBelow() { |
|
| 286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
| 287 | 287 | return ''; |
| 288 | 288 | } |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | CSSRULES; |
| 283 | 283 | |
| 284 | 284 | } |
| 285 | - private function ___getForWP38OrBelow(){ |
|
| 285 | + private function ___getForWP38OrBelow() { |
|
| 286 | 286 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
| 287 | 287 | return ''; |
| 288 | 288 | } |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | if ( empty( $asArguments ) ) { |
| 447 | 447 | return ''; |
| 448 | 448 | } |
| 449 | - if ( self::hasBeenCalled( 'repeatable_section_' . $sContainerTagID ) ) { |
|
| 449 | + if ( self::hasBeenCalled( 'repeatable_section_'.$sContainerTagID ) ) { |
|
| 450 | 450 | return ''; |
| 451 | 451 | } |
| 452 | 452 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $_oFormatter = new AdminPageFramework_Form_Model___Format_RepeatableSection( $asArguments, $oMsg ); |
| 455 | 455 | $_aArguments = $_oFormatter->get(); |
| 456 | 456 | $_sButtons = self::___getRepeatableSectionButtons( $_aArguments, $oMsg, $sContainerTagID, $iSectionCount ); |
| 457 | - $_sButtonsHTML = '"' . $_sButtons . '"'; |
|
| 457 | + $_sButtonsHTML = '"'.$_sButtons.'"'; |
|
| 458 | 458 | $_aJSArray = json_encode( $_aArguments ); |
| 459 | 459 | $_sScript = <<<JAVASCRIPTS |
| 460 | 460 | jQuery( document ).ready( function() { |
@@ -500,17 +500,17 @@ discard block |
||
| 500 | 500 | $_sIconAdd = "<span class='dashicons dashicons-plus-alt2'></span>"; |
| 501 | 501 | } |
| 502 | 502 | return "<div class='admin-page-framework-repeatable-section-buttons-outer-container'>" |
| 503 | - . "<div " . self::___getContainerAttributes( $_aArguments, $oMsg ) . ' >' |
|
| 504 | - . "<a " . self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) . ">" |
|
| 503 | + . "<div ".self::___getContainerAttributes( $_aArguments, $oMsg ).' >' |
|
| 504 | + . "<a ".self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ).">" |
|
| 505 | 505 | . $_sIconRemove |
| 506 | 506 | . "</a>" |
| 507 | - . "<a " . self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) . ">" |
|
| 507 | + . "<a ".self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ).">" |
|
| 508 | 508 | . $_sIconAdd |
| 509 | 509 | . "</a>" |
| 510 | 510 | . "</div>" |
| 511 | 511 | . "</div>" |
| 512 | 512 | . AdminPageFramework_Form_Utility::getModalForDisabledRepeatableElement( |
| 513 | - 'repeatable_section_disabled_' . $sContainerTagID, |
|
| 513 | + 'repeatable_section_disabled_'.$sContainerTagID, |
|
| 514 | 514 | $_aArguments[ 'disabled' ] |
| 515 | 515 | ); |
| 516 | 516 | } |
@@ -526,12 +526,12 @@ discard block |
||
| 526 | 526 | empty( $aArguments[ 'disabled' ] ) ? '' : 'disabled' |
| 527 | 527 | ), |
| 528 | 528 | ); |
| 529 | - unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
| 529 | + unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
| 530 | 530 | // Needs to remove it if it is empty as its data attribute will be checked in the JavaScript script. |
| 531 | 531 | if ( empty( $aArguments[ 'disabled' ] ) ) { |
| 532 | 532 | unset( $aArguments[ 'disabled' ] ); |
| 533 | 533 | } |
| 534 | - return self::getAttributes( $_aAttriubtes ) . ' ' . self::getDataAttributes( $aArguments ); |
|
| 534 | + return self::getAttributes( $_aAttriubtes ).' '.self::getDataAttributes( $aArguments ); |
|
| 535 | 535 | } |
| 536 | 536 | /** |
| 537 | 537 | * @return string |
@@ -562,10 +562,10 @@ discard block |
||
| 562 | 562 | . 'repeatable-section-button button button-large', |
| 563 | 563 | 'title' => $oMsg->get( 'add_section' ), |
| 564 | 564 | 'data-id' => $sContainerTagID, |
| 565 | - 'href' => ! empty( $aArguments[ 'disabled' ] ) |
|
| 566 | - ? '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
|
| 567 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
| 568 | - . '&inlineId=' . 'repeatable_section_disabled_' . $sContainerTagID |
|
| 565 | + 'href' => !empty( $aArguments[ 'disabled' ] ) |
|
| 566 | + ? '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ] |
|
| 567 | + . '&height='.$aArguments[ 'disabled' ][ 'box_height' ] |
|
| 568 | + . '&inlineId='.'repeatable_section_disabled_'.$sContainerTagID |
|
| 569 | 569 | : null, |
| 570 | 570 | ) |
| 571 | 571 | ); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | if ( $this->oProp->bIsAdmin ) { |
| 33 | 33 | |
| 34 | - add_action( 'load_' . $this->oProp->sPostType, array( $this, '_replyToSetUpHooksForView' ) ); |
|
| 34 | + add_action( 'load_'.$this->oProp->sPostType, array( $this, '_replyToSetUpHooksForView' ) ); |
|
| 35 | 35 | |
| 36 | 36 | // 3.5.10+ |
| 37 | 37 | add_action( 'admin_menu', array( $this, '_replyToRemoveAddNewSidebarMenu' ) ); |
@@ -105,19 +105,19 @@ discard block |
||
| 105 | 105 | private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) { |
| 106 | 106 | |
| 107 | 107 | // Remove the default post type menu item. |
| 108 | - if ( ! isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) { |
|
| 108 | + if ( !isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) { |
|
| 109 | 109 | // logged-in users of an insufficient access level don't have the menu to be registered. |
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | foreach ( $GLOBALS[ 'submenu' ][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
| 114 | 114 | |
| 115 | - if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
| 115 | + if ( !isset( $_aSubMenu[ 2 ] ) ) { |
|
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // Remove the default Add New entry. |
| 120 | - if ( 'post-new.php?post_type=' . $sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
| 120 | + if ( 'post-new.php?post_type='.$sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
| 121 | 121 | unset( $GLOBALS[ 'submenu' ][ $sMenuKey ][ $_iIndex ] ); |
| 122 | 122 | break; |
| 123 | 123 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function _replyToModifyActionLinks( $aActionLinks, $oPost ) { |
| 136 | 136 | |
| 137 | - if ( $oPost->post_type !== $this->oProp->sPostType ){ |
|
| 137 | + if ( $oPost->post_type !== $this->oProp->sPostType ) { |
|
| 138 | 138 | return $aActionLinks; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -156,12 +156,12 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function _replyToAddAuthorTableFilter() { |
| 158 | 158 | |
| 159 | - if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
| 159 | + if ( !$this->oProp->bEnableAuthorTableFileter ) { |
|
| 160 | 160 | return; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if ( |
| 164 | - ! ( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) |
|
| 164 | + !( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) |
|
| 165 | 165 | && in_array( strtolower( $_GET[ 'post_type' ] ), array( $this->oProp->sPostType ) ) ) |
| 166 | 166 | ) { |
| 167 | 167 | return; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $_sTaxonomySulg ) { |
| 203 | 203 | |
| 204 | - if ( ! in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
| 204 | + if ( !in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
| 205 | 205 | continue; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | // Echo the drop down list based on the passed array argument. |
| 216 | 216 | wp_dropdown_categories( |
| 217 | 217 | array( |
| 218 | - 'show_option_all' => $this->oMsg->get( 'show_all' ) . ' ' . $_oTaxonomy->label, |
|
| 218 | + 'show_option_all' => $this->oMsg->get( 'show_all' ).' '.$_oTaxonomy->label, |
|
| 219 | 219 | 'taxonomy' => $_sTaxonomySulg, |
| 220 | 220 | 'name' => $_oTaxonomy->name, |
| 221 | 221 | 'orderby' => 'name', |
@@ -235,24 +235,24 @@ discard block |
||
| 235 | 235 | * |
| 236 | 236 | * @internal |
| 237 | 237 | */ |
| 238 | - public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) { |
|
| 238 | + public function _replyToGetTableFilterQueryForTaxonomies( $oQuery = null ) { |
|
| 239 | 239 | |
| 240 | 240 | if ( 'edit.php' != $this->oProp->sPageNow ) { |
| 241 | 241 | return $oQuery; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - if ( ! isset( $GLOBALS[ 'typenow' ] ) ) { |
|
| 244 | + if ( !isset( $GLOBALS[ 'typenow' ] ) ) { |
|
| 245 | 245 | return $oQuery; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $sTaxonomySlug ) { |
| 249 | 249 | |
| 250 | - if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
| 250 | + if ( !in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
| 251 | 251 | continue; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $sVar = &$oQuery->query_vars[ $sTaxonomySlug ]; |
| 255 | - if ( ! isset( $sVar ) ) { |
|
| 255 | + if ( !isset( $sVar ) ) { |
|
| 256 | 256 | continue; |
| 257 | 257 | } |
| 258 | 258 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $_sStyle = trim( $_sStyle ); |
| 292 | 292 | |
| 293 | 293 | // Print out the filtered styles. |
| 294 | - if ( ! empty( $_sStyle ) ) { |
|
| 294 | + if ( !empty( $_sStyle ) ) { |
|
| 295 | 295 | echo "<style type='text/css' id='admin-page-framework-style-post-type'>" |
| 296 | 296 | . $this->oProp->sStyle |
| 297 | 297 | . "</style>"; |
@@ -347,10 +347,10 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function _replyToFilterPostTypeContent( $sContent ) { |
| 349 | 349 | |
| 350 | - if ( ! is_singular() ) { |
|
| 350 | + if ( !is_singular() ) { |
|
| 351 | 351 | return $sContent; |
| 352 | 352 | } |
| 353 | - if ( ! is_main_query() ) { |
|
| 353 | + if ( !is_main_query() ) { |
|
| 354 | 354 | return $sContent; |
| 355 | 355 | } |
| 356 | 356 | global $post; |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.8.22'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 19 | + const VERSION = '3.8.22'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
| 21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
| 21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
| 22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
| 23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
| 24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
| 56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
| 57 | 57 | */ |
| 58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
| 58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
| 62 | 62 | * |
| 63 | 63 | * @remark The ending underscore is not necessary. |
| 64 | 64 | */ |
| 65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
| 65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * The text domain slug and its path. |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | static public $aAdminPages = array( |
| 118 | 118 | // key => 'page slug' |
| 119 | - 'about' => 'apfl_about', // the welcome page |
|
| 119 | + 'about' => 'apfl_about', // the welcome page |
|
| 120 | 120 | 'addon' => 'apfl_addons', |
| 121 | 121 | 'tool' => 'apfl_tools', |
| 122 | 122 | 'help' => 'apfl_contact', |
@@ -154,12 +154,12 @@ discard block |
||
| 154 | 154 | * @since 3.5.0 |
| 155 | 155 | * @return string |
| 156 | 156 | */ |
| 157 | - public static function getPluginURL( $sRelativePath='' ) { |
|
| 157 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
| 158 | 158 | if ( isset( self::$_sPluginURLCache ) ) { |
| 159 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 159 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 160 | 160 | } |
| 161 | 161 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
| 162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 163 | 163 | } |
| 164 | 164 | /** |
| 165 | 165 | * @since 3.7.9 |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | * @since 3.5.0 |
| 190 | 190 | * @return void |
| 191 | 191 | */ |
| 192 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
| 193 | - if ( ! is_admin() ) { |
|
| 192 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
| 193 | + if ( !is_admin() ) { |
|
| 194 | 194 | return; |
| 195 | 195 | } |
| 196 | - self::$_aAdminNotices[] = array( |
|
| 196 | + self::$_aAdminNotices[ ] = array( |
|
| 197 | 197 | 'message' => $sMessage, |
| 198 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
| 198 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
| 199 | 199 | ); |
| 200 | 200 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
| 201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
| 205 | 205 | * @return void |
| 206 | 206 | */ |
| 207 | 207 | static public function _replyToSetAdminNotice() { |
| 208 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 209 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
| 208 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 209 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
| 210 | 210 | ."<p>" |
| 211 | 211 | . sprintf( |
| 212 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
| 213 | - self::NAME . ' ' . self::VERSION |
|
| 212 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
| 213 | + self::NAME.' '.self::VERSION |
|
| 214 | 214 | ) |
| 215 | 215 | . "</p>" |
| 216 | 216 | . "</div>"; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
| 223 | 223 | |
| 224 | 224 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
| 225 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 225 | +if ( !defined( 'ABSPATH' ) ) { |
|
| 226 | 226 | return; |
| 227 | 227 | } |
| 228 | 228 | if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) { |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
| 236 | 236 | if ( |
| 237 | - ! $_bFrameworkLoaded |
|
| 238 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 237 | + !$_bFrameworkLoaded |
|
| 238 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 239 | 239 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
| 240 | 240 | ) { |
| 241 | 241 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -253,18 +253,18 @@ discard block |
||
| 253 | 253 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
| 254 | 254 | |
| 255 | 255 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
| 256 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
| 256 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
| 257 | 257 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
| 258 | 258 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
| 259 | 259 | include( |
| 260 | 260 | $_bLoadDevelopmentVersion |
| 261 | 261 | ? $_sDevelopmentVersionPath |
| 262 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
| 262 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
| 263 | 263 | ); |
| 264 | 264 | |
| 265 | 265 | // Include the framework loader plugin components. |
| 266 | 266 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
| 267 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 267 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 268 | 268 | new AdminPageFrameworkLoader_Bootstrap( |
| 269 | 269 | AdminPageFrameworkLoader_Registry::$sFilePath, |
| 270 | 270 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |