Completed
Push — master ( b6760c...d0c54a )
by J.D.
03:04
created
src/includes/classes/index.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -10,108 +10,108 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // auto-generated {
13
-require_once( dirname( __FILE__ ) . 'app.php' );
14
-require_once( dirname( __FILE__ ) . 'app/registry.php' );
15
-require_once( dirname( __FILE__ ) . 'class/autoloader.php' );
16
-require_once( dirname( __FILE__ ) . 'class/registry.php' );
17
-require_once( dirname( __FILE__ ) . 'class/registry/children.php' );
18
-require_once( dirname( __FILE__ ) . 'class/registry/childreni.php' );
19
-require_once( dirname( __FILE__ ) . 'class/registry/persistent.php' );
20
-require_once( dirname( __FILE__ ) . 'class/registryi.php' );
21
-require_once( dirname( __FILE__ ) . 'data/type.php' );
22
-require_once( dirname( __FILE__ ) . 'data/type/integer.php' );
23
-require_once( dirname( __FILE__ ) . 'data/type/text.php' );
24
-require_once( dirname( __FILE__ ) . 'data/typei.php' );
25
-require_once( dirname( __FILE__ ) . 'entity.php' );
26
-require_once( dirname( __FILE__ ) . 'entity/array.php' );
27
-require_once( dirname( __FILE__ ) . 'entity/attr.php' );
28
-require_once( dirname( __FILE__ ) . 'entity/childi.php' );
29
-require_once( dirname( __FILE__ ) . 'entity/comment.php' );
30
-require_once( dirname( __FILE__ ) . 'entity/comment/author.php' );
31
-require_once( dirname( __FILE__ ) . 'entity/comment/post.php' );
32
-require_once( dirname( __FILE__ ) . 'entity/enumerablei.php' );
33
-require_once( dirname( __FILE__ ) . 'entity/hierarchy.php' );
34
-require_once( dirname( __FILE__ ) . 'entity/hierarchyi.php' );
35
-require_once( dirname( __FILE__ ) . 'entity/parenti.php' );
36
-require_once( dirname( __FILE__ ) . 'entity/post.php' );
37
-require_once( dirname( __FILE__ ) . 'entity/post/author.php' );
38
-require_once( dirname( __FILE__ ) . 'entity/post/content.php' );
39
-require_once( dirname( __FILE__ ) . 'entity/post/terms.php' );
40
-require_once( dirname( __FILE__ ) . 'entity/post/type.php' );
41
-require_once( dirname( __FILE__ ) . 'entity/post/type/name.php' );
42
-require_once( dirname( __FILE__ ) . 'entity/post/type/relationship.php' );
43
-require_once( dirname( __FILE__ ) . 'entity/relationship.php' );
44
-require_once( dirname( __FILE__ ) . 'entity/relationship/dynamic.php' );
45
-require_once( dirname( __FILE__ ) . 'entity/restricted/visibilityi.php' );
46
-require_once( dirname( __FILE__ ) . 'entity/site.php' );
47
-require_once( dirname( __FILE__ ) . 'entity/term.php' );
48
-require_once( dirname( __FILE__ ) . 'entity/term/id.php' );
49
-require_once( dirname( __FILE__ ) . 'entity/user.php' );
50
-require_once( dirname( __FILE__ ) . 'entity/user/role.php' );
51
-require_once( dirname( __FILE__ ) . 'entity/user/role/name.php' );
52
-require_once( dirname( __FILE__ ) . 'entity/user/roles.php' );
53
-require_once( dirname( __FILE__ ) . 'entityish.php' );
54
-require_once( dirname( __FILE__ ) . 'entityishi.php' );
55
-require_once( dirname( __FILE__ ) . 'hierarchy.php' );
56
-require_once( dirname( __FILE__ ) . 'hook/action.php' );
57
-require_once( dirname( __FILE__ ) . 'hook/action/comment/new.php' );
58
-require_once( dirname( __FILE__ ) . 'hook/action/post/publish.php' );
59
-require_once( dirname( __FILE__ ) . 'hook/actioni.php' );
60
-require_once( dirname( __FILE__ ) . 'hook/actions.php' );
61
-require_once( dirname( __FILE__ ) . 'hook/arg.php' );
62
-require_once( dirname( __FILE__ ) . 'hook/arg/current/post.php' );
63
-require_once( dirname( __FILE__ ) . 'hook/arg/current/site.php' );
64
-require_once( dirname( __FILE__ ) . 'hook/arg/current/user.php' );
65
-require_once( dirname( __FILE__ ) . 'hook/arg/dynamic.php' );
66
-require_once( dirname( __FILE__ ) . 'hook/condition.php' );
67
-require_once( dirname( __FILE__ ) . 'hook/condition/entity/array/contains.php' );
68
-require_once( dirname( __FILE__ ) . 'hook/condition/equals.php' );
69
-require_once( dirname( __FILE__ ) . 'hook/condition/string/contains.php' );
70
-require_once( dirname( __FILE__ ) . 'hook/conditioni.php' );
71
-require_once( dirname( __FILE__ ) . 'hook/event.php' );
72
-require_once( dirname( __FILE__ ) . 'hook/event/args.php' );
73
-require_once( dirname( __FILE__ ) . 'hook/event/comment/leave.php' );
74
-require_once( dirname( __FILE__ ) . 'hook/event/dynamic.php' );
75
-require_once( dirname( __FILE__ ) . 'hook/event/media/upload.php' );
76
-require_once( dirname( __FILE__ ) . 'hook/event/post/publish.php' );
77
-require_once( dirname( __FILE__ ) . 'hook/event/user/register.php' );
78
-require_once( dirname( __FILE__ ) . 'hook/event/user/visit.php' );
79
-require_once( dirname( __FILE__ ) . 'hook/eventi.php' );
80
-require_once( dirname( __FILE__ ) . 'hook/events.php' );
81
-require_once( dirname( __FILE__ ) . 'hook/extension.php' );
82
-require_once( dirname( __FILE__ ) . 'hook/extension/conditions.php' );
83
-require_once( dirname( __FILE__ ) . 'hook/extension/periods.php' );
84
-require_once( dirname( __FILE__ ) . 'hook/extension/reversei.php' );
85
-require_once( dirname( __FILE__ ) . 'hook/extension/spami.php' );
86
-require_once( dirname( __FILE__ ) . 'hook/firer.php' );
87
-require_once( dirname( __FILE__ ) . 'hook/firer/reverse.php' );
88
-require_once( dirname( __FILE__ ) . 'hook/firer/spam.php' );
89
-require_once( dirname( __FILE__ ) . 'hook/fireri.php' );
90
-require_once( dirname( __FILE__ ) . 'hook/reaction.php' );
91
-require_once( dirname( __FILE__ ) . 'hook/reaction/options.php' );
92
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage.php' );
93
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options.php' );
94
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options/network.php' );
95
-require_once( dirname( __FILE__ ) . 'hook/reaction/storagei.php' );
96
-require_once( dirname( __FILE__ ) . 'hook/reaction/validator.php' );
97
-require_once( dirname( __FILE__ ) . 'hook/reactioni.php' );
98
-require_once( dirname( __FILE__ ) . 'hook/reactor.php' );
99
-require_once( dirname( __FILE__ ) . 'hook/reactor/points.php' );
100
-require_once( dirname( __FILE__ ) . 'hook/reactor/reversei.php' );
101
-require_once( dirname( __FILE__ ) . 'hook/reactor/spami.php' );
102
-require_once( dirname( __FILE__ ) . 'hook/retroactive/conditions.php' );
103
-require_once( dirname( __FILE__ ) . 'hook/retroactive/query.php' );
104
-require_once( dirname( __FILE__ ) . 'hook/retroactive/query/modifieri.php' );
105
-require_once( dirname( __FILE__ ) . 'hook/retroactive/queryable.php' );
106
-require_once( dirname( __FILE__ ) . 'hook/retroactive/queryi.php' );
107
-require_once( dirname( __FILE__ ) . 'hook/router.php' );
108
-require_once( dirname( __FILE__ ) . 'hook/settings.php' );
109
-require_once( dirname( __FILE__ ) . 'hook/settingsi.php' );
110
-require_once( dirname( __FILE__ ) . 'hook/validator/exception.php' );
111
-require_once( dirname( __FILE__ ) . 'hooks.php' );
112
-require_once( dirname( __FILE__ ) . 'query/builder/db/mysql.php' );
113
-require_once( dirname( __FILE__ ) . 'spec.php' );
114
-require_once( dirname( __FILE__ ) . 'specedi.php' );
13
+require_once(dirname(__FILE__).'app.php');
14
+require_once(dirname(__FILE__).'app/registry.php');
15
+require_once(dirname(__FILE__).'class/autoloader.php');
16
+require_once(dirname(__FILE__).'class/registry.php');
17
+require_once(dirname(__FILE__).'class/registry/children.php');
18
+require_once(dirname(__FILE__).'class/registry/childreni.php');
19
+require_once(dirname(__FILE__).'class/registry/persistent.php');
20
+require_once(dirname(__FILE__).'class/registryi.php');
21
+require_once(dirname(__FILE__).'data/type.php');
22
+require_once(dirname(__FILE__).'data/type/integer.php');
23
+require_once(dirname(__FILE__).'data/type/text.php');
24
+require_once(dirname(__FILE__).'data/typei.php');
25
+require_once(dirname(__FILE__).'entity.php');
26
+require_once(dirname(__FILE__).'entity/array.php');
27
+require_once(dirname(__FILE__).'entity/attr.php');
28
+require_once(dirname(__FILE__).'entity/childi.php');
29
+require_once(dirname(__FILE__).'entity/comment.php');
30
+require_once(dirname(__FILE__).'entity/comment/author.php');
31
+require_once(dirname(__FILE__).'entity/comment/post.php');
32
+require_once(dirname(__FILE__).'entity/enumerablei.php');
33
+require_once(dirname(__FILE__).'entity/hierarchy.php');
34
+require_once(dirname(__FILE__).'entity/hierarchyi.php');
35
+require_once(dirname(__FILE__).'entity/parenti.php');
36
+require_once(dirname(__FILE__).'entity/post.php');
37
+require_once(dirname(__FILE__).'entity/post/author.php');
38
+require_once(dirname(__FILE__).'entity/post/content.php');
39
+require_once(dirname(__FILE__).'entity/post/terms.php');
40
+require_once(dirname(__FILE__).'entity/post/type.php');
41
+require_once(dirname(__FILE__).'entity/post/type/name.php');
42
+require_once(dirname(__FILE__).'entity/post/type/relationship.php');
43
+require_once(dirname(__FILE__).'entity/relationship.php');
44
+require_once(dirname(__FILE__).'entity/relationship/dynamic.php');
45
+require_once(dirname(__FILE__).'entity/restricted/visibilityi.php');
46
+require_once(dirname(__FILE__).'entity/site.php');
47
+require_once(dirname(__FILE__).'entity/term.php');
48
+require_once(dirname(__FILE__).'entity/term/id.php');
49
+require_once(dirname(__FILE__).'entity/user.php');
50
+require_once(dirname(__FILE__).'entity/user/role.php');
51
+require_once(dirname(__FILE__).'entity/user/role/name.php');
52
+require_once(dirname(__FILE__).'entity/user/roles.php');
53
+require_once(dirname(__FILE__).'entityish.php');
54
+require_once(dirname(__FILE__).'entityishi.php');
55
+require_once(dirname(__FILE__).'hierarchy.php');
56
+require_once(dirname(__FILE__).'hook/action.php');
57
+require_once(dirname(__FILE__).'hook/action/comment/new.php');
58
+require_once(dirname(__FILE__).'hook/action/post/publish.php');
59
+require_once(dirname(__FILE__).'hook/actioni.php');
60
+require_once(dirname(__FILE__).'hook/actions.php');
61
+require_once(dirname(__FILE__).'hook/arg.php');
62
+require_once(dirname(__FILE__).'hook/arg/current/post.php');
63
+require_once(dirname(__FILE__).'hook/arg/current/site.php');
64
+require_once(dirname(__FILE__).'hook/arg/current/user.php');
65
+require_once(dirname(__FILE__).'hook/arg/dynamic.php');
66
+require_once(dirname(__FILE__).'hook/condition.php');
67
+require_once(dirname(__FILE__).'hook/condition/entity/array/contains.php');
68
+require_once(dirname(__FILE__).'hook/condition/equals.php');
69
+require_once(dirname(__FILE__).'hook/condition/string/contains.php');
70
+require_once(dirname(__FILE__).'hook/conditioni.php');
71
+require_once(dirname(__FILE__).'hook/event.php');
72
+require_once(dirname(__FILE__).'hook/event/args.php');
73
+require_once(dirname(__FILE__).'hook/event/comment/leave.php');
74
+require_once(dirname(__FILE__).'hook/event/dynamic.php');
75
+require_once(dirname(__FILE__).'hook/event/media/upload.php');
76
+require_once(dirname(__FILE__).'hook/event/post/publish.php');
77
+require_once(dirname(__FILE__).'hook/event/user/register.php');
78
+require_once(dirname(__FILE__).'hook/event/user/visit.php');
79
+require_once(dirname(__FILE__).'hook/eventi.php');
80
+require_once(dirname(__FILE__).'hook/events.php');
81
+require_once(dirname(__FILE__).'hook/extension.php');
82
+require_once(dirname(__FILE__).'hook/extension/conditions.php');
83
+require_once(dirname(__FILE__).'hook/extension/periods.php');
84
+require_once(dirname(__FILE__).'hook/extension/reversei.php');
85
+require_once(dirname(__FILE__).'hook/extension/spami.php');
86
+require_once(dirname(__FILE__).'hook/firer.php');
87
+require_once(dirname(__FILE__).'hook/firer/reverse.php');
88
+require_once(dirname(__FILE__).'hook/firer/spam.php');
89
+require_once(dirname(__FILE__).'hook/fireri.php');
90
+require_once(dirname(__FILE__).'hook/reaction.php');
91
+require_once(dirname(__FILE__).'hook/reaction/options.php');
92
+require_once(dirname(__FILE__).'hook/reaction/storage.php');
93
+require_once(dirname(__FILE__).'hook/reaction/storage/options.php');
94
+require_once(dirname(__FILE__).'hook/reaction/storage/options/network.php');
95
+require_once(dirname(__FILE__).'hook/reaction/storagei.php');
96
+require_once(dirname(__FILE__).'hook/reaction/validator.php');
97
+require_once(dirname(__FILE__).'hook/reactioni.php');
98
+require_once(dirname(__FILE__).'hook/reactor.php');
99
+require_once(dirname(__FILE__).'hook/reactor/points.php');
100
+require_once(dirname(__FILE__).'hook/reactor/reversei.php');
101
+require_once(dirname(__FILE__).'hook/reactor/spami.php');
102
+require_once(dirname(__FILE__).'hook/retroactive/conditions.php');
103
+require_once(dirname(__FILE__).'hook/retroactive/query.php');
104
+require_once(dirname(__FILE__).'hook/retroactive/query/modifieri.php');
105
+require_once(dirname(__FILE__).'hook/retroactive/queryable.php');
106
+require_once(dirname(__FILE__).'hook/retroactive/queryi.php');
107
+require_once(dirname(__FILE__).'hook/router.php');
108
+require_once(dirname(__FILE__).'hook/settings.php');
109
+require_once(dirname(__FILE__).'hook/settingsi.php');
110
+require_once(dirname(__FILE__).'hook/validator/exception.php');
111
+require_once(dirname(__FILE__).'hooks.php');
112
+require_once(dirname(__FILE__).'query/builder/db/mysql.php');
113
+require_once(dirname(__FILE__).'spec.php');
114
+require_once(dirname(__FILE__).'specedi.php');
115 115
 // }
