@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | } |
94 | 94 | |
95 | - /** |
|
95 | + /** |
|
96 | 96 | * Resets the rewrite rules for custom post types. |
97 | 97 | * |
98 | 98 | * This must be done after the post type is registered. So the shutdown action hook is used. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oFactory ) { |
30 | 30 | |
31 | - if ( ! $this->_shouldProceed( $oFactory ) ) { |
|
31 | + if ( !$this->_shouldProceed( $oFactory ) ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function _shouldProceed( $oFactory ) { |
55 | 55 | |
56 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
56 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
57 | 57 | return false; |
58 | 58 | } |
59 | - if ( ! $oFactory->oProp->sCallerPath ) { |
|
59 | + if ( !$oFactory->oProp->sCallerPath ) { |
|
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | return 'plugin' === $oFactory->oProp->sScriptType; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | // If the execution flow in the plugin activation hook, schedule flushing rewrite rules. |
89 | - if ( did_action( 'activate_' . plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
89 | + if ( did_action( 'activate_'.plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
90 | 90 | add_action( 'shutdown', array( $this, '_replyToFlushRewriteRules' ) ); |
91 | 91 | } |
92 | 92 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $this->oFactory = $oFactory; |
32 | 32 | |
33 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
33 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | add_action( |
48 | 48 | 'admin_menu', |
49 | - array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
49 | + array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
50 | 50 | 9999 |
51 | 51 | ); |
52 | 52 | |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | |
62 | 62 | // Check the post type `show_ui` and other related UI arguments. |
63 | 63 | $_bsShowInMeenu = $this->getShowInMenuPostTypeArgument( $this->oFactory->oProp->aPostTypeArgs ); |
64 | - if ( ! $_bsShowInMeenu ) { |
|
64 | + if ( !$_bsShowInMeenu ) { |
|
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | 68 | // If the user sets a menu slug to the 'show_in_menu' argument, use that. |
69 | 69 | // It is used to set a custom post type sub-menu belong to another menu. |
70 | - $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
70 | + $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
71 | 71 | ? $_bsShowInMeenu |
72 | - : 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
72 | + : 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
73 | 73 | |
74 | 74 | // Set the index to the framework specific global array for sorting. |
75 | 75 | $this->_setSubMenuSlugForSorting( $_sSubMenuSlug ); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | |
131 | 131 | // @remark This is the partial link url set in the third element ( index of 2 ) in the third dimension of submenu global array element. |
132 | 132 | // This is not the submenu slug. |
133 | - $_sLinkSlugManage = 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
133 | + $_sLinkSlugManage = 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
134 | 134 | |
135 | 135 | $_aLinkSlugs = array( |
136 | 136 | $_sLinkSlugManage => $_nSubMenuOrderManage, |
137 | - 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
137 | + 'post-new.php?post_type='.$this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | // If the user does not set a custom value, unset it |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | // If the user does not want to show the Add New sub menu, no need to change the order. |
146 | - if ( ! $_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
147 | - unset( $_aLinkSlugs[ 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType ] ); |
|
146 | + if ( !$_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
147 | + unset( $_aLinkSlugs[ 'post-new.php?post_type='.$this->oFactory->oProp->sPostType ] ); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return $_aLinkSlugs; |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private function _setSubMenuIndexByLinksSlugs( $sSubMenuSlug, array $aLinkSlugs ) { |
166 | 166 | |
167 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
167 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
168 | 168 | |
169 | - foreach( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
169 | + foreach ( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
170 | 170 | |
171 | 171 | $_bIsSet = $this->_setSubMenuIndexByLinksSlug( $sSubMenuSlug, $_nIndex, $_aSubMenuItem, $_sLinkSlug, $_nOrder ); |
172 | 172 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
193 | 193 | |
194 | 194 | // The third item is the link slug. |
195 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
195 | + if ( !isset( $aSubMenuItem[ 2 ] ) ) { |
|
196 | 196 | return false; |
197 | 197 | } |
198 | 198 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | parent::__construct( $oProp ); |
28 | 28 | |
29 | - if ( ! $this->oProp->bIsAdmin ) { |
|
29 | + if ( !$this->oProp->bIsAdmin ) { |
|
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ); |
39 | 39 | |
40 | 40 | // 3.7.10+ |
41 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
41 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function _isInThePage() { |
54 | 54 | |
55 | - if ( ! $this->oProp->bIsAdmin ) { |
|
55 | + if ( !$this->oProp->bIsAdmin ) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | public function _replyToSetUpHooks( $oFactory ) { |
95 | 95 | |
96 | 96 | // Hooks to display fields. |
97 | - add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
98 | - add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
99 | - add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
97 | + add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
98 | + add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
99 | + add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
100 | 100 | |
101 | 101 | // Hooks to save field values. |
102 | - add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
103 | - add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
104 | - add_action('user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
102 | + add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
103 | + add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
104 | + add_action( 'user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
105 | 105 | |
106 | 106 | $this->_load(); // 3.8.14+ |
107 | 107 |
@@ -44,17 +44,17 @@ |
||
44 | 44 | $_aOutput = array(); |
45 | 45 | |
46 | 46 | // Get the field outputs |
47 | - $_aOutput[] = $this->oForm->get(); |
|
47 | + $_aOutput[ ] = $this->oForm->get(); |
|
48 | 48 | |
49 | 49 | // Filter the output |
50 | 50 | $_sOutput = $this->oUtil->addAndApplyFilters( |
51 | 51 | $this, |
52 | - 'content_' . $this->oProp->sClassName, |
|
52 | + 'content_'.$this->oProp->sClassName, |
|
53 | 53 | $this->content( implode( PHP_EOL, $_aOutput ) ) |
54 | 54 | ); |
55 | 55 | |
56 | 56 | // Do action |
57 | - $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this ); |
|
57 | + $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this ); |
|
58 | 58 | |
59 | 59 | // Output |
60 | 60 | echo $_sOutput; |
@@ -157,7 +157,8 @@ |
||
157 | 157 | // array_key_exists( $_sKey, $aArray ) caused warnings in some occasions |
158 | 158 | if ( isset( $aArray[ $_sKey ] ) ) { |
159 | 159 | |
160 | - if ( empty( $aKeys ) ) { // no more keys |
|
160 | + if ( empty( $aKeys ) ) { |
|
161 | +// no more keys |
|
161 | 162 | return $aArray[ $_sKey ]; |
162 | 163 | } |
163 | 164 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @return mixed `null` will be returned if not found. |
28 | 28 | */ |
29 | 29 | static public function getFirstElement( array $aArray ) { |
30 | - foreach( $aArray as $_mElement ) { |
|
30 | + foreach ( $aArray as $_mElement ) { |
|
31 | 31 | return $_mElement; |
32 | 32 | } |
33 | 33 | return null; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param string|array $asToDefault When the returning value matches oen of the set values here, the value(s) will be discarded and the default value will be applied. |
49 | 49 | * @return mixed The set value or the default value. |
50 | 50 | */ |
51 | - static public function getElement( $aSubject, $aisKey, $mDefault=null, $asToDefault=array( null ) ) { |
|
51 | + static public function getElement( $aSubject, $aisKey, $mDefault = null, $asToDefault = array( null ) ) { |
|
52 | 52 | |
53 | 53 | $_aToDefault = is_null( $asToDefault ) |
54 | 54 | ? array( null ) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @since 3.7.0 Moved from `AdminPageFramework_Utility_Array`. |
76 | 76 | * @return array The cast retrieved element value. |
77 | 77 | */ |
78 | - static public function getElementAsArray( $aSubject, $aisKey, $mDefault=null, $asToDefault=array( null ) ) { |
|
78 | + static public function getElementAsArray( $aSubject, $aisKey, $mDefault = null, $asToDefault = array( null ) ) { |
|
79 | 79 | return self::getAsArray( |
80 | 80 | self::getElement( $aSubject, $aisKey, $mDefault, $asToDefault ), |
81 | 81 | true // preserve an empty value |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | foreach ( $aParse as $_isKey => $_v ) { |
96 | 96 | |
97 | - if ( ! is_numeric( $_isKey ) ) { |
|
97 | + if ( !is_numeric( $_isKey ) ) { |
|
98 | 98 | unset( $aParse[ $_isKey ] ); |
99 | 99 | continue; |
100 | 100 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // Convert string numeric value to integer or float. |
103 | 103 | $_isKey = $_isKey + 0; |
104 | 104 | |
105 | - if ( ! is_int( $_isKey ) ) { |
|
105 | + if ( !is_int( $_isKey ) ) { |
|
106 | 106 | unset( $aParse[ $_isKey ] ); |
107 | 107 | } |
108 | 108 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | static public function getNonIntegerKeyElements( array $aParse ) { |
122 | 122 | |
123 | 123 | foreach ( $aParse as $_isKey => $_v ) { |
124 | - if ( is_numeric( $_isKey ) && is_int( $_isKey+ 0 ) ) { |
|
124 | + if ( is_numeric( $_isKey ) && is_int( $_isKey + 0 ) ) { |
|
125 | 125 | unset( $aParse[ $_isKey ] ); |
126 | 126 | } |
127 | 127 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @since 3.7.0 Moved from `AdminPageFramework_Utility_Array`. |
156 | 156 | * @return mixed |
157 | 157 | */ |
158 | - static public function getArrayValueByArrayKeys( $aArray, $aKeys, $vDefault=null ) { |
|
158 | + static public function getArrayValueByArrayKeys( $aArray, $aKeys, $vDefault = null ) { |
|
159 | 159 | |
160 | 160 | $_sKey = array_shift( $aKeys ); |
161 | 161 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @param boolean bPreserveEmpty If `false` is given, a value that yields `false` such as `false`, an empty sttring `''`, or `0` will not create an element such as `array( false )`. It will be just `array()`. |
195 | 195 | * @return array The cast array. |
196 | 196 | */ |
197 | - static public function getAsArray( $mValue, $bPreserveEmpty=false ) { |
|
197 | + static public function getAsArray( $mValue, $bPreserveEmpty = false ) { |
|
198 | 198 | |
199 | 199 | if ( is_array( $mValue ) ) { |
200 | 200 | return $mValue; |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | * @param integer $iLines The number of lines to read. |
28 | 28 | * @return string |
29 | 29 | */ |
30 | - static public function getFileTailContents( $asPath=array(), $iLines=1 ) { |
|
30 | + static public function getFileTailContents( $asPath = array(), $iLines = 1 ) { |
|
31 | 31 | |
32 | - $_sPath = self::_getFirstItem( $asPath ); |
|
33 | - if ( ! @is_readable( $_sPath ) ) { |
|
32 | + $_sPath = self::_getFirstItem( $asPath ); |
|
33 | + if ( !@is_readable( $_sPath ) ) { |
|
34 | 34 | return ''; |
35 | 35 | } |
36 | 36 | return trim( |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @since 3.4.6 |
61 | 61 | * @return string |
62 | 62 | */ |
63 | - static public function sanitizeFileName( $sFileName, $sReplacement='_' ) { |
|
63 | + static public function sanitizeFileName( $sFileName, $sReplacement = '_' ) { |
|
64 | 64 | |
65 | 65 | // Remove anything which isn't a word, white space, number |
66 | 66 | // or any of the following characters -_~,;:[](). |
@@ -47,8 +47,8 @@ |
||
47 | 47 | * @since 3.6.3 |
48 | 48 | * @return boolean If the passed value is not null, true; otherwise, false. |
49 | 49 | */ |
50 | - static public function isNotNull( $mValue=null ) { |
|
51 | - return ! is_null( $mValue ); |
|
50 | + static public function isNotNull( $mValue = null ) { |
|
51 | + return !is_null( $mValue ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @since 3.6.2 Supported a text content to be passed to the first parameter. |
28 | 28 | * @access public |
29 | 29 | */ |
30 | - static public function getScriptData( $sPathOrContent, $sType='plugin', $aDefaultHeaderKeys=array() ) { |
|
30 | + static public function getScriptData( $sPathOrContent, $sType = 'plugin', $aDefaultHeaderKeys = array() ) { |
|
31 | 31 | |
32 | 32 | $_aHeaderKeys = $aDefaultHeaderKeys + array( |
33 | 33 | // storing array key => the comment entry header label |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | |
66 | 66 | switch ( trim( $sType ) ) { |
67 | 67 | case 'theme': |
68 | - $aData['sName'] = $aData['sThemeName']; |
|
69 | - $aData['sURI'] = $aData['sThemeURI']; |
|
68 | + $aData[ 'sName' ] = $aData[ 'sThemeName' ]; |
|
69 | + $aData[ 'sURI' ] = $aData[ 'sThemeURI' ]; |
|
70 | 70 | break; |
71 | 71 | case 'library': |
72 | - $aData['sName'] = $aData['sLibraryName']; |
|
73 | - $aData['sURI'] = $aData['sLibraryURI']; |
|
72 | + $aData[ 'sName' ] = $aData[ 'sLibraryName' ]; |
|
73 | + $aData[ 'sURI' ] = $aData[ 'sLibraryURI' ]; |
|
74 | 74 | break; |
75 | 75 | case 'script': |
76 | - $aData['sName'] = $aData['sScriptName']; |
|
76 | + $aData[ 'sName' ] = $aData[ 'sScriptName' ]; |
|
77 | 77 | break; |
78 | 78 | case 'plugin': |
79 | - $aData['sName'] = $aData['sPluginName']; |
|
80 | - $aData['sURI'] = $aData['sPluginURI']; |
|
79 | + $aData[ 'sName' ] = $aData[ 'sPluginName' ]; |
|
80 | + $aData[ 'sURI' ] = $aData[ 'sPluginURI' ]; |
|
81 | 81 | break; |
82 | 82 | default: |
83 | 83 | break; |
@@ -92,22 +92,22 @@ discard block |
||
92 | 92 | * @since 3.6.2 |
93 | 93 | * @return array The script data |
94 | 94 | */ |
95 | - static public function getScriptDataFromContents( $sContent, $sType='plugin', $aDefaultHeaderKeys=array() ) { |
|
95 | + static public function getScriptDataFromContents( $sContent, $sType = 'plugin', $aDefaultHeaderKeys = array() ) { |
|
96 | 96 | |
97 | 97 | // Make sure we catch CR-only line endings. |
98 | 98 | $sContent = str_replace( "\r", "\n", $sContent ); |
99 | 99 | |
100 | - $_aHeaders = $aDefaultHeaderKeys; |
|
100 | + $_aHeaders = $aDefaultHeaderKeys; |
|
101 | 101 | if ( $sType ) { |
102 | 102 | $_aExtraHeaders = apply_filters( "extra_{$sType}_headers", array() ); |
103 | - if ( ! empty( $_aExtraHeaders ) ) { |
|
103 | + if ( !empty( $_aExtraHeaders ) ) { |
|
104 | 104 | $_aExtraHeaders = array_combine( $_aExtraHeaders, $_aExtraHeaders ); // keys equal values |
105 | 105 | $_aHeaders = array_merge( $_aExtraHeaders, ( array ) $aDefaultHeaderKeys ); |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | 109 | foreach ( $_aHeaders as $_sHeaderKey => $_sRegex ) { |
110 | - $_bFound = preg_match( '/^[ \t\/*#@]*' . preg_quote( $_sRegex, '/' ) . ':(.*)$/mi', $sContent, $_aMatch ); |
|
110 | + $_bFound = preg_match( '/^[ \t\/*#@]*'.preg_quote( $_sRegex, '/' ).':(.*)$/mi', $sContent, $_aMatch ); |
|
111 | 111 | $_aHeaders[ $_sHeaderKey ] = $_bFound && $_aMatch[ 1 ] |
112 | 112 | ? _cleanup_header_comment( $_aMatch[ 1 ] ) |
113 | 113 | : ''; |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | * @since 3.4.2 |
125 | 125 | * @see download_url() in file.php in core. |
126 | 126 | */ |
127 | - static public function download( $sURL, $iTimeOut=300 ) { |
|
127 | + static public function download( $sURL, $iTimeOut = 300 ) { |
|
128 | 128 | |
129 | 129 | if ( false === filter_var( $sURL, FILTER_VALIDATE_URL ) ) { |
130 | 130 | return false; |
131 | 131 | } |
132 | 132 | |
133 | 133 | $_sTmpFileName = self::setTempPath( self::getBaseNameOfURL( $sURL ) ); |
134 | - if ( ! $_sTmpFileName ) { |
|
134 | + if ( !$_sTmpFileName ) { |
|
135 | 135 | return false; |
136 | 136 | } |
137 | 137 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
152 | - if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ){ |
|
152 | + if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ) { |
|
153 | 153 | unlink( $_sTmpFileName ); |
154 | 154 | return false; |
155 | 155 | } |
@@ -174,16 +174,16 @@ discard block |
||
174 | 174 | * @since 3.4.2 |
175 | 175 | * @return string The set file path. |
176 | 176 | */ |
177 | - static public function setTempPath( $sFilePath='' ) { |
|
177 | + static public function setTempPath( $sFilePath = '' ) { |
|
178 | 178 | |
179 | 179 | $_sDir = get_temp_dir(); |
180 | 180 | |
181 | 181 | $sFilePath = basename( $sFilePath ); |
182 | 182 | if ( empty( $sFilePath ) ) { |
183 | - $sFilePath = time() . '.tmp'; |
|
183 | + $sFilePath = time().'.tmp'; |
|
184 | 184 | } |
185 | 185 | |
186 | - $sFilePath = $_sDir . wp_unique_filename( $_sDir, $sFilePath ); |
|
186 | + $sFilePath = $_sDir.wp_unique_filename( $_sDir, $sFilePath ); |
|
187 | 187 | touch( $sFilePath ); |
188 | 188 | return $sFilePath; |
189 | 189 |
@@ -149,7 +149,7 @@ |
||
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
152 | - if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ){ |
|
152 | + if ( 200 != wp_remote_retrieve_response_code( $_aoResponse ) ) { |
|
153 | 153 | unlink( $_sTmpFileName ); |
154 | 154 | return false; |
155 | 155 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @since 3.4.2 |
26 | 26 | * @todo Create a similar function for filters. |
27 | 27 | */ |
28 | - static public function registerAction( $sActionHook, $oCallable, $iPriority=10 ) { |
|
28 | + static public function registerAction( $sActionHook, $oCallable, $iPriority = 10 ) { |
|
29 | 29 | |
30 | 30 | if ( did_action( $sActionHook ) ) { |
31 | 31 | return call_user_func_array( $oCallable, array() ); |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | * @param mixed $_and_more add as many arguments as necessary to the next parameters. |
63 | 63 | * @return void does not return a value. |
64 | 64 | */ |
65 | - static public function doActions( $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null ) { |
|
65 | + static public function doActions( $aActionHooks, $vArgs1 = null, $vArgs2 = null, $_and_more = null ) { |
|
66 | 66 | |
67 | 67 | $aArgs = func_get_args(); |
68 | 68 | $aActionHooks = $aArgs[ 0 ]; |
69 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
69 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
70 | 70 | $aArgs[ 0 ] = $sActionHook; |
71 | - call_user_func_array( 'do_action' , $aArgs ); |
|
71 | + call_user_func_array( 'do_action', $aArgs ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | } |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $aArgs = func_get_args(); |
101 | 101 | $oCallerObject = $aArgs[ 0 ]; |
102 | 102 | $aActionHooks = $aArgs[ 1 ]; |
103 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
104 | - if ( ! $sActionHook ) { |
|
103 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
104 | + if ( !$sActionHook ) { |
|
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | $aArgs[ 1 ] = $sActionHook; |
108 | - call_user_func_array( array( get_class(), 'addAndDoAction' ) , $aArgs ); |
|
108 | + call_user_func_array( array( get_class(), 'addAndDoAction' ), $aArgs ); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $_aArgs = func_get_args(); |
125 | 125 | $_oCallerObject = $_aArgs[ 0 ]; |
126 | 126 | $_sActionHook = $_aArgs[ 1 ]; |
127 | - if ( ! $_sActionHook ) { |
|
127 | + if ( !$_sActionHook ) { |
|
128 | 128 | return; |
129 | 129 | } |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | // Remove the first element, the caller object. |
138 | 138 | array_shift( $_aArgs ); |
139 | - call_user_func_array( 'do_action' , $_aArgs ); |
|
139 | + call_user_func_array( 'do_action', $_aArgs ); |
|
140 | 140 | |
141 | 141 | } |
142 | 142 | |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | $_aFilters = $_aArgs[ 1 ]; |
165 | 165 | $_vInput = $_aArgs[ 2 ]; |
166 | 166 | |
167 | - foreach( ( array ) $_aFilters as $_sFilter ) { |
|
168 | - if ( ! $_sFilter ) { |
|
167 | + foreach ( ( array ) $_aFilters as $_sFilter ) { |
|
168 | + if ( !$_sFilter ) { |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | $_aArgs[ 1 ] = $_sFilter; |
172 | - $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
172 | + $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
173 | 173 | $_vInput = call_user_func_array( |
174 | 174 | array( get_class(), 'addAndApplyFilter' ), |
175 | 175 | $_aArgs |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $_aArgs = func_get_args(); |
204 | 204 | $_oCallerObject = $_aArgs[ 0 ]; |
205 | 205 | $_sFilter = $_aArgs[ 1 ]; |
206 | - if ( ! $_sFilter ) { |
|
206 | + if ( !$_sFilter ) { |
|
207 | 207 | return $_aArgs[ 2 ]; |
208 | 208 | } |
209 | 209 | |
@@ -234,17 +234,17 @@ discard block |
||
234 | 234 | * @access public |
235 | 235 | * @return array Returns an array consisting of the filters. |
236 | 236 | */ |
237 | - static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) { |
|
237 | + static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse = false ) { |
|
238 | 238 | |
239 | 239 | $_aFilters = array(); |
240 | 240 | if ( $sTabSlug && $sPageSlug ) { |
241 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
241 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
242 | 242 | } |
243 | 243 | if ( $sPageSlug ) { |
244 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}"; |
|
244 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}"; |
|
245 | 245 | } |
246 | 246 | if ( $sClassName ) { |
247 | - $_aFilters[] = "{$sPrefix}{$sClassName}"; |
|
247 | + $_aFilters[ ] = "{$sPrefix}{$sClassName}"; |
|
248 | 248 | } |
249 | 249 | return $bReverse |
250 | 250 | ? array_reverse( $_aFilters ) |