@@ -76,21 +76,21 @@ |
||
76 | 76 | * @param string $sPriority The priority, either `high`, `core`, `default` or `low`. |
77 | 77 | * @param string $sCapability The capability. See <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities</a>. |
78 | 78 | */ |
79 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
79 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
80 | 80 | |
81 | 81 | if ( empty( $asPageSlugs ) ) { |
82 | 82 | return; |
83 | 83 | } |
84 | 84 | |
85 | - if ( ! $this->_isInstantiatable() ) { |
|
85 | + if ( !$this->_isInstantiatable() ) { |
|
86 | 86 | return; |
87 | 87 | } |
88 | 88 | |
89 | 89 | // The property object needs to be done first before the parent constructor. |
90 | 90 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
91 | 91 | ? $this->aSubClassNames[ 'oProp' ] |
92 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
93 | - $this->oProp = new $_sPropertyClassName( |
|
92 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
93 | + $this->oProp = new $_sPropertyClassName( |
|
94 | 94 | $this, |
95 | 95 | get_class( $this ), |
96 | 96 | $sCapability, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + function __construct( $asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
@@ -38,16 +38,16 @@ |
||
38 | 38 | * @since 3.7.4 Changed the default capability value to `read`. |
39 | 39 | * @todo Examine the appropriate default capability level. |
40 | 40 | */ |
41 | - public function __construct( $sCapability='read', $sTextDomain='admin-page-framework' ) { |
|
41 | + public function __construct( $sCapability = 'read', $sTextDomain = 'admin-page-framework' ) { |
|
42 | 42 | |
43 | 43 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
44 | 44 | ? $this->aSubClassNames[ 'oProp' ] |
45 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
45 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
46 | 46 | $this->oProp = new $_sPropertyClassName( |
47 | - $this, // the caller object |
|
48 | - get_class( $this ), // the caller class name |
|
49 | - $sCapability, // the capability level |
|
50 | - $sTextDomain, // the text domain |
|
47 | + $this, // the caller object |
|
48 | + get_class( $this ), // the caller class name |
|
49 | + $sCapability, // the capability level |
|
50 | + $sTextDomain, // the text domain |
|
51 | 51 | $this->_sStructureType // the structure type |
52 | 52 | ); |
53 | 53 |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @since 3.3.0 |
28 | 28 | */ |
29 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
29 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
30 | 30 | |
31 | 31 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
32 | 32 | ? $this->aSubClassNames[ 'oProp' ] |
33 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
33 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
34 | 34 | |
35 | 35 | $this->oProp = new $_sPropertyClassName( |
36 | 36 | $this, |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | // if ( $this->oProp->bIsAdminAjax ) { |
48 | 48 | // return; |
49 | 49 | // } |
50 | - if ( ! $this->oProp->bIsAdmin ) { |
|
50 | + if ( !$this->oProp->bIsAdmin ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | |
54 | 54 | add_action( 'wp_loaded', array( $this, '_replyToDetermineToLoad' ) ); |
55 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
55 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToLoadComponentsForAjax' ), 100 ); |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | * @callback add_action set_up_{extended class name} |
65 | 65 | */ |
66 | 66 | public function _replyToLoadComponentsForAjax() { |
67 | - if ( ! $this->oProp->bIsAdminAjax ) { |
|
67 | + if ( !$this->oProp->bIsAdminAjax ) { |
|
68 | 68 | return; |
69 | 69 | } |
70 | 70 | |
71 | 71 | new AdminPageFramework_Model_Menu__RegisterMenu( $this, 'pseudo_admin_menu' ); |
72 | 72 | do_action( 'pseudo_admin_menu', '' ); |
73 | - do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
73 | + do_action( 'pseudo_current_screen' ); // @deprecated 3.8.22 Kept for backward-compatibility |
|
74 | 74 | |
75 | 75 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
76 | 76 | if ( $this->oProp->isPageAdded( $_sPageSlug ) ) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @since 3.3.1 Moved from `AdminPageFramework_Base`. |
118 | 118 | * @internal |
119 | 119 | */ |
120 | - public function __call( $sMethodName, $aArgs=null ) { |
|
120 | + public function __call( $sMethodName, $aArgs = null ) { |
|
121 | 121 | |
122 | 122 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
123 | 123 | $_sTabSlug = $this->oProp->getCurrentTabSlug( $_sPageSlug ); |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | 'load_pre_', |
129 | 129 | ); |
130 | 130 | |
131 | - switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
131 | + switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) { |
|
132 | 132 | |
133 | 133 | // add_settings_section() callback |
134 | 134 | case 'section_pre_': |
135 | - return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
135 | + return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting |
|
136 | 136 | |
137 | 137 | // add_settings_field() callback |
138 | 138 | case 'field_pre_': |
139 | - return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
139 | + return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting |
|
140 | 140 | |
141 | 141 | // load-{page} callback |
142 | 142 | case 'load_pre_': |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | * @return string The found callback method name or the prefix of a known callback method name. An empty string if not found. |
155 | 155 | * @internal |
156 | 156 | */ |
157 | - private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) { |
|
157 | + private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) { |
|
158 | 158 | |
159 | - foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
159 | + foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) { |
|
160 | 160 | if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) { |
161 | 161 | return $_sMethodPrefix; |
162 | 162 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) { |
182 | 182 | |
183 | - if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
183 | + if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen ) ) { |
|
184 | 184 | return; |
185 | 185 | } |
186 | 186 | |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | // the tab slug will be empty unless an in-page tab is added. |
205 | 205 | $sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); |
206 | 206 | if ( strlen( $sTabSlug ) ) { |
207 | - $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
207 | + $this->_setShowDebugInfoProperty( $sPageSlug, $sTabSlug ); // 3.8.8+ |
|
208 | 208 | $this->oUtil->addAndDoActions( |
209 | 209 | $this, // the caller object |
210 | - array( "load_{$sPageSlug}_" . $sTabSlug ), |
|
210 | + array( "load_{$sPageSlug}_".$sTabSlug ), |
|
211 | 211 | $this // the admin page object - this lets third-party scripts use the framework methods. |
212 | 212 | ); |
213 | 213 | add_filter( 'admin_title', array( $this, '_replyToSetAdminPageTitleForTab' ), 1, 2 ); |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | * @since 3.8.8 |
234 | 234 | * @return void |
235 | 235 | */ |
236 | - private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug='' ) { |
|
236 | + private function _setShowDebugInfoProperty( $sPageSlug, $sTabSlug = '' ) { |
|
237 | 237 | |
238 | 238 | // For the page, |
239 | - if ( ! strlen( $sTabSlug ) ) { |
|
239 | + if ( !strlen( $sTabSlug ) ) { |
|
240 | 240 | $this->oProp->bShowDebugInfo = $this->oUtil->getElement( |
241 | 241 | $this->oProp->aPages, |
242 | 242 | array( $sPageSlug, 'show_debug_info' ), |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) { |
282 | 282 | return false; |
283 | 283 | } |
284 | - if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
284 | + if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) { |
|
285 | 285 | return false; |
286 | 286 | } |
287 | 287 | $_sPageHook = is_object( $osScreenORPageHook ) |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | // Nothing to do in the network admin area. |
310 | - return ! is_network_admin(); |
|
310 | + return !is_network_admin(); |
|
311 | 311 | |
312 | 312 | } |
313 | 313 | |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | */ |
323 | 323 | protected function _isInThePage() { |
324 | 324 | |
325 | - if ( ! $this->oProp->bIsAdmin ) { |
|
325 | + if ( !$this->oProp->bIsAdmin ) { |
|
326 | 326 | return false; |
327 | 327 | } |
328 | 328 | |
329 | 329 | // If the `setUp()` method is not loaded yet, nothing can be checked |
330 | 330 | // as there is not page is added. |
331 | - if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) { |
|
331 | + if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) { |
|
332 | 332 | return true; |
333 | 333 | } |
334 | 334 |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $this->oProp->aInPageTabs, |
33 | 33 | array( $this->oProp->getCurrentPageSlug(), $this->oProp->getCurrentTabSlug(), 'title' ) |
34 | 34 | ); |
35 | - if ( ! $_sTabTitle ) { |
|
35 | + if ( !$_sTabTitle ) { |
|
36 | 36 | return $sAdminTitle; |
37 | 37 | } |
38 | - return $_sTabTitle . ' ‹ ' . $sAdminTitle; |
|
38 | + return $_sTabTitle.' ‹ '.$sAdminTitle; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return void |
83 | 83 | * @internal |
84 | 84 | */ |
85 | - protected function _renderPage( $sPageSlug, $sTabSlug=null ) { |
|
85 | + protected function _renderPage( $sPageSlug, $sTabSlug = null ) { |
|
86 | 86 | $_oPageRenderer = new AdminPageFramework_View__PageRenderer( $this, $sPageSlug, $sTabSlug ); |
87 | 87 | $_oPageRenderer->render(); |
88 | 88 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
54 | 54 | * @return void |
55 | 55 | */ |
56 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
56 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
57 | 57 | |
58 | - if ( ! $this->_isInstantiatable() ) { |
|
58 | + if ( !$this->_isInstantiatable() ) { |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 | if ( empty( $asPostTypeOrScreenID ) ) { |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | // A property object needs to be done first. |
66 | 66 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
67 | 67 | ? $this->aSubClassNames[ 'oProp' ] |
68 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
69 | - $this->oProp = new $_sPropertyClassName( |
|
68 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
69 | + $this->oProp = new $_sPropertyClassName( |
|
70 | 70 | $this, |
71 | 71 | get_class( $this ), |
72 | 72 | $sCapability, |
73 | 73 | $sTextDomain, |
74 | 74 | $this->_sStructureType |
75 | 75 | ); |
76 | - $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
76 | + $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
77 | 77 | ? array( $asPostTypeOrScreenID ) |
78 | 78 | : $asPostTypeOrScreenID; |
79 | 79 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - public function __construct( $asTaxonomySlug, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + public function __construct( $asTaxonomySlug, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
62 | 62 | $sTextDomain, |
63 | 63 | $this->_sStructureType |
64 | 64 | ); |
65 | - $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
65 | + $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
66 | 66 | |
67 | 67 | parent::__construct( $this->oProp ); |
68 | 68 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 0 => '', |
53 | 53 | 1 => 's', |
54 | 54 | ); |
55 | - $_sProtocol = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) ) |
|
55 | + $_sProtocol = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) ) |
|
56 | 56 | . $_aProtocolSuffix[ ( int ) $_bSSL ]; |
57 | 57 | |
58 | 58 | // Port: e.g. :80 |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | ? $_SERVER[ 'HTTP_HOST' ] |
66 | 66 | : $_SERVER[ 'SERVER_NAME' ] |
67 | 67 | ); |
68 | - $_sHost = preg_replace( '/:.+/', '', $_sHost ); // remove the port part in case it is added. |
|
69 | - return $_sProtocol . '://' . $_sHost . $_sPort . $_SERVER[ 'REQUEST_URI' ]; |
|
68 | + $_sHost = preg_replace( '/:.+/', '', $_sHost ); // remove the port part in case it is added. |
|
69 | + return $_sProtocol.'://'.$_sHost.$_sPort.$_SERVER[ 'REQUEST_URI' ]; |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | /** |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | ? ( string ) $_SERVER[ 'SERVER_PORT' ] |
81 | 81 | : ''; |
82 | 82 | $_aPort = array( |
83 | - 0 => ':' . $_sPort, |
|
83 | + 0 => ':'.$_sPort, |
|
84 | 84 | 1 => '', |
85 | 85 | ); |
86 | - $_bPortSet = ( ! $bSSL && '80' === $_sPort ) || ( $bSSL && '443' === $_sPort ); |
|
86 | + $_bPortSet = ( !$bSSL && '80' === $_sPort ) || ( $bSSL && '443' === $_sPort ); |
|
87 | 87 | return $_aPort[ ( int ) $_bPortSet ]; |
88 | 88 | } |
89 | 89 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param array|string $asPrefixes |
37 | 37 | * @retuen void |
38 | 38 | */ |
39 | - public static function cleanTransients( $asPrefixes=array( 'apf' ) ) { |
|
39 | + public static function cleanTransients( $asPrefixes = array( 'apf' ) ) { |
|
40 | 40 | |
41 | 41 | $_aPrefixes = self::getAsArray( $asPrefixes ); |
42 | 42 | if ( self::isNetworkAdmin() ) { |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @var wpdb |
48 | 48 | */ |
49 | - $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
50 | - foreach( $_aPrefixes as $_sPrefix ) { |
|
49 | + $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
50 | + foreach ( $_aPrefixes as $_sPrefix ) { |
|
51 | 51 | $_sSQLQuery = "DELETE FROM `{$_oWPDB->options}` " |
52 | 52 | . "WHERE `option_name` " |
53 | - . "LIKE ( '_transient_%{$_sPrefix}%' )"; // this also matches _transient_timeout_{prefix} |
|
53 | + . "LIKE ( '_transient_%{$_sPrefix}%' )"; // this also matches _transient_timeout_{prefix} |
|
54 | 54 | $_oWPDB->query( $_sSQLQuery ); |
55 | 55 | } |
56 | 56 | |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * @var wpdb |
68 | 68 | */ |
69 | - $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
70 | - foreach( $_aPrefixes as $_sPrefix ) { |
|
69 | + $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
70 | + foreach ( $_aPrefixes as $_sPrefix ) { |
|
71 | 71 | $_sSQLQuery = "DELETE FROM `{$_oWPDB->sitemeta}` " |
72 | 72 | . "WHERE " |
73 | 73 | // this matches _site_transient_timeout_{...} as well |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return array |
83 | 83 | * @since 3.8.23 |
84 | 84 | */ |
85 | - static public function getTransientAsArray( $sTransientKey, $mDefault=null ) { |
|
85 | + static public function getTransientAsArray( $sTransientKey, $mDefault = null ) { |
|
86 | 86 | return self::getAsArray( |
87 | 87 | self::getTransient( $sTransientKey, $mDefault ) |
88 | 88 | ); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @return array |
95 | 95 | * @since 3.8.23 |
96 | 96 | */ |
97 | - static public function getTransientWithoutCacheAsArray( $sTransientKey, $mDefault=null ) { |
|
97 | + static public function getTransientWithoutCacheAsArray( $sTransientKey, $mDefault = null ) { |
|
98 | 98 | return self::getAsArray( |
99 | 99 | self::getTransientWithoutCache( $sTransientKey, $mDefault ) |
100 | 100 | ); |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | * @sicne 3.8.23 |
112 | 112 | * @return mixed|false `false` on failing to retrieve the transient value. |
113 | 113 | */ |
114 | - static public function getTransientWithoutCache( $sTransientKey, $mDefault=null ) { |
|
114 | + static public function getTransientWithoutCache( $sTransientKey, $mDefault = null ) { |
|
115 | 115 | |
116 | - $sTransientKey = self::_getCompatibleTransientKey( $sTransientKey ); |
|
116 | + $sTransientKey = self::_getCompatibleTransientKey( $sTransientKey ); |
|
117 | 117 | if ( self::isNetworkAdmin() ) { |
118 | 118 | return self::getTransientWithoutCacheForNetwork( $sTransientKey, $mDefault ); |
119 | 119 | } |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $_mData = $_oWPDB->get_var( |
132 | 132 | $_oWPDB->prepare( |
133 | 133 | $_sSQLQuery, |
134 | - '_transient_' . $sTransientKey, |
|
135 | - '_transient_timeout_' . $sTransientKey |
|
134 | + '_transient_'.$sTransientKey, |
|
135 | + '_transient_timeout_'.$sTransientKey |
|
136 | 136 | ) |
137 | 137 | ); |
138 | 138 | return is_null( $_mData ) ? $mDefault : maybe_unserialize( $_mData ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @since 3.8.23 |
146 | 146 | * @return mixed |
147 | 147 | */ |
148 | - static public function getTransientWithoutCacheForNetwork($sTransientKey, $mDefault ) { |
|
148 | + static public function getTransientWithoutCacheForNetwork( $sTransientKey, $mDefault ) { |
|
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @var wpdb $_oWPDB |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $_mData = $_oWPDB->get_var( |
162 | 162 | $_oWPDB->prepare( |
163 | 163 | $_sSQLQuery, |
164 | - '_site_transient_' . $sTransientKey, |
|
165 | - '_site_transient_timeout_' . $sTransientKey, |
|
164 | + '_site_transient_'.$sTransientKey, |
|
165 | + '_site_transient_timeout_'.$sTransientKey, |
|
166 | 166 | get_current_network_id() |
167 | 167 | ) |
168 | 168 | ); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | 0 => 'delete_transient', |
196 | 196 | 1 => 'delete_site_transient', |
197 | 197 | ); |
198 | - $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
198 | + $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
199 | 199 | |
200 | 200 | // reset prior value of $_wp_using_ext_object_cache |
201 | 201 | $_wp_using_ext_object_cache = $_bWpUsingExtObjectCacheTemp; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param mixed $vDefault |
212 | 212 | * @return mixed |
213 | 213 | */ |
214 | - static public function getTransient( $sTransientKey, $vDefault=null ) { |
|
214 | + static public function getTransient( $sTransientKey, $vDefault = null ) { |
|
215 | 215 | |
216 | 216 | // Temporarily disable $_wp_using_ext_object_cache |
217 | 217 | global $_wp_using_ext_object_cache; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 0 => 'get_transient', |
224 | 224 | 1 => 'get_site_transient', |
225 | 225 | ); |
226 | - $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
226 | + $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
227 | 227 | |
228 | 228 | // Restore the prior value of `$_wp_using_ext_object_cache`. |
229 | 229 | $_wp_using_ext_object_cache = $_bWpUsingExtObjectCacheTemp; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param mixed $vValue |
246 | 246 | * @param integer $iExpiration |
247 | 247 | */ |
248 | - static public function setTransient( $sTransientKey, $vValue, $iExpiration=0 ) { |
|
248 | + static public function setTransient( $sTransientKey, $vValue, $iExpiration = 0 ) { |
|
249 | 249 | |
250 | 250 | // Temporarily disable `$_wp_using_ext_object_cache`. |
251 | 251 | global $_wp_using_ext_object_cache; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @return string |
277 | 277 | * @todo it is said as of WordPress 4.3, it will be 255 since the database table column type becomes VARCHAR(255). |
278 | 278 | */ |
279 | - static public function _getCompatibleTransientKey( $sSubject, $iDeprecated=null ) { |
|
279 | + static public function _getCompatibleTransientKey( $sSubject, $iDeprecated = null ) { |
|
280 | 280 | |
281 | 281 | $_iAllowedCharacterLength = isset( $iDeprecated ) |
282 | 282 | ? $iDeprecated |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | 0, // start position |
295 | 295 | $_iPrefixLengthToKeep - 1 // how many characters to extract |
296 | 296 | ); |
297 | - return $_sPrefixToKeep . '_' . md5( $sSubject ); |
|
297 | + return $_sPrefixToKeep.'_'.md5( $sSubject ); |
|
298 | 298 | |
299 | 299 | } |
300 | 300 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @param array $aAdditionalOptions an additional options array to merge with the options array. |
310 | 310 | * @return mixed |
311 | 311 | */ |
312 | - static public function getOption( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array() ) { |
|
312 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array() ) { |
|
313 | 313 | return self::_getOptionByFunctionName( $sOptionKey, $asKey, $vDefault, $aAdditionalOptions ); |
314 | 314 | } |
315 | 315 | /** |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | * @remark Used in the network admin area. |
325 | 325 | * @return mixed |
326 | 326 | */ |
327 | - static public function getSiteOption( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array() ) { |
|
327 | + static public function getSiteOption( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array() ) { |
|
328 | 328 | return self::_getOptionByFunctionName( $sOptionKey, $asKey, $vDefault, $aAdditionalOptions, 'get_site_option' ); |
329 | 329 | } |
330 | 330 | |
@@ -340,16 +340,16 @@ discard block |
||
340 | 340 | * @return mixed |
341 | 341 | * @since 3.5.3 |
342 | 342 | */ |
343 | - static private function _getOptionByFunctionName( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array(), $sFunctionName='get_option' ) { |
|
343 | + static private function _getOptionByFunctionName( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array(), $sFunctionName = 'get_option' ) { |
|
344 | 344 | |
345 | 345 | // Entire options |
346 | - if ( ! isset( $asKey ) ) { |
|
346 | + if ( !isset( $asKey ) ) { |
|
347 | 347 | $_aOptions = $sFunctionName( |
348 | 348 | $sOptionKey, |
349 | 349 | isset( $vDefault ) |
350 | 350 | ? $vDefault |
351 | 351 | : array() |
352 | - );; |
|
352 | + ); ; |
|
353 | 353 | return empty( $aAdditionalOptions ) |
354 | 354 | ? $_aOptions |
355 | 355 | : self::uniteArrays( |