@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @return void |
| 194 | 194 | */ |
| 195 | 195 | static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
| 196 | - if ( ! is_admin() ) { |
|
| 196 | + if ( ! is_admin() ) { |
|
| 197 | 197 | return; |
| 198 | 198 | } |
| 199 | 199 | self::$_aAdminNotices[] = array( |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * @return void |
| 209 | 209 | */ |
| 210 | 210 | static public function _replyToSetAdminNotice() { |
| 211 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 211 | + foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 212 | 212 | echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
| 213 | 213 | ."<p>" |
| 214 | 214 | . sprintf( |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
| 226 | 226 | |
| 227 | 227 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
| 228 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 228 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 229 | 229 | return; |
| 230 | 230 | } |
| 231 | -if ( defined( 'DOING_UNINSTALL' ) ) { |
|
| 231 | +if ( defined( 'DOING_UNINSTALL' ) ) { |
|
| 232 | 232 | return; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -16,15 +16,15 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.7.12'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | - const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
|
| 19 | + const VERSION = '3.7.12'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 20 | + const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
|
| 21 | 21 | const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
| 22 | - const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
|
| 23 | - const URI = 'http://admin-page-framework.michaeluno.jp/'; |
|
| 24 | - const AUTHOR = 'miunosoft (Michael Uno)'; |
|
| 25 | - const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
|
| 26 | - const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
|
| 27 | - const LICENSE = 'GPL v2 or later'; |
|
| 22 | + const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
|
| 23 | + const URI = 'http://admin-page-framework.michaeluno.jp/'; |
|
| 24 | + const AUTHOR = 'miunosoft (Michael Uno)'; |
|
| 25 | + const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
|
| 26 | + const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
|
| 27 | + const LICENSE = 'GPL v2 or later'; |
|
| 28 | 28 | const CONTRIBUTORS = ''; |
| 29 | 29 | |
| 30 | 30 | } |
@@ -55,7 +55,7 @@ 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. |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * These will be accessed from the bootstrap script. |
| 72 | 72 | */ |
| 73 | - const TEXT_DOMAIN = 'admin-page-framework-loader'; |
|
| 74 | - const TEXT_DOMAIN_PATH = '/language'; |
|
| 73 | + const TEXT_DOMAIN = 'admin-page-framework-loader'; |
|
| 74 | + const TEXT_DOMAIN_PATH = '/language'; |
|
| 75 | 75 | |
| 76 | - // These properties will be defined in the setUp() method. |
|
| 77 | - static public $sFilePath = ''; |
|
| 78 | - static public $sDirPath = ''; |
|
| 76 | + // These properties will be defined in the setUp() method. |
|
| 77 | + static public $sFilePath = ''; |
|
| 78 | + static public $sDirPath = ''; |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Requirements. |
@@ -136,34 +136,34 @@ discard block |
||
| 136 | 136 | static public $aTaxonomies = array( |
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | - /** |
|
| 140 | - * Sets up static properties. |
|
| 139 | + /** |
|
| 140 | + * Sets up static properties. |
|
| 141 | 141 | * @return void |
| 142 | - */ |
|
| 143 | - static public function setUp( $sPluginFilePath ) { |
|
| 142 | + */ |
|
| 143 | + static public function setUp( $sPluginFilePath ) { |
|
| 144 | 144 | |
| 145 | - self::$sFilePath = $sPluginFilePath; |
|
| 146 | - self::$sDirPath = dirname( self::$sFilePath ); |
|
| 145 | + self::$sFilePath = $sPluginFilePath; |
|
| 146 | + self::$sDirPath = dirname( self::$sFilePath ); |
|
| 147 | 147 | |
| 148 | - } |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Returns the URL with the given relative path to the plugin path. |
|
| 152 | - * |
|
| 153 | - * <h3>Example</h3> |
|
| 150 | + /** |
|
| 151 | + * Returns the URL with the given relative path to the plugin path. |
|
| 152 | + * |
|
| 153 | + * <h3>Example</h3> |
|
| 154 | 154 | * <code> |
| 155 | 155 | * AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' ); |
| 156 | 156 | * </code> |
| 157 | 157 | * @since 3.5.0 |
| 158 | 158 | * @return string |
| 159 | - */ |
|
| 160 | - public static function getPluginURL( $sRelativePath='' ) { |
|
| 159 | + */ |
|
| 160 | + public static function getPluginURL( $sRelativePath='' ) { |
|
| 161 | 161 | if ( isset( self::$_sPluginURLCache ) ) { |
| 162 | 162 | return self::$_sPluginURLCache . $sRelativePath; |
| 163 | 163 | } |
| 164 | 164 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
| 165 | 165 | return self::$_sPluginURLCache . $sRelativePath; |
| 166 | - } |
|
| 166 | + } |
|
| 167 | 167 | /** |
| 168 | 168 | * @since 3.7.9 |
| 169 | 169 | */ |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
| 18 | 18 | |
| 19 | - const VERSION = '3.7.12'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
| 19 | + const VERSION = '3.7.12'; // <--- 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)'; |
| 25 | 25 | const AUTHOR_URI = 'http://en.michaeluno.jp/'; |
| 26 | 26 | const COPYRIGHT = 'Copyright (c) 2015-2016, Michael Uno'; |
| 27 | 27 | const LICENSE = 'GPL v2 or later'; |
| 28 | - const CONTRIBUTORS = ''; |
|
| 28 | + const CONTRIBUTORS = ''; |
|
| 29 | 29 | |
| 30 | 30 | } |
| 31 | 31 | /** |
@@ -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 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | static public $aAdminPages = array( |
| 119 | 119 | // key => 'page slug' |
| 120 | - 'about' => 'apfl_about', // the welcome page |
|
| 120 | + 'about' => 'apfl_about', // the welcome page |
|
| 121 | 121 | 'addon' => 'apfl_addons', |
| 122 | 122 | 'tool' => 'apfl_tools', |
| 123 | 123 | 'help' => 'apfl_contact', |
@@ -157,12 +157,12 @@ discard block |
||
| 157 | 157 | * @since 3.5.0 |
| 158 | 158 | * @return string |
| 159 | 159 | */ |
| 160 | - public static function getPluginURL( $sRelativePath='' ) { |
|
| 160 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
| 161 | 161 | if ( isset( self::$_sPluginURLCache ) ) { |
| 162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 163 | 163 | } |
| 164 | 164 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
| 165 | - return self::$_sPluginURLCache . $sRelativePath; |
|
| 165 | + return self::$_sPluginURLCache.$sRelativePath; |
|
| 166 | 166 | } |
| 167 | 167 | /** |
| 168 | 168 | * @since 3.7.9 |
@@ -192,13 +192,13 @@ discard block |
||
| 192 | 192 | * @since 3.5.0 |
| 193 | 193 | * @return void |
| 194 | 194 | */ |
| 195 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
| 196 | - if ( ! is_admin() ) { |
|
| 195 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
| 196 | + if ( !is_admin() ) { |
|
| 197 | 197 | return; |
| 198 | 198 | } |
| 199 | - self::$_aAdminNotices[] = array( |
|
| 199 | + self::$_aAdminNotices[ ] = array( |
|
| 200 | 200 | 'message' => $sMessage, |
| 201 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
| 201 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
| 202 | 202 | ); |
| 203 | 203 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
| 204 | 204 | } |
@@ -208,12 +208,12 @@ discard block |
||
| 208 | 208 | * @return void |
| 209 | 209 | */ |
| 210 | 210 | static public function _replyToSetAdminNotice() { |
| 211 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 212 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
| 211 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
| 212 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
| 213 | 213 | ."<p>" |
| 214 | 214 | . sprintf( |
| 215 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
| 216 | - self::NAME . ' ' . self::VERSION |
|
| 215 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
| 216 | + self::NAME.' '.self::VERSION |
|
| 217 | 217 | ) |
| 218 | 218 | . "</p>" |
| 219 | 219 | . "</div>"; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
| 226 | 226 | |
| 227 | 227 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
| 228 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 228 | +if ( !defined( 'ABSPATH' ) ) { |
|
| 229 | 229 | return; |
| 230 | 230 | } |
| 231 | 231 | if ( defined( 'DOING_UNINSTALL' ) ) { |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
| 239 | 239 | if ( |
| 240 | - ! $_bFrameworkLoaded |
|
| 241 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 240 | + !$_bFrameworkLoaded |
|
| 241 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
| 242 | 242 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
| 243 | 243 | ) { |
| 244 | 244 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -256,18 +256,18 @@ discard block |
||
| 256 | 256 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
| 257 | 257 | |
| 258 | 258 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
| 259 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
| 259 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
| 260 | 260 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
| 261 | 261 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
| 262 | 262 | include( |
| 263 | 263 | $_bLoadDevelopmentVersion |
| 264 | 264 | ? $_sDevelopmentVersionPath |
| 265 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
| 265 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
| 266 | 266 | ); |
| 267 | 267 | |
| 268 | 268 | // Include the framework loader plugin components. |
| 269 | 269 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
| 270 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 270 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
| 271 | 271 | new AdminPageFrameworkLoader_Bootstrap( |
| 272 | 272 | AdminPageFrameworkLoader_Registry::$sFilePath, |
| 273 | 273 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |
@@ -23,21 +23,21 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * Sets up hooks and properties. |
| 25 | 25 | */ |
| 26 | - public function __construct( $oProp, $oMsg=null ) { |
|
| 26 | + public function __construct( $oProp, $oMsg = null ) { |
|
| 27 | 27 | |
| 28 | 28 | parent::__construct( $oProp, $oMsg ); |
| 29 | 29 | |
| 30 | - if ( in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) && 'plugin' === $this->oProp->aScriptInfo['sType'] ) { |
|
| 30 | + if ( in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) && 'plugin' === $this->oProp->aScriptInfo[ 'sType' ] ) { |
|
| 31 | 31 | |
| 32 | 32 | // This filter for non-network-admin action links is added in the parent constructor. |
| 33 | 33 | remove_filter( |
| 34 | - 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo['sPath'] ), |
|
| 34 | + 'plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
| 35 | 35 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
| 36 | 36 | 20 |
| 37 | 37 | ); |
| 38 | 38 | // Add the action link filter for the multi-site network admin. |
| 39 | 39 | add_filter( |
| 40 | - 'network_admin_plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo['sPath'] ), |
|
| 40 | + 'network_admin_plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
| 41 | 41 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ) |
| 42 | 42 | ); |
| 43 | 43 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $GLOBALS, |
| 47 | 47 | array( 'aAdminPageFramework', 'aPageClasses', $this->sClassName ) |
| 48 | 48 | ), |
| 49 | - 'options_' . $this->sClassName, // options_{instantiated class name} |
|
| 49 | + 'options_'.$this->sClassName, // options_{instantiated class name} |
|
| 50 | 50 | $this->sOptionKey |
| 51 | 51 | ? get_site_option( $this->sOptionKey, array() ) |
| 52 | 52 | : array() |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @since 3.1.1 Made it return a boolean value. |
| 65 | 65 | * @return boolean True if saved; otherwise, false. |
| 66 | 66 | */ |
| 67 | - public function updateOption( $aOptions=null ) { |
|
| 67 | + public function updateOption( $aOptions = null ) { |
|
| 68 | 68 | |
| 69 | 69 | if ( $this->_bDisableSavingOptions ) { |
| 70 | 70 | return; |
@@ -40,14 +40,14 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public static function instantiate( $oProp, $oMsg ) { |
| 42 | 42 | |
| 43 | - if ( ! is_network_admin() ) { |
|
| 43 | + if ( !is_network_admin() ) { |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
| 48 | 48 | return self::$_oInstance; |
| 49 | 49 | |
| 50 | - self::$aClassNames[] = $oProp->sClassName; |
|
| 50 | + self::$aClassNames[ ] = $oProp->sClassName; |
|
| 51 | 51 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_NetworkAdminPage( $oProp, $oMsg ); |
| 52 | 52 | |
| 53 | 53 | return self::$_oInstance; |
@@ -40,12 +40,13 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public static function instantiate( $oProp, $oMsg ) { |
| 42 | 42 | |
| 43 | - if ( ! is_network_admin() ) { |
|
| 43 | + if ( ! is_network_admin() ) { |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
|
| 48 | - return self::$_oInstance; |
|
| 47 | + if ( in_array( $oProp->sClassName, self::$aClassNames ) ) { |
|
| 48 | + return self::$_oInstance; |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | self::$aClassNames[] = $oProp->sClassName; |
| 51 | 52 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_NetworkAdminPage( $oProp, $oMsg ); |
@@ -20,5 +20,5 @@ |
||
| 20 | 20 | * @extends AdminPageFramework_Resource_post_meta_box |
| 21 | 21 | * @internal |
| 22 | 22 | */ |
| 23 | -class AdminPageFramework_Resource_user_meta extends AdminPageFramework_Resource_post_meta_box { |
|
| 23 | +class AdminPageFramework_Resource_user_meta extends AdminPageFramework_Resource_post_meta_box { |
|
| 24 | 24 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | parent::__construct( $oProp ); |
| 29 | 29 | |
| 30 | - if ( ! $this->oProp->bIsAdmin ) { |
|
| 30 | + if ( !$this->oProp->bIsAdmin ) { |
|
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // 3.7.10+ |
| 40 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
| 40 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function _isInThePage() { |
| 52 | 52 | |
| 53 | - if ( ! $this->oProp->bIsAdmin ) { |
|
| 53 | + if ( !$this->oProp->bIsAdmin ) { |
|
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | public function _replyToSetUpHooks( $oFactory ) { |
| 72 | 72 | |
| 73 | 73 | // Hooks to display fields. |
| 74 | - add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
| 75 | - add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
| 76 | - add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
| 74 | + add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
| 75 | + add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
| 76 | + add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
| 77 | 77 | |
| 78 | 78 | // Hooks to save field values. |
| 79 | 79 | add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
| 80 | - add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
| 81 | - add_action('user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
| 80 | + add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
| 81 | + add_action( 'user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
| 82 | 82 | |
| 83 | 83 | } |
| 84 | 84 | |
@@ -56,10 +56,10 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
| 58 | 58 | |
| 59 | - if ( ! $this->_isInstantiatable() ) { |
|
| 59 | + if ( ! $this->_isInstantiatable() ) { |
|
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | - if ( empty( $asPostTypeOrScreenID ) ) { |
|
| 62 | + if ( empty( $asPostTypeOrScreenID ) ) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
| 57 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
| 58 | 58 | |
| 59 | - if ( ! $this->_isInstantiatable() ) { |
|
| 59 | + if ( !$this->_isInstantiatable() ) { |
|
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | if ( empty( $asPostTypeOrScreenID ) ) { |
@@ -66,15 +66,15 @@ discard block |
||
| 66 | 66 | // A property object needs to be done first. |
| 67 | 67 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
| 68 | 68 | ? $this->aSubClassNames[ 'oProp' ] |
| 69 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
| 70 | - $this->oProp = new $_sProprtyClassName( |
|
| 69 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
| 70 | + $this->oProp = new $_sProprtyClassName( |
|
| 71 | 71 | $this, |
| 72 | 72 | get_class( $this ), |
| 73 | 73 | $sCapability, |
| 74 | 74 | $sTextDomain, |
| 75 | 75 | $this->_sStructureType |
| 76 | 76 | ); |
| 77 | - $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
| 77 | + $this->oProp->aPostTypes = is_string( $asPostTypeOrScreenID ) |
|
| 78 | 78 | ? array( $asPostTypeOrScreenID ) |
| 79 | 79 | : $asPostTypeOrScreenID; |
| 80 | 80 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param string $sTextDomain (optional) The text domain applied to the displayed text messages. Default: `admin-page-framework`. |
| 35 | 35 | * @return void |
| 36 | 36 | */ |
| 37 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
| 37 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
| 38 | 38 | |
| 39 | 39 | parent::__construct( $this->oProp ); |
| 40 | 40 | |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | ? $this->oUtil->sanitizeSlug( $sMetaBoxID ) |
| 43 | 43 | : strtolower( $this->oProp->sClassName ); |
| 44 | 44 | $this->oProp->sTitle = $sTitle; |
| 45 | - $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
| 46 | - $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
| 45 | + $this->oProp->sContext = $sContext; // 'normal', 'advanced', or 'side' |
|
| 46 | + $this->oProp->sPriority = $sPriority; // 'high', 'core', 'default' or 'low' |
|
| 47 | 47 | |
| 48 | - if ( ! $this->oProp->bIsAdmin ) { |
|
| 48 | + if ( !$this->oProp->bIsAdmin ) { |
|
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function _isInThePage() { |
| 68 | 68 | |
| 69 | - if ( ! in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
| 69 | + if ( !in_array( $this->oProp->sPageNow, array( 'post.php', 'post-new.php' ) ) ) { |
|
| 70 | 70 | return false; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
| 73 | + if ( !in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
| 74 | 74 | return false; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | return false; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
| 73 | + if ( ! in_array( $this->oUtil->getCurrentPostType(), $this->oProp->aPostTypes ) ) { |
|
| 74 | 74 | return false; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | * @since 2.1.5 |
| 31 | 31 | * @internal |
| 32 | 32 | */ |
| 33 | - public function _enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
| 33 | + public function _enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
| 34 | 34 | |
| 35 | 35 | $_aHandleIDs = array(); |
| 36 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
| 37 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
| 36 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
| 37 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
| 38 | 38 | } |
| 39 | 39 | return $_aHandleIDs; |
| 40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
| 59 | 59 | * @internal |
| 60 | 60 | */ |
| 61 | - public function _enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
| 61 | + public function _enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
| 62 | 62 | |
| 63 | 63 | $sSRC = trim( $sSRC ); |
| 64 | 64 | if ( empty( $sSRC ) ) { return ''; } |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | 'sSRC' => $sSRC, |
| 75 | 75 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
| 76 | 76 | 'sType' => 'style', |
| 77 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
| 77 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
| 78 | 78 | ), |
| 79 | 79 | self::$_aStructure_EnqueuingResources |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | // Store the attributes in another container by url. |
| 83 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
| 83 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
| 84 | 84 | |
| 85 | 85 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
| 86 | 86 | |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | * @since 2.1.5 |
| 93 | 93 | * @internal |
| 94 | 94 | */ |
| 95 | - public function _enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
| 95 | + public function _enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
| 96 | 96 | |
| 97 | 97 | $_aHandleIDs = array(); |
| 98 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
| 99 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
| 98 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
| 99 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
| 100 | 100 | } |
| 101 | 101 | return $_aHandleIDs; |
| 102 | 102 | |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
| 122 | 122 | * @internal |
| 123 | 123 | */ |
| 124 | - public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
| 124 | + public function _enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
| 125 | 125 | |
| 126 | - $sSRC = trim( $sSRC ); |
|
| 126 | + $sSRC = trim( $sSRC ); |
|
| 127 | 127 | if ( empty( $sSRC ) ) { |
| 128 | 128 | return ''; |
| 129 | 129 | } |
@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | 'sSRC' => $sSRC, |
| 142 | 142 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
| 143 | 143 | 'sType' => 'script', |
| 144 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
| 144 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
| 145 | 145 | ), |
| 146 | 146 | self::$_aStructure_EnqueuingResources |
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | // Store the attributes in another container by url. |
| 150 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
| 150 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
| 151 | 151 | |
| 152 | 152 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
| 153 | 153 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @since 3.0.0 |
| 160 | 160 | * @internal |
| 161 | 161 | */ |
| 162 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
| 162 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
| 163 | 163 | return $this->_enqueueStyle( $sSRC, array(), $aCustomArgs ); |
| 164 | 164 | } |
| 165 | 165 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * @since 3.0.0 |
| 169 | 169 | * @internal |
| 170 | 170 | */ |
| 171 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
| 171 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
| 172 | 172 | return $this->_enqueueScript( $sSRC, array(), $aCustomArgs ); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | protected function _enqueueSRCByCondition( $aEnqueueItem ) { |
| 183 | 183 | |
| 184 | - $_sCurrentPostType = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ( isset( $GLOBALS['typenow'] ) ? $GLOBALS['typenow'] : null ); |
|
| 185 | - if ( in_array( $_sCurrentPostType, $aEnqueueItem['aPostTypes'] ) ) { |
|
| 184 | + $_sCurrentPostType = isset( $_GET[ 'post_type' ] ) ? $_GET[ 'post_type' ] : ( isset( $GLOBALS[ 'typenow' ] ) ? $GLOBALS[ 'typenow' ] : null ); |
|
| 185 | + if ( in_array( $_sCurrentPostType, $aEnqueueItem[ 'aPostTypes' ] ) ) { |
|
| 186 | 186 | return $this->_enqueueSRC( $aEnqueueItem ); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -124,14 +124,14 @@ |
||
| 124 | 124 | public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
| 125 | 125 | |
| 126 | 126 | $sSRC = trim( $sSRC ); |
| 127 | - if ( empty( $sSRC ) ) { |
|
| 127 | + if ( empty( $sSRC ) ) { |
|
| 128 | 128 | return ''; |
| 129 | 129 | } |
| 130 | 130 | $sSRC = $this->getResolvedSRC( $sSRC ); |
| 131 | 131 | |
| 132 | 132 | // Setting the key based on the url prevents duplicate items |
| 133 | 133 | $_sSRCHash = md5( $sSRC ); |
| 134 | - if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
| 134 | + if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
| 135 | 135 | return ''; |
| 136 | 136 | } |
| 137 | 137 | |