@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'getPostTypeByTypeNow', |
58 | 58 | 'getPostTypeByScreenObject', |
59 | 59 | 'getPostTypeByREQUEST', |
60 | - 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
60 | + 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
61 | 61 | ); |
62 | 62 | foreach ( $_aMethodsToTry as $_sMethodName ) { |
63 | 63 | $_sPostType = call_user_func( array( __CLASS__, $_sMethodName ) ); |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * @param array|string The post type slug(s) to check. If this is empty, the method just checks the current page is a taxonomy page. |
122 | 122 | * @return boolean |
123 | 123 | */ |
124 | - static public function isCustomTaxonomyPage( $asPostTypes=array() ) { |
|
124 | + static public function isCustomTaxonomyPage( $asPostTypes = array() ) { |
|
125 | 125 | |
126 | - if ( ! in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
126 | + if ( !in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
127 | 127 | return false; |
128 | 128 | } |
129 | 129 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | * Otherwise, it will check if the page belongs to the given post type(s). |
139 | 139 | * @return boolean |
140 | 140 | */ |
141 | - static public function isPostDefinitionPage( $asPostTypes=array() ) { |
|
141 | + static public function isPostDefinitionPage( $asPostTypes = array() ) { |
|
142 | 142 | |
143 | 143 | // If it's not the post definition page, |
144 | - if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { |
|
144 | + if ( !in_array( self::getPageNow(), array( 'post.php', 'post-new.php',) ) ) { |
|
145 | 145 | return false; |
146 | 146 | } |
147 | 147 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * |
175 | 175 | * @since 3.0.0 |
176 | 176 | */ |
177 | - static public function isPostListingPage( $asPostTypes=array() ) { |
|
177 | + static public function isPostListingPage( $asPostTypes = array() ) { |
|
178 | 178 | |
179 | 179 | if ( 'edit.php' != self::getPageNow() ) { |
180 | 180 | return false; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $_aPostTypes = self::getAsArray( $asPostTypes ); |
184 | 184 | |
185 | - if ( ! isset( $_GET[ 'post_type' ] ) ) { |
|
185 | + if ( !isset( $_GET[ 'post_type' ] ) ) { |
|
186 | 186 | return in_array( 'post', $_aPostTypes ); |
187 | 187 | } |
188 | 188 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 0 => '_getPageNow_FrontEnd', |
221 | 221 | 1 => '_getPageNow_BackEnd', |
222 | 222 | ); |
223 | - $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
223 | + $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
224 | 224 | self::$_sPageNow = self::$_sMethodName(); |
225 | 225 | return self::$_sPageNow; |
226 | 226 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | if ( isset( $GLBOALS[ 'page_hook' ] ) ) { |
317 | 317 | return is_network_admin() |
318 | - ? $GLBOALS[ 'page_hook' ] . '-network' |
|
318 | + ? $GLBOALS[ 'page_hook' ].'-network' |
|
319 | 319 | : $GLBOALS[ 'page_hook' ]; |
320 | 320 | } |
321 | 321 | |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | * @since 3.7.0 |
330 | 330 | * @return boolean |
331 | 331 | */ |
332 | - static public function doesMetaBoxExist( $sContext='' ) { |
|
332 | + static public function doesMetaBoxExist( $sContext = '' ) { |
|
333 | 333 | |
334 | 334 | $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] ); |
335 | 335 | if ( $sContext ) { |
336 | - $_aDimensions[] = $sContext; |
|
336 | + $_aDimensions[ ] = $sContext; |
|
337 | 337 | } |
338 | 338 | $_aSideMetaBoxes = self::getElementAsArray( |
339 | 339 | $GLOBALS, |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | parent::__construct( $oProp ); |
30 | 30 | |
31 | - if ( ! $this->oProp->bIsAdmin ) { |
|
31 | + if ( !$this->oProp->bIsAdmin ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ); |
40 | 40 | |
41 | 41 | add_action( |
42 | - 'set_up_' . $this->oProp->sClassName, |
|
42 | + 'set_up_'.$this->oProp->sClassName, |
|
43 | 43 | array( $this, '_replyToSetUpHooks' ) |
44 | 44 | ); |
45 | 45 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | return true; |
60 | 60 | } |
61 | 61 | |
62 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
62 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | |
66 | - if ( isset( $_GET[ 'taxonomy' ] ) && ! in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
66 | + if ( isset( $_GET[ 'taxonomy' ] ) && !in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
67 | 67 | return false; |
68 | 68 | } |
69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function _replyToSetUpHooks( $oFactory ) { |
82 | 82 | |
83 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | + foreach ( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
84 | 84 | |
85 | 85 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
86 | 86 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | public function _replyToSetUpHooks( $oFactory ) { |
82 | 82 | |
83 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
83 | + foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
84 | 84 | |
85 | 85 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
86 | 86 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @param string The text domain of the caller script. |
105 | 105 | * @return void |
106 | 106 | */ |
107 | - public function __construct( $sPostType, $aArguments=array(), $sCallerPath=null, $sTextDomain='admin-page-framework' ) { |
|
107 | + public function __construct( $sPostType, $aArguments = array(), $sCallerPath = null, $sTextDomain = 'admin-page-framework' ) { |
|
108 | 108 | |
109 | 109 | if ( empty( $sPostType ) ) { |
110 | 110 | return; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
114 | 114 | ? $this->aSubClassNames[ 'oProp' ] |
115 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
115 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
116 | 116 | $this->oProp = new $_sProprtyClassName( |
117 | 117 | $this, |
118 | 118 | $this->_getCallerScriptPath( $sCallerPath ), |
119 | - get_class( $this ), // class name |
|
120 | - 'publish_posts', // capability |
|
121 | - $sTextDomain, // text domain |
|
119 | + get_class( $this ), // class name |
|
120 | + 'publish_posts', // capability |
|
121 | + $sTextDomain, // text domain |
|
122 | 122 | $this->_sStructureType // structure type |
123 | 123 | ); |
124 | - $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
124 | + $this->oProp->sPostType = AdminPageFramework_WPUtility::sanitizeSlug( $sPostType ); |
|
125 | 125 | |
126 | 126 | // Post type argument array structure |
127 | 127 | // @see http://codex.wordpress.org/Function_Reference/register_post_type#Arguments |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | return $sCallerPath; |
145 | 145 | } |
146 | 146 | |
147 | - if ( ! is_admin() ) { |
|
147 | + if ( !is_admin() ) { |
|
148 | 148 | return null; |
149 | 149 | } |
150 | 150 | $_sPageNow = AdminPageFramework_Utility::getElement( $GLOBALS, 'pagenow' ); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function _replyToDetermineToLoadAdmin( /* $oScreen */ ) { |
46 | 46 | |
47 | - if ( ! $this->_isInThePage() ) { |
|
47 | + if ( !$this->_isInThePage() ) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | public function _isInThePage() { |
118 | 118 | |
119 | 119 | // If it's not in one of the post type's pages |
120 | - if ( ! $this->oProp->bIsAdmin ) { |
|
120 | + if ( !$this->oProp->bIsAdmin ) { |
|
121 | 121 | return false; |
122 | 122 | } |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return true; |
127 | 127 | } |
128 | 128 | |
129 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit.php', 'edit-tags.php', 'term.php', 'post.php', 'post-new.php' ) ) ) { |
|
129 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit.php', 'edit-tags.php', 'term.php', 'post.php', 'post-new.php' ) ) ) { |
|
130 | 130 | return false; |
131 | 131 | } |
132 | 132 |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.7.14'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.7.14'; // <--- 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' ) ) { |
@@ -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 |