@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function get() { |
46 | 46 | |
47 | - if ( ! $this->iPostID ) { |
|
47 | + if ( !$this->iPostID ) { |
|
48 | 48 | return array(); |
49 | 49 | } |
50 | 50 | return $this->_getSavedDataFromFieldsets( |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | ); |
67 | 67 | |
68 | 68 | $_aMetaData = array(); |
69 | - foreach( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
69 | + foreach ( $aFieldsets as $_sSectionID => $_aFieldsets ) { |
|
70 | 70 | |
71 | - if ( '_default' == $_sSectionID ) { |
|
72 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
73 | - if ( ! in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
71 | + if ( '_default' == $_sSectionID ) { |
|
72 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
73 | + if ( !in_array( $_aFieldset[ 'field_id' ], $_aMetaKeys ) ) { |
|
74 | 74 | continue; |
75 | 75 | } |
76 | 76 | $_aMetaData[ $_aFieldset[ 'field_id' ] ] = get_post_meta( |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | } |
83 | - if ( ! in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
83 | + if ( !in_array( $_sSectionID, $_aMetaKeys ) ) { |
|
84 | 84 | continue; |
85 | 85 | } |
86 | 86 | $_aMetaData[ $_sSectionID ] = get_post_meta( |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @since 2.1.0 Moved from the meta box class. |
36 | 36 | * @var string |
37 | 37 | */ |
38 | - public $sMetaBoxID =''; |
|
38 | + public $sMetaBoxID = ''; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Stores the meta box title. |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public $_sFormRegistrationHook = 'admin_enqueue_scripts'; |
158 | 158 | |
159 | - public function __construct( $oCaller, $sClassName, $sCapability='edit_posts', $sTextDomain='admin-page-framework', $sStructureType='post_meta_box' ) { |
|
159 | + public function __construct( $oCaller, $sClassName, $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework', $sStructureType = 'post_meta_box' ) { |
|
160 | 160 | |
161 | 161 | // meta boxes don't need the caller script path. |
162 | 162 | parent::__construct( |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @since DEVVER |
22 | 22 | * @return string |
23 | 23 | */ |
24 | - protected function _get() { |
|
24 | + protected function _get() { |
|
25 | 25 | return $this->_getRules(); |
26 | 26 | } |
27 | 27 | /** |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | protected $_aBuiltInRootMenuSlugs = array( |
31 | 31 | // All keys must be lower case to support case insensitive look-ups. |
32 | 32 | 'dashboard' => 'index.php', |
33 | - 'sites' => 'sites.php', // not work |
|
34 | - 'themes' => 'themes.php', // not work |
|
33 | + 'sites' => 'sites.php', // not work |
|
34 | + 'themes' => 'themes.php', // not work |
|
35 | 35 | 'plugins' => 'plugins.php', |
36 | 36 | 'users' => 'users.php', |
37 | 37 | 'settings' => 'settings.php', |
38 | - 'updates' => 'update-core.php', // does not work |
|
38 | + 'updates' => 'update-core.php', // does not work |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
56 | 56 | * @return void returns nothing. |
57 | 57 | */ |
58 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
|
58 | + public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_network', $sTextDomain = 'admin-page-framework' ) { |
|
59 | 59 | |
60 | - if ( ! $this->_isInstantiatable() ) { |
|
60 | + if ( !$this->_isInstantiatable() ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $sCallerPath = $sCallerPath |
67 | 67 | ? $sCallerPath |
68 | - : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); // this is important to attempt to find the caller script path here when separating the library into multiple files. |
|
68 | + : AdminPageFramework_Utility::getCallerScriptPath( __FILE__ ); // this is important to attempt to find the caller script path here when separating the library into multiple files. |
|
69 | 69 | |
70 | 70 | $this->oProp = new AdminPageFramework_Property_NetworkAdmin( $this, $sCallerPath, get_class( $this ), $sOptionKey, $sCapability, $sTextDomain ); |
71 | 71 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | protected function _isInstantiatable() { |
83 | 83 | |
84 | - if ( isset( $GLOBALS['pagenow'] ) && 'admin-ajax.php' === $GLOBALS['pagenow'] ) { |
|
84 | + if ( isset( $GLOBALS[ 'pagenow' ] ) && 'admin-ajax.php' === $GLOBALS[ 'pagenow' ] ) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
126 | 126 | * @return mixed If the field ID is not specified. |
127 | 127 | */ |
128 | - static public function getOption( $sOptionKey, $asKey=null , $vDefault=null ) { |
|
128 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) { |
|
129 | 129 | return AdminPageFramework_WPUtility::getSiteOption( $sOptionKey, $asKey, $vDefault ); |
130 | 130 | } |
131 | 131 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
56 | 56 | * @return void returns nothing. |
57 | 57 | */ |
58 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
|
58 | + public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ) { |
|
59 | 59 | |
60 | 60 | if ( ! $this->_isInstantiatable() ) { |
61 | 61 | return; |
@@ -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 ); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating fields in the taxonomy page (edit-tags.php). |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @since 3.0.0 |
25 | 25 | * @deprecated DEVVER Use `AdminPageFramework_PageMetaBox` instead. |
26 | 26 | */ |
27 | - function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
27 | + function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
28 | 28 | |
29 | 29 | trigger_error( |
30 | 30 | sprintf( |
@@ -65,13 +65,13 @@ |
||
65 | 65 | * @param string $sPriority The priority, either `high`, `core`, `default` or `low`. |
66 | 66 | * @param string $sCapability The capability. See <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities</a>. |
67 | 67 | */ |
68 | - function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
68 | + function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
69 | 69 | |
70 | 70 | if ( empty( $asPageSlugs ) ) { |
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | - if ( ! $this->_isInstantiatable() ) { |
|
74 | + if ( !$this->_isInstantiatable() ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 |
@@ -67,11 +67,11 @@ |
||
67 | 67 | */ |
68 | 68 | function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
69 | 69 | |
70 | - if ( empty( $asPageSlugs ) ) { |
|
70 | + if ( empty( $asPageSlugs ) ) { |
|
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | - if ( ! $this->_isInstantiatable() ) { |
|
74 | + if ( ! $this->_isInstantiatable() ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 |