Passed
Push — master ( 43702f...903e32 )
by Warwick
04:44 queued 10s
created

Meal::set_parent_only()   A

Complexity

Conditions 5
Paths 2

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 2
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 3
rs 9.6111
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
2
namespace lsx_health_plan\classes;
3
4
/**
5
 * Contains the day post type
6
 *
7
 * @package lsx-health-plan
8
 */
9
class Meal {
10
11
	/**
12
	 * Holds class instance
13
	 *
14
	 * @since 1.0.0
15
	 *
16
	 * @var      object \lsx_health_plan\classes\Meal()
17
	 */
18
	protected static $instance = null;
19
20
	/**
21
	 * Holds post_type slug used as an index
22
	 *
23
	 * @since 1.0.0
24
	 *
25
	 * @var      string
26
	 */
27
	public $slug = 'meal';
28
29
	/**
30
	 * Constructor
31
	 */
32
	public function __construct() {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
33
		add_action( 'init', array( $this, 'register_post_type' ) );
34
		add_action( 'init', array( $this, 'taxonomy_setup' ) );
35
		
36
		add_filter( 'lsx_health_plan_connections', array( $this, 'enable_connections' ), 10, 1 );
37
		add_action( 'cmb2_admin_init', array( $this, 'featured_metabox' ), 5 );
38
		add_action( 'cmb2_admin_init', array( $this, 'details_metaboxes' ) );
39
40
		// Template Redirects.
41
		add_filter( 'lsx_health_plan_single_template', array( $this, 'enable_post_type' ), 10, 1 );
42
		add_filter( 'lsx_health_plan_archive_template', array( $this, 'enable_post_type' ), 10, 1 );
43
44
		add_action( 'pre_get_posts', array( $this, 'set_parent_only' ), 10, 1 );
45
		add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 );
46
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
47
48
	/**
49
	 * Return an instance of this class.
50
	 *
51
	 * @since 1.0.0
52
	 *
53
	 * @return    object \lsx_health_plan\classes\Day()    A single instance of this class.
54
	 */
55
	public static function get_instance() {
56
		// If the single instance hasn't been set, set it now.
57
		if ( null === self::$instance ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
58
			self::$instance = new self();
59
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
60
		return self::$instance;
61
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
62
	/**
63
	 * Register the post type.
64
	 */
65
	public function register_post_type() {
66
		$labels = array(
67
			'name'               => esc_html__( 'Meals', 'lsx-health-plan' ),
68
			'singular_name'      => esc_html__( 'Meal', 'lsx-health-plan' ),
69
			'add_new'            => esc_html_x( 'Add New', 'post type general name', 'lsx-health-plan' ),
70
			'add_new_item'       => esc_html__( 'Add New', 'lsx-health-plan' ),
71
			'edit_item'          => esc_html__( 'Edit', 'lsx-health-plan' ),
72
			'new_item'           => esc_html__( 'New', 'lsx-health-plan' ),
73
			'all_items'          => esc_html__( 'All Meals', 'lsx-health-plan' ),
74
			'view_item'          => esc_html__( 'View', 'lsx-health-plan' ),
75
			'search_items'       => esc_html__( 'Search', 'lsx-health-plan' ),
76
			'not_found'          => esc_html__( 'None found', 'lsx-health-plan' ),
77
			'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-health-plan' ),
78
			'parent_item_colon'  => esc_html__( 'Parent:', 'lsx-health-plan' ),
79
			'menu_name'          => esc_html__( 'Meals', 'lsx-health-plan' ),
80
		);
81
		$args   = array(
82
			'labels'             => $labels,
83
			'public'             => true,
84
			'publicly_queryable' => true,
85
			'show_ui'            => true,
86
			'show_in_menu'       => true,
87
			'show_in_rest'       => true,
88
			'menu_icon'          => 'dashicons-carrot',
89
			'query_var'          => true,
90
			'rewrite'            => array(
91
				'slug' => \lsx_health_plan\functions\get_option( 'meal_single_slug', 'meal' ),
92
			),
93
			'capability_type'    => 'page',
94
			'has_archive'        => \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ),
95
			'hierarchical'       => true,
96
			'menu_position'      => null,
97
			'supports'           => array(
98
				'title',
99
				'editor',
100
				'thumbnail',
101
				'page-attributes',
102
				'custom-fields',
103
			),
104
		);
105
		register_post_type( 'meal', $args );
106
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
107
108
	/**
109
	 * Register the Meal Type taxonomy.
110
	 */
111
	public function taxonomy_setup() {
112
		$labels = array(
113
			'name'              => esc_html_x( 'Meal Type', 'taxonomy general name', 'lsx-health-plan' ),
114
			'singular_name'     => esc_html_x( 'Meal Types', 'taxonomy singular name', 'lsx-health-plan' ),
115
			'search_items'      => esc_html__( 'Search', 'lsx-health-plan' ),
116
			'all_items'         => esc_html__( 'All', 'lsx-health-plan' ),
117
			'parent_item'       => esc_html__( 'Parent', 'lsx-health-plan' ),
118
			'parent_item_colon' => esc_html__( 'Parent:', 'lsx-health-plan' ),
119
			'edit_item'         => esc_html__( 'Edit', 'lsx-health-plan' ),
120
			'update_item'       => esc_html__( 'Update', 'lsx-health-plan' ),
121
			'add_new_item'      => esc_html__( 'Add New', 'lsx-health-plan' ),
122
			'new_item_name'     => esc_html__( 'New Name', 'lsx-health-plan' ),
123
			'menu_name'         => esc_html__( 'Meal Types', 'lsx-health-plan' ),
124
		);
125
		$args   = array(
126
			'hierarchical'      => true,
127
			'labels'            => $labels,
128
			'show_ui'           => true,
129
			'show_in_menu'      => 'edit.php?post_type=meal',
130
			'show_admin_column' => true,
131
			'query_var'         => true,
132
			'rewrite'           => array(
133
				'slug' => 'meal-type',
134
			),
135
		);
136
		register_taxonomy( 'meal-type', array( $this->slug ), $args );
137
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
138
139
	/**
140
	 * Adds the post type to the different arrays.
141
	 *
142
	 * @param array $post_types
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
143
	 * @return array
144
	 */
145
	public function enable_post_type( $post_types = array() ) {
146
		$post_types[] = $this->slug;
147
		return $post_types;
148
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
149
150
	/**
151
	 * Enables the Bi Directional relationships
152
	 *
153
	 * @param array $connections
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
154
	 * @return void
0 ignored issues
show
Coding Style introduced by
Function return type is void, but function contains return statement
Loading history...
155
	 */
156
	public function enable_connections( $connections = array() ) {
157
		$connections['meal']['connected_plans'] = 'connected_meals';
158
		$connections['plan']['connected_meals'] = 'connected_plans';
159
		return $connections;
160
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
161
162
	/**
163
	 * Remove the "Archives:" from the post type meal.
164
	 *
165
	 * @param string $title the term title.
166
	 * @return string
167
	 */
168
	public function get_the_archive_title( $title ) {
169
		if ( is_post_type_archive( 'meal' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
170
			$title = __( 'Meals', 'lsx-health-plan' );
171
		}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
172
		return $title;
173
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
174
175
	/**
176
	 * Define the metabox and field configurations.
177
	 */
178
	public function featured_metabox() {
179
		$cmb = new_cmb2_box(
180
			array(
181
				'id'           => $this->slug . '_featured_metabox_meal',
182
				'title'        => __( 'Featured Meal', 'lsx-health-plan' ),
183
				'object_types' => array( $this->slug ), // Post type
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
184
				'context'      => 'side',
185
				'priority'     => 'high',
186
				'show_names'   => true,
187
			)
188
		);
189
		$cmb->add_field(
190
			array(
191
				'name'       => __( 'Featured Meal', 'lsx-health-plan' ),
192
				'desc'       => __( 'Enable a featured meal' ),
193
				'id'         => $this->slug . '_featured_meal',
194
				'type'       => 'checkbox',
195
				'show_on_cb' => 'cmb2_hide_if_no_cats',
196
			)
197
		);
198
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
199
200
	/**
201
	 * Define the metabox and field configurations.
202
	 */
203
	public function details_metaboxes() {
204
		$cmb = new_cmb2_box( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
205
			'id'           => $this->slug . '_shopping_list_metabox',
206
			'title'        => __( 'Shopping List', 'lsx-health-plan' ),
207
			'object_types' => array( $this->slug ), // Post type
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
208
			'context'      => 'normal',
209
			'priority'     => 'high',
210
			'show_names'   => true,
211
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
212
		$cmb->add_field( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
213
			'name'       => __( 'Shopping List', 'lsx-health-plan' ),
214
			'desc'       => __( 'Connect the shopping list page that applies to this meal by entering the name of the page in the field provided.' ),
215
			'id'         => $this->slug . '_shopping_list',
216
			'type'       => 'post_search_ajax',
217
			// Optional :
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
218
			'limit'      => 1,  // Limit selection to X items only (default 1)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
219
			'sortable'   => true, // Allow selected items to be sortable (default false)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
220
			'query_args' => array(
221
				'post_type'      => array( 'page' ),
222
				'post_status'    => array( 'publish' ),
223
				'posts_per_page' => -1,
224
			),
225
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
226
		$cmb = new_cmb2_box( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
227
			'id'           => $this->slug . '_details_metabox',
228
			'title'        => __( 'Meal Details', 'lsx-health-plan' ),
229
			'object_types' => array( $this->slug ), // Post type
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
230
			'context'      => 'normal',
231
			'priority'     => 'high',
232
			'show_names'   => true,
233
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
234
235
		$cmb->add_field( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
236
			'name' => __( 'Meal Short Description', 'lsx-health-plan' ),
237
			'id'   => $this->slug . '_short_description',
238
			'type' => 'textarea_small',
239
			'desc' => __( 'Add a small description for this meal (optional)', 'lsx-health-plan' ),
240
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
241
242
		$cmb->add_field( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
243
			'name'       => __( 'Pre Breakfast Snack', 'lsx-health-plan' ),
244
			'id'         => $this->slug . '_pre_breakfast_snack',
245
			'type'       => 'wysiwyg',
246
			'show_on_cb' => 'cmb2_hide_if_no_cats',
247
			'options'    => array(
248
				'textarea_rows' => 5,
249
			),
250
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
251
		$cmb->add_field( array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
252
			'name'       => __( 'Breakfast', 'lsx-health-plan' ),
253
			'id'         => $this->slug . '_breakfast',
254
			'type'       => 'wysiwyg',
255
			'show_on_cb' => 'cmb2_hide_if_no_cats',
256
			'options'    => array(
257
				'textarea_rows' => 5,
258
			),
259
		) );
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
260
261
		$cmb->add_field(
262
			array(
263
				'name'       => __( 'Post Breakfast Snack', 'lsx-health-plan' ),
264
				'id'         => $this->slug . '_breakfast_snack',
265
				'type'       => 'wysiwyg',
266
				'show_on_cb' => 'cmb2_hide_if_no_cats',
267
				'options'    => array(
268
					'textarea_rows' => 5,
269
				),
270
			)
271
		);
272
273
		if ( post_type_exists( 'recipe' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
274
			$cmb->add_field(
275
				array(
276
					'name'       => __( 'Breakfast Recipes', 'lsx-health-plan' ),
277
					'desc'       => __( 'Connect additional recipes options for breakfast.', 'lsx-health-plan' ),
278
					'id'         => 'breakfast_recipes',
279
					'type'       => 'post_search_ajax',
280
					// Optional :
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
281
					'limit'      => 15,  // Limit selection to X items only (default 1)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
282
					'sortable'   => true, // Allow selected items to be sortable (default false)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
283
					'query_args' => array(
284
						'post_type'      => array( 'recipe' ),
285
						'post_status'    => array( 'publish' ),
286
						'posts_per_page' => -1,
287
					),
288
				)
289
			);
290
		}
291
292
		$cmb->add_field(
293
			array(
294
				'name'       => __( 'Pre Lunch Snack', 'lsx-health-plan' ),
295
				'id'         => $this->slug . '_pre_lunch_snack',
296
				'type'       => 'wysiwyg',
297
				'show_on_cb' => 'cmb2_hide_if_no_cats',
298
				'options'    => array(
299
					'textarea_rows' => 5,
300
				),
301
			)
302
		);
303
		$cmb->add_field(
304
			array(
305
				'name'       => __( 'Lunch', 'lsx-health-plan' ),
306
				'id'         => $this->slug . '_lunch',
307
				'type'       => 'wysiwyg',
308
				'show_on_cb' => 'cmb2_hide_if_no_cats',
309
				'options'    => array(
310
					'textarea_rows' => 5,
311
				),
312
			)
313
		);
314
		$cmb->add_field(
315
			array(
316
				'name'       => __( 'Post Lunch Snack', 'lsx-health-plan' ),
317
				'id'         => $this->slug . '_lunch_snack',
318
				'type'       => 'wysiwyg',
319
				'show_on_cb' => 'cmb2_hide_if_no_cats',
320
				'options'    => array(
321
					'textarea_rows' => 5,
322
				),
323
			)
324
		);
325
326
		if ( post_type_exists( 'recipe' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
327
			$cmb->add_field(
328
				array(
329
					'name'       => __( 'Lunch Recipes', 'lsx-health-plan' ),
330
					'desc'       => __( 'Connect additional recipes options for lunch.', 'lsx-health-plan' ),
331
					'id'         => 'lunch_recipes',
332
					'type'       => 'post_search_ajax',
333
					// Optional :
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
334
					'limit'      => 15,  // Limit selection to X items only (default 1)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
335
					'sortable'   => true, // Allow selected items to be sortable (default false)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
336
					'query_args' => array(
337
						'post_type'      => array( 'recipe' ),
338
						'post_status'    => array( 'publish' ),
339
						'posts_per_page' => -1,
340
					),
341
				)
342
			);
343
		}
344
345
		$cmb->add_field(
346
			array(
347
				'name'       => __( 'Pre Dinner Snack', 'lsx-health-plan' ),
348
				'id'         => $this->slug . '_pre_dinner_snack',
349
				'type'       => 'wysiwyg',
350
				'show_on_cb' => 'cmb2_hide_if_no_cats',
351
				'options'    => array(
352
					'textarea_rows' => 5,
353
				),
354
			)
355
		);
356
		$cmb->add_field(
357
			array(
358
				'name'       => __( 'Dinner', 'lsx-health-plan' ),
359
				'id'         => $this->slug . '_dinner',
360
				'type'       => 'wysiwyg',
361
				'show_on_cb' => 'cmb2_hide_if_no_cats',
362
				'options'    => array(
363
					'textarea_rows' => 5,
364
				),
365
			)
366
		);
367
		$cmb->add_field(
368
			array(
369
				'name'       => __( 'Post Dinner Snack', 'lsx-health-plan' ),
370
				'id'         => $this->slug . '_dinner_snack',
371
				'type'       => 'wysiwyg',
372
				'show_on_cb' => 'cmb2_hide_if_no_cats',
373
				'options'    => array(
374
					'textarea_rows' => 5,
375
				),
376
			)
377
		);
378
379
		if ( post_type_exists( 'recipe' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
380
			$cmb->add_field(
381
				array(
382
					'name'       => __( 'Dinner Recipes', 'lsx-health-plan' ),
383
					'desc'       => __( 'Connect additional recipes options for dinner.', 'lsx-health-plan' ),
384
					'id'         => 'dinner_recipes',
385
					'type'       => 'post_search_ajax',
386
					// Optional :
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
387
					'limit'      => 15,  // Limit selection to X items only (default 1)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
388
					'sortable'   => true, // Allow selected items to be sortable (default false)
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
389
					'query_args' => array(
390
						'post_type'      => array( 'recipe' ),
391
						'post_status'    => array( 'publish' ),
392
						'posts_per_page' => -1,
393
					),
394
				)
395
			);
396
		}
397
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
398
	/**
399
	 * Set the post type archive to show the parent plans only.
400
	 *
401
	 * @param object $wp_query
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
402
	 * @return array
0 ignored issues
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
403
	 */
404
	public function set_parent_only( $wp_query ) {
405
		if ( ! is_admin() && $wp_query->is_main_query() && ( $wp_query->is_post_type_archive( 'meal' ) || $wp_query->is_tax( array( 'meal-type' ) ) ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
406
			$wp_query->set( 'post_parent', '0' );
407
		}
408
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
409
}
410