116 116
 
117 117
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/app.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 	/**
98 98
 	 * @since 1.0.0
99 99
 	 */
100
-	public function __construct( $slug, $parent = null ) {
100
+	public function __construct($slug, $parent = null) {
101 101
 
102 102
 		$this->slug = $slug;
103 103
 		$this->full_slug = $slug;
104 104
 
105
-		if ( $parent instanceof WordPoints_App ) {
105
+		if ($parent instanceof WordPoints_App) {
106 106
 			$this->parent = $parent;
107 107
 
108
-			if ( 'apps' !== $this->parent->full_slug ) {
109
-				$this->full_slug = $this->parent->full_slug . '-' . $this->full_slug;
108
+			if ('apps' !== $this->parent->full_slug) {
109
+				$this->full_slug = $this->parent->full_slug.'-'.$this->full_slug;
110 110
 			}
111 111
 		}
112 112
 
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 	/**
119 119
 	 * @since 1.0.0
120 120
 	 */
121
-	public function __isset( $var ) {
122
-		return $this->sub_apps->is_registered( $var );
121
+	public function __isset($var) {
122
+		return $this->sub_apps->is_registered($var);
123 123
 	}
124 124
 
125 125
 	/**
126 126
 	 * @since 1.0.0
127 127
 	 */
128
-	public function __get( $var ) {
128
+	public function __get($var) {
129 129
 
130
-		if ( 'sub_apps' === $var ) {
130
+		if ('sub_apps' === $var) {
131 131
 			return $this->$var;
132 132
 		}
133 133
 
134
-		$sub = $this->sub_apps->get( $var, array( $this ) );
134
+		$sub = $this->sub_apps->get($var, array($this));
135 135
 
136
-		if ( ! $sub ) {
136
+		if ( ! $sub) {
137 137
 			return null;
138 138
 		}
139 139
 
140 140
 		if (
141
-			empty( $this->did_init[ $var ] )
141
+			empty($this->did_init[$var])
142 142
 			&& ! self::$main->silent
143
-			&& $this->should_do_registry_init( $sub )
143
+			&& $this->should_do_registry_init($sub)
144 144
 		) {
145 145
 
146
-			$is_protected_property = array_key_exists( $var, get_object_vars( $this ) );
146
+			$is_protected_property = array_key_exists($var, get_object_vars($this));
147 147
 
148 148
 			// When the below action is called it is possible that some hooked code
149 149
 			// may attempt to access the property that is being initialized. However,
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			// temporarily set this as a public property. However, we can't do this
153 153
 			// for properties that the class has declared, because otherwise it would
154 154
 			// be possible to modify and then unset protected class properties.
155
-			if ( ! $is_protected_property ) {
155
+			if ( ! $is_protected_property) {
156 156
 				$this->allow_set = true;
157 157
 				$this->$var = $sub;
158 158
 				$this->allow_set = false;
@@ -168,25 +168,25 @@  discard block
 block discarded – undo
168 168
 			 * @param WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI
169 169
 			 *        $registry The registry object.
170 170
 			 */
171
-			do_action( "wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub );
171
+			do_action("wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub);
172 172
 
173 173
 			// Because this property was public, it's possible that it might have
174 174
 			// been modified inadvertently. If this happens we give a warning.
175
-			if ( $sub !== $this->$var ) {
175
+			if ($sub !== $this->$var) {
176 176
 				_doing_it_wrong(
177 177
 					__METHOD__
178
-					, esc_html( "Do not modify the {$var} property directly." )
178
+					, esc_html("Do not modify the {$var} property directly.")
179 179
 					, '1.0.0'
180 180
 				);
181 181
 			}
182 182
 
183
-			if ( ! $is_protected_property ) {
183
+			if ( ! $is_protected_property) {
184 184
 				$this->allow_set = true;
185
-				unset( $this->$var );
185
+				unset($this->$var);
186 186
 				$this->allow_set = false;
187 187
 			}
188 188
 
189
-			$this->did_init[ $var ] = true;
189
+			$this->did_init[$var] = true;
190 190
 		}
191 191
 
192 192
 		return $sub;
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 	/**
196 196
 	 * @since 1.0.0
197 197
 	 */
198
-	public function __set( $var, $value ) {
198
+	public function __set($var, $value) {
199 199
 
200
-		if ( $this->allow_set ) {
200
+		if ($this->allow_set) {
201 201
 			$this->$var = $value;
202 202
 		} else {
203 203
 			_doing_it_wrong(
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
 	/**
212 212
 	 * @since 1.0.0
213 213
 	 */
214
-	public function __unset( $var ) {
214
+	public function __unset($var) {
215 215
 
216
-		if ( $this->allow_set ) {
217
-			unset( $this->$var );
216
+		if ($this->allow_set) {
217
+			unset($this->$var);
218 218
 		} else {
219 219
 			_doing_it_wrong(
220 220
 				__METHOD__
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 *
234 234
 	 * @return bool Whether to call the init action or not.
235 235
 	 */
236
-	protected function should_do_registry_init( $registry ) {
236
+	protected function should_do_registry_init($registry) {
237 237
 		return (
238 238
 		   $registry instanceof WordPoints_Class_RegistryI
239 239
 		   || $registry instanceof WordPoints_Class_Registry_ChildrenI
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		 *
258 258
 		 * @param WordPoints_App $app The app object.
259 259
 		 */
260
-		do_action( "wordpoints_init_app-{$this->full_slug}", $this );
260
+		do_action("wordpoints_init_app-{$this->full_slug}", $this);
261 261
 	}
262 262
 }
263 263
 
Please login to merge, or discard this patch.
src/admin/includes/functions.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
  *
17 17
  * @param WordPoints_App $app The main WordPoints app.
18 18
  */
19
-function wordpoints_hooks_register_admin_apps( $app ) {
19
+function wordpoints_hooks_register_admin_apps($app) {
20 20
 
21 21
 	$apps = $app->sub_apps;
22 22
 
23
-	$apps->register( 'admin', 'WordPoints_App' );
23
+	$apps->register('admin', 'WordPoints_App');
24 24
 
25 25
 	/** @var WordPoints_App $admin */
26
-	$admin = $apps->get( 'admin' );
26
+	$admin = $apps->get('admin');
27 27
 
28
-	$admin->sub_apps->register( 'screen', 'WordPoints_Admin_Screens' );
28
+	$admin->sub_apps->register('screen', 'WordPoints_Admin_Screens');
29 29
 }
30 30
 
31 31
 /**
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 	// Hooks page.
47 47
 	$id = add_submenu_page(
48 48
 		$wordpoints_menu
49
-		, __( 'WordPoints — Points Types', 'wordpoints' )
50
-		, __( 'Points Types', 'wordpoints' )
49
+		, __('WordPoints — Points Types', 'wordpoints')
50
+		, __('Points Types', 'wordpoints')
51 51
 		, 'manage_options'
52 52
 		, 'wordpoints_points_types'
53
-		, array( $admin_screens, 'display' )
53
+		, array($admin_screens, 'display')
54 54
 	);
55 55
 
56
-	if ( $id ) {
57
-		$admin_screens->register( $id, 'WordPoints_Admin_Screen_Points_Types' );
56
+	if ($id) {
57
+		$admin_screens->register($id, 'WordPoints_Admin_Screen_Points_Types');
58 58
 	}
59 59
 }
60 60
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function wordpoints_hooks_admin_register_scripts() {
69 69
 
70
-	$assets_url = wordpoints_modules_url( '/assets', dirname( __FILE__ ) );
70
+	$assets_url = wordpoints_modules_url('/assets', dirname(__FILE__));
71 71
 
72 72
 	// CSS
73 73
 
74 74
 	wp_register_style(
75 75
 		'wordpoints-hooks-admin'
76
-		, $assets_url . '/css/hooks.css'
77
-		, array( 'dashicons', 'wp-jquery-ui-dialog' )
76
+		, $assets_url.'/css/hooks.css'
77
+		, array('dashicons', 'wp-jquery-ui-dialog')
78 78
 		, WORDPOINTS_VERSION
79 79
 	);
80 80
 
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
 
83 83
 	wp_register_script(
84 84
 		'wordpoints-hooks-models'
85
-		, $assets_url . '/js/hooks/models.js'
86
-		, array( 'backbone', 'jquery-ui-dialog', 'wp-util' )
85
+		, $assets_url.'/js/hooks/models.js'
86
+		, array('backbone', 'jquery-ui-dialog', 'wp-util')
87 87
 		, WORDPOINTS_VERSION
88 88
 	);
89 89
 
90 90
 	wp_register_script(
91 91
 		'wordpoints-hooks-views'
92
-		, $assets_url . '/js/hooks/views.js'
93
-		, array( 'wordpoints-hooks-models' )
92
+		, $assets_url.'/js/hooks/views.js'
93
+		, array('wordpoints-hooks-models')
94 94
 		, WORDPOINTS_VERSION
95 95
 	);
96 96
 
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 		'wordpoints-hooks-views'
99 99
 		, 'WordPointsHooksAdminL10n'
100 100
 		, array(
101
-			'unexpectedError' => __( 'There was an unexpected error. Try reloading the page.', 'wordpoints' ),
102
-			'changesSaved'    => __( 'Your changes have been saved.', 'wordpoints' ),
101
+			'unexpectedError' => __('There was an unexpected error. Try reloading the page.', 'wordpoints'),
102
+			'changesSaved'    => __('Your changes have been saved.', 'wordpoints'),
103 103
 			/* translators: the name of the field that cannot be empty */
104
-			'emptyField'      => sprintf( __( '%s cannot be empty.', 'wordpoints' ), '{{ data.label }}' ),
105
-			'confirmDelete'   => __( 'Are you sure that you want to delete this reaction? This action cannot be undone.', 'wordpoints' ),
106
-			'confirmTitle'    => __( 'Are you sure?', 'wordpoints' ),
107
-			'deleteText'      => __( 'Delete', 'wordpoints' ),
108
-			'cancelText'      => __( 'Cancel', 'wordpoints' ),
109
-			'separator'       => __( ' » ', 'wordpoints' ),
104
+			'emptyField'      => sprintf(__('%s cannot be empty.', 'wordpoints'), '{{ data.label }}'),
105
+			'confirmDelete'   => __('Are you sure that you want to delete this reaction? This action cannot be undone.', 'wordpoints'),
106
+			'confirmTitle'    => __('Are you sure?', 'wordpoints'),
107
+			'deleteText'      => __('Delete', 'wordpoints'),
108
+			'cancelText'      => __('Cancel', 'wordpoints'),
109
+			'separator'       => __(' » ', 'wordpoints'),
110 110
 		)
111 111
 	);
112 112
 
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 			<div class="view">
119 119
 				<div class="title"></div>
120 120
 				<button type="button" class="edit button-secondary">
121
-					' . esc_html__( 'Edit', 'wordpoints' ) . '
121
+					' . esc_html__('Edit', 'wordpoints').'
122 122
 				</button>
123 123
 				<button type="button" class="close button-secondary">
124
-					' . esc_html__( 'Close', 'wordpoints' ) . '
124
+					' . esc_html__('Close', 'wordpoints').'
125 125
 				</button>
126 126
 			</div>
127 127
 			<div class="form">
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
 						</div>
141 141
 						<div class="action-buttons">
142 142
 							<button type="button" class="save button-primary" disabled>
143
-								' . esc_html__( 'Save', 'wordpoints' ) . '
143
+								' . esc_html__('Save', 'wordpoints').'
144 144
 							</button>
145 145
 							<button type="button" class="cancel button-secondary">
146
-								' . esc_html__( 'Cancel', 'wordpoints' ) . '
146
+								' . esc_html__('Cancel', 'wordpoints').'
147 147
 							</button>
148 148
 							<button type="button" class="close button-secondary">
149
-								' . esc_html__( 'Close', 'wordpoints' ) . '
149
+								' . esc_html__('Close', 'wordpoints').'
150 150
 							</button>
151 151
 							<button type="button" class="delete button-secondary">
152
-								' . esc_html__( 'Delete', 'wordpoints' ) . '
152
+								' . esc_html__('Delete', 'wordpoints').'
153 153
 							</button>
154 154
 						</div>
155 155
 					</div>
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
 
198 198
 	wp_register_script(
199 199
 		'wordpoints-hooks-reactor-points'
200
-		, $assets_url . '/js/hooks/reactors/points.js'
201
-		, array( 'wordpoints-hooks-views' )
200
+		, $assets_url.'/js/hooks/reactors/points.js'
201
+		, array('wordpoints-hooks-views')
202 202
 		, WORDPOINTS_VERSION
203 203
 	);
204 204
 
205 205
 	wp_register_script(
206 206
 		'wordpoints-hooks-extension-conditions'
207
-		, $assets_url . '/js/hooks/extensions/conditions.js'
208
-		, array( 'wordpoints-hooks-views' )
207
+		, $assets_url.'/js/hooks/extensions/conditions.js'
208
+		, array('wordpoints-hooks-views')
209 209
 		, WORDPOINTS_VERSION
210 210
 	);
211 211
 
@@ -215,25 +215,25 @@  discard block
 block discarded – undo
215 215
 		, '
216 216
 			<script type="text/template" id="tmpl-wordpoints-hook-condition-groups">
217 217
 				<div class="conditions-title">
218
-					<h4>' . esc_html__( 'Conditions', 'wordpoints' ) . '</h4>
218
+					<h4>' . esc_html__('Conditions', 'wordpoints').'</h4>
219 219
 					<button type="button" class="add-new button-secondary button-link">
220
-						<span class="screen-reader-text">' . esc_html__( 'Add New Condition', 'wordpoints' ) . '</span>
220
+						<span class="screen-reader-text">' . esc_html__('Add New Condition', 'wordpoints').'</span>
221 221
 						<span class="dashicons dashicons-plus"></span>
222 222
 					</button>
223 223
 				</div>
224 224
 				<div class="add-condition-form hidden">
225 225
 					<div class="no-conditions hidden">
226
-						' . esc_html__( 'No conditions available.', 'wordpoints' ) . '
226
+						' . esc_html__('No conditions available.', 'wordpoints').'
227 227
 					</div>
228 228
 					<div class="condition-selectors">
229 229
 						<div class="arg-selectors"></div>
230 230
 						<div class="condition-selector"></div>
231 231
 					</div>
232
-					<button type="button" class="confirm-add-new button-secondary" disabled aria-label="' . esc_attr__( 'Add Condition', 'wordpoints' ) . '">
233
-						' . esc_html_x( 'Add', 'reaction condition', 'wordpoints' ) . '
232
+					<button type="button" class="confirm-add-new button-secondary" disabled aria-label="' . esc_attr__('Add Condition', 'wordpoints').'">
233
+						' . esc_html_x('Add', 'reaction condition', 'wordpoints').'
234 234
 					</button>
235
-					<button type="button" class="cancel-add-new button-secondary" aria-label="' . esc_attr__( 'Cancel Adding New Condition', 'wordpoints' ) . '">
236
-						' . esc_html_x( 'Cancel', 'reaction condition', 'wordpoints' ) . '
235
+					<button type="button" class="cancel-add-new button-secondary" aria-label="' . esc_attr__('Cancel Adding New Condition', 'wordpoints').'">
236
+						' . esc_html_x('Cancel', 'reaction condition', 'wordpoints').'
237 237
 					</button>
238 238
 				</div>
239 239
 				<div class="condition-groups"></div>
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 				<div class="condition-controls">
248 248
 					<div class="condition-title"></div>
249 249
 					<button type="button" class="delete button-secondary button-link">
250
-						<span class="screen-reader-text">' . esc_html__( 'Remove Condition', 'wordpoints' ) . '</span>
250
+						<span class="screen-reader-text">' . esc_html__('Remove Condition', 'wordpoints').'</span>
251 251
 						<span class="dashicons dashicons-no"></span>
252 252
 					</button>
253 253
 				</div>
@@ -275,32 +275,32 @@  discard block
 block discarded – undo
275 275
 
276 276
 	$extensions_data = array();
277 277
 
278
-	foreach ( $hooks->extensions->get_all() as $slug => $extension ) {
278
+	foreach ($hooks->extensions->get_all() as $slug => $extension) {
279 279
 
280
-		if ( $extension instanceof WordPoints_Hook_Extension ) {
281
-			$extensions_data[ $slug ] = $extension->get_ui_script_data();
280
+		if ($extension instanceof WordPoints_Hook_Extension) {
281
+			$extensions_data[$slug] = $extension->get_ui_script_data();
282 282
 		}
283 283
 
284
-		if ( wp_script_is( "wordpoints-hooks-extension-{$slug}", 'registered' ) ) {
285
-			wp_enqueue_script( "wordpoints-hooks-extension-{$slug}" );
284
+		if (wp_script_is("wordpoints-hooks-extension-{$slug}", 'registered')) {
285
+			wp_enqueue_script("wordpoints-hooks-extension-{$slug}");
286 286
 		}
287 287
 	}
288 288
 
289 289
 	$reactor_data = array();
290 290
 
291
-	foreach ( $hooks->reactors->get_all() as $slug => $reactor ) {
291
+	foreach ($hooks->reactors->get_all() as $slug => $reactor) {
292 292
 
293
-		if ( $reactor instanceof WordPoints_Hook_Reactor ) {
294
-			$reactor_data[ $slug ] = array(
293
+		if ($reactor instanceof WordPoints_Hook_Reactor) {
294
+			$reactor_data[$slug] = array(
295 295
 				'slug'         => $reactor->get_slug(),
296 296
 				'fields'       => $reactor->get_settings_fields(),
297 297
 				'arg_types'    => $reactor->get_arg_types(),
298
-				'target_label' => __( 'Award To', 'wordpoints' ),
298
+				'target_label' => __('Award To', 'wordpoints'),
299 299
 			);
300 300
 		}
301 301
 
302
-		if ( wp_script_is( "wordpoints-hooks-reactor-{$slug}", 'registered' ) ) {
303
-			wp_enqueue_script( "wordpoints-hooks-reactor-{$slug}" );
302
+		if (wp_script_is("wordpoints-hooks-reactor-{$slug}", 'registered')) {
303
+			wp_enqueue_script("wordpoints-hooks-reactor-{$slug}");
304 304
 		}
305 305
 	}
306 306
 
@@ -312,28 +312,28 @@  discard block
 block discarded – undo
312 312
 	$entity_children = $entities->children;
313 313
 
314 314
 	/** @var WordPoints_Entity $entity */
315
-	foreach ( $entities->get_all() as $slug => $entity ) {
315
+	foreach ($entities->get_all() as $slug => $entity) {
316 316
 
317 317
 		$child_data = array();
318 318
 
319 319
 		/** @var WordPoints_EntityishI $child */
320
-		foreach ( $entity_children->get_children( $slug ) as $child_slug => $child ) {
320
+		foreach ($entity_children->get_children($slug) as $child_slug => $child) {
321 321
 
322
-			$child_data[ $child_slug ] = array(
322
+			$child_data[$child_slug] = array(
323 323
 				'slug'  => $child_slug,
324 324
 				'title' => $child->get_title(),
325 325
 			);
326 326
 
327
-			if ( $child instanceof WordPoints_Entity_Attr ) {
327
+			if ($child instanceof WordPoints_Entity_Attr) {
328 328
 
329
-				$child_data[ $child_slug ]['_type'] = 'attr';
330
-				$child_data[ $child_slug ]['data_type']  = $child->get_data_type();
329
+				$child_data[$child_slug]['_type'] = 'attr';
330
+				$child_data[$child_slug]['data_type'] = $child->get_data_type();
331 331
 
332
-			} elseif ( $child instanceof WordPoints_Entity_Relationship ) {
332
+			} elseif ($child instanceof WordPoints_Entity_Relationship) {
333 333
 
334
-				$child_data[ $child_slug ]['_type']     = 'relationship';
335
-				$child_data[ $child_slug ]['primary']   = $child->get_primary_entity_slug();
336
-				$child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug();
334
+				$child_data[$child_slug]['_type']     = 'relationship';
335
+				$child_data[$child_slug]['primary']   = $child->get_primary_entity_slug();
336
+				$child_data[$child_slug]['secondary'] = $child->get_related_entity_slug();
337 337
 			}
338 338
 
339 339
 			/**
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
 			 * @param array                $data  The data for the entity child.
345 345
 			 * @param WordPoints_Entityish $child The child's object.
346 346
 			 */
347
-			$child_data[ $child_slug ] = apply_filters( 'wordpoints_hooks_ui_data_entity_child', $child_data[ $child_slug ], $child );
347
+			$child_data[$child_slug] = apply_filters('wordpoints_hooks_ui_data_entity_child', $child_data[$child_slug], $child);
348 348
 		}
349 349
 
350
-		$entities_data[ $slug ] = array(
350
+		$entities_data[$slug] = array(
351 351
 			'slug'     => $slug,
352 352
 			'title'    => $entity->get_title(),
353 353
 			'children' => $child_data,
@@ -355,12 +355,12 @@  discard block
 block discarded – undo
355 355
 			'_type'    => 'entity',
356 356
 		);
357 357
 
358
-		if ( $entity instanceof WordPoints_Entity_EnumerableI ) {
358
+		if ($entity instanceof WordPoints_Entity_EnumerableI) {
359 359
 
360 360
 			$values = array();
361 361
 
362
-			foreach ( $entity->get_enumerated_values() as $value ) {
363
-				if ( $entity->set_the_value( $value ) ) {
362
+			foreach ($entity->get_enumerated_values() as $value) {
363
+				if ($entity->set_the_value($value)) {
364 364
 					$values[] = array(
365 365
 						'value' => $entity->get_the_id(),
366 366
 						'label' => $entity->get_the_human_id(),
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 				}
369 369
 			}
370 370
 
371
-			$entities_data[ $slug ]['values'] = $values;
371
+			$entities_data[$slug]['values'] = $values;
372 372
 		}
373 373
 
374 374
 		/**
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		 * @param array             $data   The data for the entity.
378 378
 		 * @param WordPoints_Entity $entity The entity object.
379 379
 		 */
380
-		$entities_data[ $slug ] = apply_filters( 'wordpoints_hooks_ui_data_entity', $entities_data[ $slug ], $entity );
380
+		$entities_data[$slug] = apply_filters('wordpoints_hooks_ui_data_entity', $entities_data[$slug], $entity);
381 381
 	}
382 382
 
383 383
 	$data = array(
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	 *
399 399
 	 * @param array $data The data.
400 400
 	 */
401
-	$data = apply_filters( 'wordpoints_hooks_ui_data', $data );
401
+	$data = apply_filters('wordpoints_hooks_ui_data', $data);
402 402
 
403 403
 	wp_localize_script(
404 404
 		'wordpoints-hooks-models'
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
  *
424 424
  * @return string The HTML with templates appended.
425 425
  */
426
-function wordpoints_script_templates_filter( $html, $handle ) {
426
+function wordpoints_script_templates_filter($html, $handle) {
427 427
 
428 428
 	global $wp_scripts;
429 429
 
430
-	$templates = $wp_scripts->get_data( $handle, 'wordpoints-templates' );
430
+	$templates = $wp_scripts->get_data($handle, 'wordpoints-templates');
431 431
 
432
-	if ( $templates ) {
432
+	if ($templates) {
433 433
 		$html .= $templates;
434 434
 	}
435 435
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
  */
446 446
 function wordpoints_hooks_admin_ajax() {
447 447
 
448
-	if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
448
+	if (defined('DOING_AJAX') && DOING_AJAX) {
449 449
 		new WordPoints_Admin_Ajax_Hooks;
450 450
 	}
451 451
 }
Please login to merge, or discard this patch.
src/admin/includes/classes/screen/points/types.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @since 1.0.0
57 57
 	 */
58 58
 	protected function get_title() {
59
-		return _x( 'Points Types', 'page title', 'wordpoints' );
59
+		return _x('Points Types', 'page title', 'wordpoints');
60 60
 	}
61 61
 
62 62
 	/**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
 		parent::hooks();
68 68
 
69
-		add_action( 'add_meta_boxes', array( $this, 'add_points_settings_meta_box' ) );
70
-		add_action( 'add_meta_boxes', array( $this, 'add_event_meta_boxes' ) );
69
+		add_action('add_meta_boxes', array($this, 'add_points_settings_meta_box'));
70
+		add_action('add_meta_boxes', array($this, 'add_event_meta_boxes'));
71 71
 	}
72 72
 
73 73
 	/**
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function enqueue_scripts() {
77 77
 
78
-		wp_enqueue_style( 'wordpoints-hooks-admin' );
78
+		wp_enqueue_style('wordpoints-hooks-admin');
79 79
 
80
-		wp_enqueue_script( 'postbox' );
80
+		wp_enqueue_script('postbox');
81 81
 
82 82
 		wordpoints_hooks_ui_setup_script_data();
83 83
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 					.addClass( 'closed' );
98 98
 
99 99
 				postboxes.add_postbox_toggles(
100
-					<?php echo wp_json_encode( $this->id ); ?>
100
+					<?php echo wp_json_encode($this->id); ?>
101 101
 				);
102 102
 			} );
103 103
 		</script>
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function add_points_settings_meta_box() {
114 114
 
115
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
115
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
116 116
 			return;
117 117
 		}
118 118
 
119 119
 		add_meta_box(
120 120
 			'settings'
121
-			, __( 'Settings', 'wordpoints' )
122
-			, array( $this, 'display_points_settings_meta_box' )
121
+			, __('Settings', 'wordpoints')
122
+			, array($this, 'display_points_settings_meta_box')
123 123
 			, $this->id
124 124
 			, 'side'
125 125
 			, 'default'
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	public function display_points_settings_meta_box() {
135 135
 
136
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
136
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
137 137
 			return;
138 138
 		}
139 139
 
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
 
142 142
 		$add_new = 0;
143 143
 
144
-		$points_type = wordpoints_get_points_type( $slug );
144
+		$points_type = wordpoints_get_points_type($slug);
145 145
 
146
-		if ( ! $points_type ) {
146
+		if ( ! $points_type) {
147 147
 
148 148
 			$points_type = array();
149
-			$add_new     = wp_create_nonce( 'wordpoints_add_new_points_type' );
149
+			$add_new     = wp_create_nonce('wordpoints_add_new_points_type');
150 150
 		}
151 151
 
152 152
 		$points_type = array_merge(
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 		?>
162 162
 
163 163
 		<form method="post">
164
-			<?php if ( $slug ) : ?>
164
+			<?php if ($slug) : ?>
165 165
 				<p>
166 166
 					<span class="wordpoints-points-slug">
167 167
 						<em>
168
-							<?php echo esc_html( sprintf( __( 'Slug: %s', 'wordpoints' ), $slug ) ); ?>
168
+							<?php echo esc_html(sprintf(__('Slug: %s', 'wordpoints'), $slug)); ?>
169 169
 						</em>
170 170
 					</span>
171 171
 				</p>
172
-				<?php wp_nonce_field( "wordpoints_update_points_type-$slug", 'update_points_type' ); ?>
172
+				<?php wp_nonce_field("wordpoints_update_points_type-$slug", 'update_points_type'); ?>
173 173
 			<?php endif; ?>
174 174
 
175 175
 			<?php
@@ -183,45 +183,45 @@  discard block
 block discarded – undo
183 183
 			 *
184 184
 			 * @param string $points_type The slug of the points type.
185 185
 			 */
186
-			do_action( 'wordpoints_points_type_form_top', $slug );
186
+			do_action('wordpoints_points_type_form_top', $slug);
187 187
 
188
-			if ( $add_new ) {
188
+			if ($add_new) {
189 189
 
190 190
 				// Mark the prefix and suffix optional on the add new form.
191
-				$prefix = _x( 'Prefix (optional):', 'points type', 'wordpoints' );
192
-				$suffix = _x( 'Suffix (optional):', 'points type', 'wordpoints' );
191
+				$prefix = _x('Prefix (optional):', 'points type', 'wordpoints');
192
+				$suffix = _x('Suffix (optional):', 'points type', 'wordpoints');
193 193
 
194 194
 			} else {
195 195
 
196
-				$prefix = _x( 'Prefix:', 'points type', 'wordpoints' );
197
-				$suffix = _x( 'Suffix:', 'points type', 'wordpoints' );
196
+				$prefix = _x('Prefix:', 'points type', 'wordpoints');
197
+				$suffix = _x('Suffix:', 'points type', 'wordpoints');
198 198
 			}
199 199
 
200 200
 			?>
201 201
 
202 202
 			<p>
203 203
 				<label
204
-					for="points-name-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html_x( 'Name:', 'points type', 'wordpoints' ); ?></label>
204
+					for="points-name-<?php echo esc_attr($slug); ?>"><?php echo esc_html_x('Name:', 'points type', 'wordpoints'); ?></label>
205 205
 				<input class="widefat" type="text"
206
-				       id="points-name-<?php echo esc_attr( $slug ); ?>"
206
+				       id="points-name-<?php echo esc_attr($slug); ?>"
207 207
 				       name="points-name"
208
-				       value="<?php echo esc_attr( $points_type['name'] ); ?>"/>
208
+				       value="<?php echo esc_attr($points_type['name']); ?>"/>
209 209
 			</p>
210 210
 			<p>
211 211
 				<label
212
-					for="points-prefix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $prefix ); ?></label>
212
+					for="points-prefix-<?php echo esc_attr($slug); ?>"><?php echo esc_html($prefix); ?></label>
213 213
 				<input class="widefat" type="text"
214
-				       id="points-prefix-<?php echo esc_attr( $slug ); ?>"
214
+				       id="points-prefix-<?php echo esc_attr($slug); ?>"
215 215
 				       name="points-prefix"
216
-				       value="<?php echo esc_attr( $points_type['prefix'] ); ?>"/>
216
+				       value="<?php echo esc_attr($points_type['prefix']); ?>"/>
217 217
 			</p>
218 218
 			<p>
219 219
 				<label
220
-					for="points-suffix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $suffix ); ?></label>
220
+					for="points-suffix-<?php echo esc_attr($slug); ?>"><?php echo esc_html($suffix); ?></label>
221 221
 				<input class="widefat" type="text"
222
-				       id="points-suffix-<?php echo esc_attr( $slug ); ?>"
222
+				       id="points-suffix-<?php echo esc_attr($slug); ?>"
223 223
 				       name="points-suffix"
224
-				       value="<?php echo esc_attr( $points_type['suffix'] ); ?>"/>
224
+				       value="<?php echo esc_attr($points_type['suffix']); ?>"/>
225 225
 			</p>
226 226
 
227 227
 			<?php
@@ -235,28 +235,28 @@  discard block
 block discarded – undo
235 235
 			 *
236 236
 			 * @param string $points_type The slug of the points type.
237 237
 			 */
238
-			do_action( 'wordpoints_points_type_form_bottom', $slug );
238
+			do_action('wordpoints_points_type_form_bottom', $slug);
239 239
 
240 240
 			?>
241 241
 
242 242
 			<input type="hidden" name="points-slug"
243
-			       value="<?php echo esc_attr( $slug ); ?>"/>
243
+			       value="<?php echo esc_attr($slug); ?>"/>
244 244
 			<input type="hidden" name="add_new" class="add_new"
245
-			       value="<?php echo esc_attr( $add_new ); ?>"/>
245
+			       value="<?php echo esc_attr($add_new); ?>"/>
246 246
 
247 247
 			<div class="hook-control-actions">
248 248
 				<div class="alignleft">
249 249
 					<?php
250 250
 
251
-					if ( ! $add_new ) {
252
-						wp_nonce_field( "wordpoints_delete_points_type-{$slug}", 'delete-points-type-nonce' );
253
-						submit_button( _x( 'Delete', 'points type', 'wordpoints' ), 'delete', 'delete-points-type', false, array( 'id' => "delete_points_type-{$slug}" ) );
251
+					if ( ! $add_new) {
252
+						wp_nonce_field("wordpoints_delete_points_type-{$slug}", 'delete-points-type-nonce');
253
+						submit_button(_x('Delete', 'points type', 'wordpoints'), 'delete', 'delete-points-type', false, array('id' => "delete_points_type-{$slug}"));
254 254
 					}
255 255
 
256 256
 					?>
257 257
 				</div>
258 258
 				<div class="alignright">
259
-					<?php submit_button( _x( 'Save', 'points type', 'wordpoints' ), 'button-primary hook-control-save right', 'save-points-type', false, array( 'id' => "points-{$slug}-save" ) ); ?>
259
+					<?php submit_button(_x('Save', 'points type', 'wordpoints'), 'button-primary hook-control-save right', 'save-points-type', false, array('id' => "points-{$slug}-save")); ?>
260 260
 					<span class="spinner"></span>
261 261
 				</div>
262 262
 				<br class="clear"/>
@@ -273,17 +273,17 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	public function add_event_meta_boxes() {
275 275
 
276
-		if ( ! $this->current_points_type ) {
276
+		if ( ! $this->current_points_type) {
277 277
 			return;
278 278
 		}
279 279
 
280 280
 		/** @var WordPoints_Hook_EventI $event */
281
-		foreach ( $this->hooks->events->get_all() as $slug => $event ) {
281
+		foreach ($this->hooks->events->get_all() as $slug => $event) {
282 282
 
283 283
 			add_meta_box(
284 284
 				"{$this->current_points_type}-{$slug}"
285 285
 				, $event->get_title()
286
-				, array( $this, 'display_event_meta_box' )
286
+				, array($this, 'display_event_meta_box')
287 287
 				, $this->id
288 288
 				, 'events'
289 289
 				, 'default'
@@ -304,54 +304,54 @@  discard block
 block discarded – undo
304 304
 	 * @param array $points_type The points type this meta-box relates to.
305 305
 	 * @param array $meta_box    The data the meta-box was created with.
306 306
 	 */
307
-	public function display_event_meta_box( $points_type, $meta_box ) {
307
+	public function display_event_meta_box($points_type, $meta_box) {
308 308
 
309 309
 		$event_slug = $meta_box['args']['slug'];
310 310
 
311 311
 		/** @var WordPoints_Hook_Reactor $points_reactor */
312
-		$points_reactor = $this->hooks->reactors->get( 'points' );
312
+		$points_reactor = $this->hooks->reactors->get('points');
313 313
 
314 314
 		$data = array();
315 315
 
316
-		foreach ( $points_reactor->reactions->get_reactions_to_event( $event_slug ) as $id => $reaction ) {
317
-			if ( $reaction->get_meta( 'points_type' ) === $this->current_points_type ) {
316
+		foreach ($points_reactor->reactions->get_reactions_to_event($event_slug) as $id => $reaction) {
317
+			if ($reaction->get_meta('points_type') === $this->current_points_type) {
318 318
 				$data[] = WordPoints_Admin_Ajax_Hooks::prepare_hook_reaction(
319 319
 					$reaction
320 320
 				);
321 321
 			}
322 322
 		}
323 323
 
324
-		$args = $this->hooks->events->args->get_children( $event_slug );
324
+		$args = $this->hooks->events->args->get_children($event_slug);
325 325
 
326
-		$event_data = array( 'args' => array() );
326
+		$event_data = array('args' => array());
327 327
 
328
-		foreach ( $args as $slug => $arg ) {
328
+		foreach ($args as $slug => $arg) {
329 329
 
330
-			$event_data['args'][ $slug ] = array(
330
+			$event_data['args'][$slug] = array(
331 331
 				'slug' => $slug,
332 332
 			);
333 333
 
334
-			if ( $arg instanceof WordPoints_Hook_Arg ) {
335
-				$event_data['args'][ $slug ]['title'] = $arg->get_title();
334
+			if ($arg instanceof WordPoints_Hook_Arg) {
335
+				$event_data['args'][$slug]['title'] = $arg->get_title();
336 336
 			}
337 337
 		}
338 338
 
339 339
 		?>
340 340
 
341 341
 		<script>
342
-			WordPointsHooksAdminData.events[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $event_data ); ?>;
343
-			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $data ); ?>;
342
+			WordPointsHooksAdminData.events[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($event_data); ?>;
343
+			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($data); ?>;
344 344
 		</script>
345 345
 
346 346
 		<div class="wordpoints-hook-reaction-group-container">
347 347
 			<p class="description">
348
-				<?php echo esc_html( $meta_box['args']['event']->get_description() ); ?>
348
+				<?php echo esc_html($meta_box['args']['event']->get_description()); ?>
349 349
 			</p>
350 350
 
351 351
 			<div class="wordpoints-hook-reaction-group"
352
-				data-wordpoints-hooks-hook-event="<?php echo esc_attr( $event_slug ); ?>"
353
-				data-wordpoints-hooks-points-type="<?php echo esc_attr( $this->current_points_type ); ?>"
354
-				data-wordpoints-hooks-create-nonce="<?php echo esc_attr( wp_create_nonce( 'wordpoints_create_hook_reaction|points' ) ); ?>"
352
+				data-wordpoints-hooks-hook-event="<?php echo esc_attr($event_slug); ?>"
353
+				data-wordpoints-hooks-points-type="<?php echo esc_attr($this->current_points_type); ?>"
354
+				data-wordpoints-hooks-create-nonce="<?php echo esc_attr(wp_create_nonce('wordpoints_create_hook_reaction|points')); ?>"
355 355
 				data-wordpoints-hooks-reactor="points">
356 356
 			</div>
357 357
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
 			<div class="controls">
367 367
 				<button type="button" class="button-primary add-reaction">
368
-					<?php esc_html_e( 'Add New', 'wordpoints' ); ?>
368
+					<?php esc_html_e('Add New', 'wordpoints'); ?>
369 369
 				</button>
370 370
 			</div>
371 371
 		</div>
@@ -385,19 +385,19 @@  discard block
 block discarded – undo
385 385
 		// Show a tab for each points type.
386 386
 		$tabs = array();
387 387
 
388
-		foreach ( $points_types as $slug => $settings ) {
389
-			$tabs[ $slug ] = $settings['name'];
388
+		foreach ($points_types as $slug => $settings) {
389
+			$tabs[$slug] = $settings['name'];
390 390
 		}
391 391
 
392
-		$tabs['add-new'] = __( 'Add New', 'wordpoints' );
392
+		$tabs['add-new'] = __('Add New', 'wordpoints');
393 393
 
394
-		$tab = wordpoints_admin_get_current_tab( $tabs );
394
+		$tab = wordpoints_admin_get_current_tab($tabs);
395 395
 
396
-		if ( 'add-new' !== $tab ) {
396
+		if ('add-new' !== $tab) {
397 397
 			$this->current_points_type = $tab;
398 398
 		}
399 399
 
400
-		do_action( 'add_meta_boxes', $this->id );
400
+		do_action('add_meta_boxes', $this->id);
401 401
 
402 402
 		$this->tabs = $tabs;
403 403
 	}
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 	 */
410 410
 	public function save_points_type() {
411 411
 
412
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
412
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
413 413
 			return;
414 414
 		}
415 415
 
@@ -424,43 +424,43 @@  discard block
 block discarded – undo
424 424
 
425 425
 			$settings = array();
426 426
 
427
-			$settings['name']   = trim( sanitize_text_field( wp_unslash( $_POST['points-name'] ) ) ); // WPCS: CSRF OK
428
-			$settings['prefix'] = ltrim( sanitize_text_field( wp_unslash( $_POST['points-prefix'] ) ) ); // WPCS: CSRF OK
429
-			$settings['suffix'] = rtrim( sanitize_text_field( wp_unslash( $_POST['points-suffix'] ) ) ); // WPCS: CSRF OK
427
+			$settings['name']   = trim(sanitize_text_field(wp_unslash($_POST['points-name']))); // WPCS: CSRF OK
428
+			$settings['prefix'] = ltrim(sanitize_text_field(wp_unslash($_POST['points-prefix']))); // WPCS: CSRF OK
429
+			$settings['suffix'] = rtrim(sanitize_text_field(wp_unslash($_POST['points-suffix']))); // WPCS: CSRF OK
430 430
 
431 431
 			if (
432
-				isset( $_POST['points-slug'] )
433
-				&& wordpoints_verify_nonce( 'update_points_type', 'wordpoints_update_points_type-%s', array( 'points-slug' ), 'post' )
432
+				isset($_POST['points-slug'])
433
+				&& wordpoints_verify_nonce('update_points_type', 'wordpoints_update_points_type-%s', array('points-slug'), 'post')
434 434
 			) {
435 435
 
436 436
 				// - We are updating an existing points type.
437 437
 
438
-				$points_type = sanitize_key( $_POST['points-slug'] );
438
+				$points_type = sanitize_key($_POST['points-slug']);
439 439
 
440
-				$old_settings = wordpoints_get_points_type( $points_type );
440
+				$old_settings = wordpoints_get_points_type($points_type);
441 441
 
442
-				if ( false === $old_settings ) {
442
+				if (false === $old_settings) {
443 443
 
444 444
 					add_settings_error(
445 445
 						''
446 446
 						, 'wordpoints_points_type_update'
447
-						, __( 'Error: failed updating points type.', 'wordpoints' )
447
+						, __('Error: failed updating points type.', 'wordpoints')
448 448
 						, 'updated'
449 449
 					);
450 450
 
451 451
 					return;
452 452
 				}
453 453
 
454
-				if ( is_array( $old_settings ) ) {
455
-					$settings = array_merge( $old_settings, $settings );
454
+				if (is_array($old_settings)) {
455
+					$settings = array_merge($old_settings, $settings);
456 456
 				}
457 457
 
458
-				if ( ! wordpoints_update_points_type( $points_type, $settings ) ) {
458
+				if ( ! wordpoints_update_points_type($points_type, $settings)) {
459 459
 
460 460
 					add_settings_error(
461 461
 						''
462 462
 						, 'wordpoints_points_type_update'
463
-						, __( 'Error: failed updating points type.', 'wordpoints' )
463
+						, __('Error: failed updating points type.', 'wordpoints')
464 464
 						, 'updated'
465 465
 					);
466 466
 
@@ -469,23 +469,23 @@  discard block
 block discarded – undo
469 469
 					add_settings_error(
470 470
 						''
471 471
 						, 'wordpoints_points_type_update'
472
-						, __( 'Points type updated.', 'wordpoints' )
472
+						, __('Points type updated.', 'wordpoints')
473 473
 						, 'updated'
474 474
 					);
475 475
 				}
476 476
 
477
-			} elseif ( wordpoints_verify_nonce( 'add_new', 'wordpoints_add_new_points_type', null, 'post' ) ) {
477
+			} elseif (wordpoints_verify_nonce('add_new', 'wordpoints_add_new_points_type', null, 'post')) {
478 478
 
479 479
 				// - We are creating a new points type.
480 480
 
481
-				$slug = wordpoints_add_points_type( $settings );
481
+				$slug = wordpoints_add_points_type($settings);
482 482
 
483
-				if ( ! $slug ) {
483
+				if ( ! $slug) {
484 484
 
485 485
 					add_settings_error(
486 486
 						''
487 487
 						, 'wordpoints_points_type_create'
488
-						, __( 'Please choose a unique name for this points type.', 'wordpoints' )
488
+						, __('Please choose a unique name for this points type.', 'wordpoints')
489 489
 					);
490 490
 
491 491
 				} else {
@@ -495,26 +495,26 @@  discard block
 block discarded – undo
495 495
 					add_settings_error(
496 496
 						''
497 497
 						, 'wordpoints_points_type_create'
498
-						, __( 'Points type created.', 'wordpoints' )
498
+						, __('Points type created.', 'wordpoints')
499 499
 						, 'updated'
500 500
 					);
501 501
 				}
502 502
 			}
503 503
 
504 504
 		} elseif (
505
-			! empty( $_POST['delete-points-type'] )
506
-			&& isset( $_POST['points-slug'] )
507
-			&& wordpoints_verify_nonce( 'delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array( 'points-slug' ), 'post' )
505
+			! empty($_POST['delete-points-type'])
506
+			&& isset($_POST['points-slug'])
507
+			&& wordpoints_verify_nonce('delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array('points-slug'), 'post')
508 508
 		) {
509 509
 
510 510
 			// - We are deleting a points type.
511 511
 
512
-			if ( wordpoints_delete_points_type( sanitize_key( $_POST['points-slug'] ) ) ) {
512
+			if (wordpoints_delete_points_type(sanitize_key($_POST['points-slug']))) {
513 513
 
514 514
 				add_settings_error(
515 515
 					''
516 516
 					, 'wordpoints_points_type_delete'
517
-					, __( 'Points type deleted.', 'wordpoints' )
517
+					, __('Points type deleted.', 'wordpoints')
518 518
 					, 'updated'
519 519
 				);
520 520
 
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 				add_settings_error(
524 524
 					''
525 525
 					, 'wordpoints_points_type_delete'
526
-					, __( 'Error while deleting.', 'wordpoints' )
526
+					, __('Error while deleting.', 'wordpoints')
527 527
 				);
528 528
 			}
529 529
 		}
@@ -539,25 +539,25 @@  discard block
 block discarded – undo
539 539
 		 *
540 540
 		 * @since 1.0.0
541 541
 		 */
542
-		do_action( 'wordpoints_admin_points_events_head' );
542
+		do_action('wordpoints_admin_points_events_head');
543 543
 
544
-		if ( is_network_admin() ) {
545
-			$title = __( 'Network Events', 'wordpoints' );
546
-			$description = __( 'Award points when various events happen on this network.', 'wordpoints' );
544
+		if (is_network_admin()) {
545
+			$title = __('Network Events', 'wordpoints');
546
+			$description = __('Award points when various events happen on this network.', 'wordpoints');
547 547
 		} else {
548
-			$title = __( 'Events', 'wordpoints' );
549
-			$description = __( 'Award points when various events happen on this site.', 'wordpoints' );
548
+			$title = __('Events', 'wordpoints');
549
+			$description = __('Award points when various events happen on this site.', 'wordpoints');
550 550
 		}
551 551
 
552
-		$points_type = wordpoints_get_points_type( $this->current_points_type );
552
+		$points_type = wordpoints_get_points_type($this->current_points_type);
553 553
 
554 554
 		?>
555 555
 
556 556
 		<div class="wordpoints-points-type-meta-box-wrap">
557 557
 
558 558
 				<form>
559
-					<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
560
-					<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
559
+					<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
560
+					<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
561 561
 				</form>
562 562
 
563 563
 				<div id="poststuff">
@@ -565,17 +565,17 @@  discard block
 block discarded – undo
565 565
 					<div id="post-body" class="metabox-holder columns-<?php echo 1 === (int) get_current_screen()->get_columns() ? '1' : '2'; ?>">
566 566
 
567 567
 						<div id="postbox-container-1" class="postbox-container">
568
-							<?php do_meta_boxes( $this->id, 'side', $points_type ); ?>
568
+							<?php do_meta_boxes($this->id, 'side', $points_type); ?>
569 569
 						</div>
570 570
 
571
-						<?php if ( isset( $this->current_points_type ) ) : ?>
571
+						<?php if (isset($this->current_points_type)) : ?>
572 572
 							<div class="wordpoints-hook-events-heading">
573
-								<h2><?php echo esc_html( $title ); ?></h2>
574
-								<p class="description"><?php echo esc_html( $description ); ?></p>
573
+								<h2><?php echo esc_html($title); ?></h2>
574
+								<p class="description"><?php echo esc_html($description); ?></p>
575 575
 							</div>
576 576
 
577 577
 							<div id="postbox-container-2" class="postbox-container">
578
-								<?php do_meta_boxes( $this->id, 'events', $points_type ); ?>
578
+								<?php do_meta_boxes($this->id, 'events', $points_type); ?>
579 579
 							</div>
580 580
 						<?php endif; ?>
581 581
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 		 *
595 595
 		 * @since 1.0.0
596 596
 		 */
597
-		do_action( 'wordpoints_admin_points_events_foot' );
597
+		do_action('wordpoints_admin_points_events_foot');
598 598
 	}
599 599
 }
600 600
 
Please login to merge, or discard this patch.