@@ -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 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | |
60 | - if ( ! $this->oProp->bIsAdmin ) { |
|
60 | + if ( !$this->oProp->bIsAdmin ) { |
|
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | public function _replyToSetUpHooks( $oFactory ) { |
79 | 79 | |
80 | 80 | // Hooks to display fields. |
81 | - add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
82 | - add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
83 | - add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
81 | + add_action( 'show_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
82 | + add_action( 'edit_user_profile', array( $this, '_replyToPrintFields' ) ); // profile.php |
|
83 | + add_action( 'user_new_form', array( $this, '_replyToPrintFields' ) ); // user-new.php |
|
84 | 84 | |
85 | 85 | // Hooks to save field values. |
86 | - add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
87 | - add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
88 | - add_action('user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
86 | + add_action( 'personal_options_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
87 | + add_action( 'edit_user_profile_update', array( $this, '_replyToSaveFieldValues' ) ); // profile.php |
|
88 | + add_action( 'user_register', array( $this, '_replyToSaveFieldValues' ) ); // user-new.php |
|
89 | 89 | |
90 | 90 | $this->_load(); // 3.8.14+ |
91 | 91 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * @since 3.7.0 |
21 | 21 | * @return string |
22 | 22 | */ |
23 | - protected function _get() { |
|
23 | + protected function _get() { |
|
24 | 24 | return $this->_getRules(); |
25 | 25 | } |
26 | 26 | /** |
@@ -15,5 +15,5 @@ |
||
15 | 15 | * @package AdminPageFramework/Factory/TermMeta |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -abstract class AdminPageFramework_TermMeta_Router extends AdminPageFramework_TaxonomyField_Controller { |
|
18 | +abstract class AdminPageFramework_TermMeta_Router extends AdminPageFramework_TaxonomyField_Controller { |
|
19 | 19 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
30 | 30 | return self::$_oInstance; |
31 | 31 | |
32 | - self::$aClassNames[] = $oProp->sClassName; |
|
32 | + self::$aClassNames[ ] = $oProp->sClassName; |
|
33 | 33 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_post_type( $oProp, $oMsg ); |
34 | 34 | |
35 | 35 | return self::$_oInstance; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function _replyToSetPageLoadInfoInFooter() { |
44 | 44 | |
45 | 45 | // Some users sets $_GET['post_type'] element even in regular admin pages. In that case, do not load the style to avoid duplicates. |
46 | - if ( isset( $_GET['page'] ) && $_GET['page'] ) { return; } |
|
46 | + if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] ) { return; } |
|
47 | 47 | |
48 | 48 | // For post type pages |
49 | 49 | if ( |
@@ -26,8 +26,9 @@ |
||
26 | 26 | */ |
27 | 27 | public static function instantiate( $oProp, $oMsg ) { |
28 | 28 | |
29 | - if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
|
30 | - return self::$_oInstance; |
|
29 | + if ( in_array( $oProp->sClassName, self::$aClassNames ) ) { |
|
30 | + return self::$_oInstance; |
|
31 | + } |
|
31 | 32 | |
32 | 33 | self::$aClassNames[] = $oProp->sClassName; |
33 | 34 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_post_type( $oProp, $oMsg ); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @since 3.2.0 |
17 | 17 | * @package AdminPageFramework/Factory/Widget |
18 | 18 | */ |
19 | -abstract class AdminPageFramework_Widget_View extends AdminPageFramework_Widget_Model { |
|
19 | +abstract class AdminPageFramework_Widget_View extends AdminPageFramework_Widget_Model { |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Filters the post type post content. |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @since 3.2.0 |
40 | 40 | * @return string |
41 | 41 | */ |
42 | - public function content( $sContent, $aArguments, $aFormData ) { |
|
42 | + public function content( $sContent, $aArguments, $aFormData ) { |
|
43 | 43 | return $sContent; |
44 | 44 | } |
45 | 45 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @since 3.7.0 |
21 | 21 | * @return string |
22 | 22 | */ |
23 | - protected function _get() { |
|
23 | + protected function _get() { |
|
24 | 24 | return $this->_getWidgetRules(); |
25 | 25 | } |
26 | 26 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | } |
104 | 104 | // If the WordPress version is greater than equal to 3.8, add MP6(the admin style introduced in 3.8) specific CSS rules. |
105 | - if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
|
105 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
|
106 | 106 | |
107 | 107 | $_sCSSRules .= <<<CSSRULES |
108 | 108 | /* Widget Forms */ |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * @since 3.7.0 |
27 | 27 | * @return void |
28 | 28 | */ |
29 | - public function construct() { |
|
29 | + public function construct() { |
|
30 | 30 | $this->_addDefaultResources(); |
31 | 31 | } |
32 | 32 |
@@ -19,22 +19,22 @@ |
||
19 | 19 | abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View { |
20 | 20 | |
21 | 21 | /** |
22 | - * The method for necessary set-ups. |
|
23 | - * |
|
24 | - * <h4>Example</h4> |
|
25 | - * <code> |
|
26 | - * public function setUp() { |
|
27 | - * $this->setArguments( |
|
28 | - * array( |
|
29 | - * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | - * ) |
|
31 | - * ); |
|
32 | - * } |
|
33 | - * </code> |
|
34 | - * |
|
35 | - * @abstract |
|
36 | - * @since 3.2.0 |
|
37 | - */ |
|
22 | + * The method for necessary set-ups. |
|
23 | + * |
|
24 | + * <h4>Example</h4> |
|
25 | + * <code> |
|
26 | + * public function setUp() { |
|
27 | + * $this->setArguments( |
|
28 | + * array( |
|
29 | + * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | + * ) |
|
31 | + * ); |
|
32 | + * } |
|
33 | + * </code> |
|
34 | + * |
|
35 | + * @abstract |
|
36 | + * @since 3.2.0 |
|
37 | + */ |
|
38 | 38 | public function setUp() {} |
39 | 39 | |
40 | 40 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @since 3.2.0 |
128 | 128 | * @internal Temporarily marked internal |
129 | 129 | */ |
130 | - public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
130 | + public function enqueueStyles( $aSRCs, $aCustomArgs = array() ) { |
|
131 | 131 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
132 | 132 | return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
133 | 133 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @since 3.2.0 |
141 | 141 | * @internal Temporarily marked internal |
142 | 142 | */ |
143 | - public function enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
143 | + public function enqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
144 | 144 | if ( method_exists( $this->oResource, '_enqueueStyle' ) ) { |
145 | 145 | return $this->oResource->_enqueueStyle( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
146 | 146 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @since 3.2.0 |
154 | 154 | * @internal Temporarily marked internal |
155 | 155 | */ |
156 | - public function enqueueScripts( $aSRCs, $aCustomArgs=array() ) { |
|
156 | + public function enqueueScripts( $aSRCs, $aCustomArgs = array() ) { |
|
157 | 157 | if ( method_exists( $this->oResource, '_enqueueScripts' ) ) { |
158 | 158 | return $this->oResource->_enqueueScripts( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
159 | 159 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * @since 3.2.0 |
167 | 167 | * @internal Temporarily marked internal |
168 | 168 | */ |
169 | - public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
169 | + public function enqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
170 | 170 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
171 | 171 | return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
172 | 172 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @see https://codex.wordpress.org/Function_Reference/wp_register_sidebar_widget |
188 | 188 | * @return void |
189 | 189 | */ |
190 | - protected function setArguments( array $aArguments=array() ) { |
|
190 | + protected function setArguments( array $aArguments = array() ) { |
|
191 | 191 | $this->oProp->aWidgetArguments = $aArguments; |
192 | 192 | } |
193 | 193 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @since 3.2.0 |
17 | 17 | * @package AdminPageFramework/Factory/Widget |
18 | 18 | */ |
19 | -abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View { |
|
19 | +abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View { |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * The method for necessary set-ups. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @since 3.2.0 |
128 | 128 | * @internal Temporarily marked internal |
129 | 129 | */ |
130 | - public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
130 | + public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
131 | 131 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
132 | 132 | return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
133 | 133 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * @since 3.2.0 |
167 | 167 | * @internal Temporarily marked internal |
168 | 168 | */ |
169 | - public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
169 | + public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
170 | 170 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
171 | 171 | return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
172 | 172 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @package AdminPageFramework/Factory/Widget |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -abstract class AdminPageFramework_Widget_Router extends AdminPageFramework_Factory { |
|
18 | +abstract class AdminPageFramework_Widget_Router extends AdminPageFramework_Factory { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Sets up hooks and properties. |
@@ -68,9 +68,9 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Responds to a request to an undefined property. |
|
72 | - * @since 3.8.17 |
|
73 | - */ |
|
71 | + * Responds to a request to an undefined property. |
|
72 | + * @since 3.8.17 |
|
73 | + */ |
|
74 | 74 | public function __get( $sPropertyName ) { |
75 | 75 | if ( $this->oProp->bAssumedAsWPWidget ) { |
76 | 76 | if ( isset( $this->oProp->aWPWidgetProperties[ $sPropertyName ] ) ) { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @return mixed |
56 | 56 | * @since 3.8.17 |
57 | 57 | */ |
58 | - public function __call( $sMethodName, $aArguments=null ) { |
|
58 | + public function __call( $sMethodName, $aArguments = null ) { |
|
59 | 59 | if ( $this->oProp->bAssumedAsWPWidget ) { |
60 | 60 | if ( in_array( $sMethodName, $this->oProp->aWPWidgetMethods ) ) { |
61 | 61 | return call_user_func_array( |