Completed
Push — master ( afae5e...fce50c )
by
unknown
03:06
created
includes/admin/fields/license.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @param array $field
36 36
 	 */
37
-	public function __construct( $field ) {
38
-		$this->addon = isset( $field['addon'] ) ? esc_attr( $field['addon'] ) : '';
37
+	public function __construct($field) {
38
+		$this->addon = isset($field['addon']) ? esc_attr($field['addon']) : '';
39 39
 		$this->type_class = 'simcal-field-license';
40
-		parent::__construct( $field );
40
+		parent::__construct($field);
41 41
 	}
42 42
 
43 43
 	/**
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function html() {
49 49
 
50
-		if ( ! empty( $this->addon ) ) {
50
+		if ( ! empty($this->addon)) {
51 51
 
52
-			$status = simcal_get_license_status( $this->addon );
52
+			$status = simcal_get_license_status($this->addon);
53 53
 
54
-			if ( empty( $status ) || in_array( $status, array( 'valid', 'invalid', 'deactivated' ) ) ) {
54
+			if (empty($status) || in_array($status, array('valid', 'invalid', 'deactivated'))) {
55 55
 				$display_activate = 'display: inline-block';
56 56
 				$display_deactivate = 'display: none';
57 57
 				$active = 'valid' == $status ? 'display: block' : 'display: none';
58
-				$disabled   = '';
58
+				$disabled = '';
59 59
 			} else {
60 60
 				$display_activate = $active = 'display: none';
61 61
 				$display_deactivate = 'display: inline-block';
62
-				$disabled = empty( $this->value ) ? '' : 'disabled="disabled"';
62
+				$disabled = empty($this->value) ? '' : 'disabled="disabled"';
63 63
 			}
64 64
 
65 65
 			?>
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
 				<span class="simcal-addon-manage-license-buttons">
75 75
 
76 76
 					<button class="button-secondary simcal-addon-manage-license deactivate" data-add-on="<?php echo $this->addon; ?>" style="<?php echo $display_deactivate; ?>">
77
-				        <i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i><?php _e( 'Deactivate', 'google-calendar-events' ); ?>
77
+				        <i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i><?php _e('Deactivate', 'google-calendar-events'); ?>
78 78
 					</button>
79 79
 
80 80
 					<button class="button-secondary simcal-addon-manage-license activate" data-add-on="<?php echo $this->addon; ?>" style="<?php echo $display_activate; ?>">
81
-						<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i><?php _e( 'Activate', 'google-calendar-events' ); ?>
81
+						<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i><?php _e('Activate', 'google-calendar-events'); ?>
82 82
 					</button>
83 83
 
84 84
 					<span class="error" style="color: red; display: none"> </span>
85 85
 
86
-					<strong class="label" style="color:green; <?php echo $active; ?>"> <?php _e( '(active)', 'google-calendar-events' ); ?></strong>
86
+					<strong class="label" style="color:green; <?php echo $active; ?>"> <?php _e('(active)', 'google-calendar-events'); ?></strong>
87 87
 
88 88
 				</span>
89 89
 
Please login to merge, or discard this patch.
includes/admin/fields/nonce.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param array $field
28 28
 	 */
29
-	public function __construct( $field ) {
30
-		parent::__construct( $field );
29
+	public function __construct($field) {
30
+		parent::__construct($field);
31 31
 	}
32 32
 
33 33
 	/**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @since 3.0.0
37 37
 	 */
38 38
 	public function html() {
39
-		wp_nonce_field( $this->name, $this->value );
39
+		wp_nonce_field($this->name, $this->value);
40 40
 	}
41 41
 
42 42
 }
Please login to merge, or discard this patch.
includes/admin/fields/radio.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @param array $field
38 38
 	 */
39
-	public function __construct( $field ) {
39
+	public function __construct($field) {
40 40
 
41 41
 		$this->type_class = 'simcal-field-radios';
42
-		$this->inline     = isset( $field['inline'] ) ? ( 'inline' == $field['inline'] ? true : false ) : false;
42
+		$this->inline     = isset($field['inline']) ? ('inline' == $field['inline'] ? true : false) : false;
43 43
 
44
-		parent::__construct( $field );
44
+		parent::__construct($field);
45 45
 	}
46 46
 
47 47
 	/**
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 		?>
55 55
 		<fieldset id="<?php echo $this->id; ?>"
56 56
 		          class="<?php echo $this->class; ?>"
57
-			<?php echo $this->style ? 'style="' . $this->style .'"' : ''; ?>>
57
+			<?php echo $this->style ? 'style="'.$this->style.'"' : ''; ?>>
58 58
 			<?php
59 59
 
60
-			echo $this->description ? '<p class="description">' . wp_kses_post( $this->description ) . '</p>' : '';
60
+			echo $this->description ? '<p class="description">'.wp_kses_post($this->description).'</p>' : '';
61 61
 
62
-			if ( ! empty( $this->title ) ) :
62
+			if ( ! empty($this->title)) :
63 63
 
64 64
 				?>
65 65
 				<legend class="screen-reader-text">
@@ -71,18 +71,18 @@  discard block
 block discarded – undo
71 71
 
72 72
 			?>
73 73
 			<ul <?php echo $this->inline === true ? 'class="simcal-field-radios-inline"' : ''; ?>>
74
-				<?php foreach ( $this->options as $option => $name ) : ?>
74
+				<?php foreach ($this->options as $option => $name) : ?>
75 75
 					<li>
76
-						<label for="<?php echo $this->id . '-' . trim( strval( $option ) ); ?>">
76
+						<label for="<?php echo $this->id.'-'.trim(strval($option)); ?>">
77 77
 							<input name="<?php echo $this->name; ?>"
78
-							       id="<?php echo $this->id . '-' . trim( strval( $option ) ); ?>"
78
+							       id="<?php echo $this->id.'-'.trim(strval($option)); ?>"
79 79
 							       class="simcal-field simcal-field-radio"
80 80
 							       type="radio"
81
-							       value="<?php echo trim( strval( $option ) ); ?>"
81
+							       value="<?php echo trim(strval($option)); ?>"
82 82
 								<?php echo $this->attributes; ?>
83
-								<?php checked( $option, $this->value, true ); ?>
83
+								<?php checked($option, $this->value, true); ?>
84 84
 								/>
85
-							<?php echo esc_attr( $name ); ?>
85
+							<?php echo esc_attr($name); ?>
86 86
 						</label>
87 87
 					</li>
88 88
 				<?php endforeach; ?>
Please login to merge, or discard this patch.
includes/admin/fields/select.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -51,28 +51,28 @@  discard block
 block discarded – undo
51 51
 	 *
52 52
 	 * @param array $field
53 53
 	 */
54
-	public function __construct( $field ) {
54
+	public function __construct($field) {
55 55
 
56 56
 		$class = 'simcal-field-select';
57 57
 
58
-		$enhanced = isset( $field['enhanced'] ) ? $field['enhanced'] : '';
59
-		if ( 'enhanced' == $enhanced )  {
58
+		$enhanced = isset($field['enhanced']) ? $field['enhanced'] : '';
59
+		if ('enhanced' == $enhanced) {
60 60
 			$this->enhanced = true;
61 61
 			$class .= ' simcal-field-select-enhanced';
62 62
 		}
63 63
 
64
-		$multiselect = isset( $field['multiselect'] ) ? $field['multiselect'] : '';
65
-		if ( 'multiselect' == $multiselect ) {
64
+		$multiselect = isset($field['multiselect']) ? $field['multiselect'] : '';
65
+		if ('multiselect' == $multiselect) {
66 66
 			$this->multiselect = true;
67 67
 			$class .= ' simcal-field-multiselect';
68 68
 		}
69 69
 
70 70
 		$this->type_class = $class;
71 71
 
72
-		$allow_void = isset( $field['allow_void'] ) ? $field['allow_void'] : '';
72
+		$allow_void = isset($field['allow_void']) ? $field['allow_void'] : '';
73 73
 		$this->allow_void = 'allow_void' == $allow_void ? true : false;
74 74
 
75
-		parent::__construct( $field );
75
+		parent::__construct($field);
76 76
 	}
77 77
 
78 78
 	/**
@@ -82,30 +82,30 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function html() {
84 84
 
85
-		if ( $this->multiselect === true && ! is_array( $this->value ) ) {
86
-			$this->value = explode( ',', $this->value );
85
+		if ($this->multiselect === true && ! is_array($this->value)) {
86
+			$this->value = explode(',', $this->value);
87 87
 		}
88 88
 
89 89
 		?>
90
-		<select name="<?php echo $this->name; ?><?php if ( $this->multiselect === true ) { echo '[]'; } ?>"
90
+		<select name="<?php echo $this->name; ?><?php if ($this->multiselect === true) { echo '[]'; } ?>"
91 91
 		        id="<?php echo $this->id; ?>"
92 92
 		        style="<?php echo $this->style; ?>"
93 93
 		        class="<?php echo $this->class; ?>"
94 94
 				<?php echo $this->attributes; ?>
95
-				<?php echo ( $this->multiselect === true ) ? ' multiple="multiple"' : ''; ?>>
95
+				<?php echo ($this->multiselect === true) ? ' multiple="multiple"' : ''; ?>>
96 96
 			<?php
97 97
 
98
-			if ( $this->allow_void === true ) {
99
-				echo '<option value=""' . selected( '', $this->value, false ) . '></option>';
98
+			if ($this->allow_void === true) {
99
+				echo '<option value=""'.selected('', $this->value, false).'></option>';
100 100
 			}
101 101
 
102
-			foreach ( $this->options as $option => $name ) {
103
-				if ( is_array( $this->value ) ) {
104
-					$selected =	selected( in_array( $option, $this->value ), true, false );
102
+			foreach ($this->options as $option => $name) {
103
+				if (is_array($this->value)) {
104
+					$selected = selected(in_array($option, $this->value), true, false);
105 105
 				} else {
106
-					$selected = selected( $this->value, trim( strval( $option ) ), false );
106
+					$selected = selected($this->value, trim(strval($option)), false);
107 107
 				}
108
-				echo '<option value="' . $option . '" ' . $selected . '>' . esc_attr( $name ) . '</option>';
108
+				echo '<option value="'.$option.'" '.$selected.'>'.esc_attr($name).'</option>';
109 109
 			}
110 110
 
111 111
 			?>
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 
115 115
 		echo $this->tooltip;
116 116
 
117
-		if ( ! empty( $this->description ) ) {
118
-			echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
117
+		if ( ! empty($this->description)) {
118
+			echo '<p class="description">'.wp_kses_post($this->description).'</p>';
119 119
 		}
120 120
 
121 121
 	}
Please login to merge, or discard this patch.
includes/admin/fields/standard.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param array $field
37 37
 	 */
38
-	public function __construct( $field ) {
38
+	public function __construct($field) {
39 39
 
40
-		$this->subtype = isset( $field['subtype'] ) ? esc_attr( $field['subtype'] ) : 'text';
41
-		$this->type_class = 'simcal-field-' . $this->subtype;
40
+		$this->subtype = isset($field['subtype']) ? esc_attr($field['subtype']) : 'text';
41
+		$this->type_class = 'simcal-field-'.$this->subtype;
42 42
 
43
-		parent::__construct( $field );
43
+		parent::__construct($field);
44 44
 	}
45 45
 
46 46
 	/**
@@ -56,18 +56,18 @@  discard block
 block discarded – undo
56 56
 		       id="<?php echo $this->id; ?>"
57 57
 		       value="<?php echo $this->value; ?>"
58 58
 		       class="<?php echo $this->class; ?>"<?php
59
-				echo $this->style ? 'style="' . $this->style . '" ' : ' ';
60
-		        echo $this->placeholder ? 'placeholder="' . $this->placeholder . '"' : ' ';
59
+				echo $this->style ? 'style="'.$this->style.'" ' : ' ';
60
+		        echo $this->placeholder ? 'placeholder="'.$this->placeholder.'"' : ' ';
61 61
 				echo $this->attributes; ?>/>
62 62
 		<?php
63 63
 
64 64
 		echo $this->tooltip;
65 65
 
66
-		if ( ! empty( $this->description ) ) {
67
-			echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
66
+		if ( ! empty($this->description)) {
67
+			echo '<p class="description">'.wp_kses_post($this->description).'</p>';
68 68
 		}
69 69
 
70
-		if ( is_string( $this->validation ) && ! empty ( $this->validation ) ) {
70
+		if (is_string($this->validation) && ! empty ($this->validation)) {
71 71
 			echo $this->validation;
72 72
 		}
73 73
 
Please login to merge, or discard this patch.
includes/admin/fields/textarea.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Field;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param array $field
28 28
 	 */
29
-	public function __construct( $field ) {
29
+	public function __construct($field) {
30 30
 
31 31
 		$this->type_class = 'simcal-field-textarea';
32 32
 
33
-		parent::__construct( $field );
33
+		parent::__construct($field);
34 34
 
35
-		if ( ! empty( $field['value'] ) ) {
36
-			$this->value = esc_textarea( $field['value'] );
35
+		if ( ! empty($field['value'])) {
36
+			$this->value = esc_textarea($field['value']);
37 37
 		}
38
-		if ( ! empty( $field['default'] ) ) {
39
-			$this->default = esc_textarea( $field['default'] );
38
+		if ( ! empty($field['default'])) {
39
+			$this->default = esc_textarea($field['default']);
40 40
 		}
41 41
 	}
42 42
 
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
 			name="<?php echo $this->name; ?>"
53 53
 			id="<?php echo $this->id; ?>"
54 54
 			<?php
55
-			echo $this->class ? 'class="'  . $this->class . '" ' : '';
56
-			echo $this->placeholder ? 'placeholder="'  . $this->placeholder . '" ' : '';
57
-			echo $this->style ? 'style="'  . $this->style . '" ' : '';
55
+			echo $this->class ? 'class="'.$this->class.'" ' : '';
56
+			echo $this->placeholder ? 'placeholder="'.$this->placeholder.'" ' : '';
57
+			echo $this->style ? 'style="'.$this->style.'" ' : '';
58 58
 			echo $this->attributes;
59
-			?>><?php echo $this->value;  ?></textarea>
59
+			?>><?php echo $this->value; ?></textarea>
60 60
 		<?php
61 61
 
62 62
 		echo $this->tooltip;
63 63
 
64
-		if ( ! empty( $this->description ) ) {
65
-			echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
64
+		if ( ! empty($this->description)) {
65
+			echo '<p class="description">'.wp_kses_post($this->description).'</p>';
66 66
 		}
67 67
 
68 68
 	}
Please login to merge, or discard this patch.
includes/admin/meta-boxes.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Admin\Metaboxes as Metabox;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function __construct() {
46 46
 
47
-		$settings = get_option( 'simple-calendar_settings_calendars' );
48
-		if ( isset( $settings['general']['attach_calendars_posts'] ) ) {
47
+		$settings = get_option('simple-calendar_settings_calendars');
48
+		if (isset($settings['general']['attach_calendars_posts'])) {
49 49
 			$this->post_types = $settings['general']['attach_calendars_posts'];
50 50
 		}
51 51
 
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 		new Metabox\Settings();
54 54
 		new Metabox\Attach_Calendar();
55 55
 		new Metabox\Newsletter();
56
-		do_action( 'simcal_load_meta_boxes' );
56
+		do_action('simcal_load_meta_boxes');
57 57
 
58 58
 		// Add meta boxes.
59
-		add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 30 );
59
+		add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 30);
60 60
 
61 61
 		// Process meta boxes.
62
-		add_action( 'simcal_save_settings_meta','\SimpleCalendar\Admin\Metaboxes\Settings::save', 10, 2 );
63
-		add_action( 'simcal_save_attach_calendar_meta','\SimpleCalendar\Admin\Metaboxes\Attach_Calendar::save', 10, 2 );
62
+		add_action('simcal_save_settings_meta', '\SimpleCalendar\Admin\Metaboxes\Settings::save', 10, 2);
63
+		add_action('simcal_save_attach_calendar_meta', '\SimpleCalendar\Admin\Metaboxes\Attach_Calendar::save', 10, 2);
64 64
 
65 65
 		// Save meta boxes data.
66
-		add_action( 'save_post', array( $this, 'save_meta_boxes' ), 1, 2 );
66
+		add_action('save_post', array($this, 'save_meta_boxes'), 1, 2);
67 67
 
68 68
 		// Uncomment this for debugging $_POST while saving a meta box.
69 69
 		// add_action( 'save_post', function() { echo '<pre>'; print_r( $_POST ); echo '</pre>'; die(); } );
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 
79 79
 		add_meta_box(
80 80
 			'simcal-calendar-settings',
81
-			__( 'Calendar Settings', 'google-calendar-events' ),
81
+			__('Calendar Settings', 'google-calendar-events'),
82 82
 			'\SimpleCalendar\Admin\Metaboxes\Settings::html',
83 83
 			'calendar',
84 84
 			'normal',
85 85
 			'core'
86 86
 		);
87 87
 
88
-		$addons = apply_filters( 'simcal_installed_addons', array() );
89
-		if ( empty( $addons ) ) {
88
+		$addons = apply_filters('simcal_installed_addons', array());
89
+		if (empty($addons)) {
90 90
 
91 91
 			add_meta_box(
92 92
 				'simcal-newsletter',
93
-				__( 'Get 20% off Google Calendar Pro!', 'google-calendar-events' ),
93
+				__('Get 20% off Google Calendar Pro!', 'google-calendar-events'),
94 94
 				'\SimpleCalendar\Admin\Metaboxes\Newsletter::html',
95 95
 				'calendar',
96 96
 				'side',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 		add_meta_box(
103 103
 			'simcal-get-shortcode',
104
-			__( 'Calendar Shortcode', 'google-calendar-events' ),
104
+			__('Calendar Shortcode', 'google-calendar-events'),
105 105
 			'\SimpleCalendar\Admin\Metaboxes\Get_Shortcode::html',
106 106
 			'calendar',
107 107
 			'side',
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 		);
110 110
 
111 111
 		// Add meta box if there are calendars.
112
-		if ( ( true == simcal_get_calendars() ) && ! empty( $this->post_types ) ) {
113
-			foreach ( $this->post_types as $post_type ) {
112
+		if ((true == simcal_get_calendars()) && ! empty($this->post_types)) {
113
+			foreach ($this->post_types as $post_type) {
114 114
 				add_meta_box(
115 115
 					'simcal-attach-calendar',
116
-					__( 'Attach Calendar', 'google-calendar-events' ),
116
+					__('Attach Calendar', 'google-calendar-events'),
117 117
 					'\SimpleCalendar\Admin\Metaboxes\Attach_Calendar::html',
118 118
 					$post_type,
119 119
 					'side',
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			}
123 123
 		}
124 124
 
125
-		do_action( 'simcal_add_meta_boxes' );
125
+		do_action('simcal_add_meta_boxes');
126 126
 	}
127 127
 
128 128
 	/**
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
 	 *
136 136
 	 * @return void
137 137
 	 */
138
-	public function save_meta_boxes( $post_id, $post ) {
138
+	public function save_meta_boxes($post_id, $post) {
139 139
 
140 140
 		// $post_id and $post are required.
141
-		if ( empty( $post_id ) || empty( $post ) || self::$saved_meta_boxes ) {
141
+		if (empty($post_id) || empty($post) || self::$saved_meta_boxes) {
142 142
 			return;
143 143
 		}
144 144
 
145 145
 		// Don't save meta boxes for revisions or autosaves.
146
-		if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
146
+		if (defined('DOING_AUTOSAVE') || is_int(wp_is_post_revision($post)) || is_int(wp_is_post_autosave($post))) {
147 147
 			return;
148 148
 		}
149 149
 
150 150
 		// Check the nonce.
151
-		if ( empty( $_POST['simcal_meta_nonce'] ) || ! wp_verify_nonce( $_POST['simcal_meta_nonce'], 'simcal_save_data' ) ) {
151
+		if (empty($_POST['simcal_meta_nonce']) || ! wp_verify_nonce($_POST['simcal_meta_nonce'], 'simcal_save_data')) {
152 152
 			return;
153 153
 		}
154 154
 
155 155
 		// Check the post being saved == the $post_id to prevent triggering this call for other save_post events.
156
-		if ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) {
156
+		if (empty($_POST['post_ID']) || $_POST['post_ID'] != $post_id) {
157 157
 			return;
158 158
 		}
159 159
 
160 160
 		// Check user has permission to edit
161
-		if ( ! current_user_can( 'edit_post', $post_id ) ) {
161
+		if ( ! current_user_can('edit_post', $post_id)) {
162 162
 			return;
163 163
 		}
164 164
 
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
 		self::$saved_meta_boxes = true;
172 172
 
173 173
 		// Check the post type.
174
-		if ( 'calendar' == $post->post_type ) {
175
-			do_action( 'simcal_save_settings_meta', $post_id, $post );
176
-		} elseif ( in_array( $post->post_type, $this->post_types ) ) {
177
-			do_action( 'simcal_save_attach_calendar_meta', $post_id, $post );
174
+		if ('calendar' == $post->post_type) {
175
+			do_action('simcal_save_settings_meta', $post_id, $post);
176
+		} elseif (in_array($post->post_type, $this->post_types)) {
177
+			do_action('simcal_save_attach_calendar_meta', $post_id, $post);
178 178
 		}
179 179
 
180
-		do_action( 'simcal_save_meta_boxes', $post_id, $post );
180
+		do_action('simcal_save_meta_boxes', $post_id, $post);
181 181
 	}
182 182
 
183 183
 }
Please login to merge, or discard this patch.
includes/admin/metaboxes/attach-calendar.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Meta_Box;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -28,38 +28,38 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @param \WP_Post $post
30 30
 	 */
31
-	public static function html( $post ) {
31
+	public static function html($post) {
32 32
 
33 33
 		// @see Meta_Boxes::save_meta_boxes()
34
-		wp_nonce_field( 'simcal_save_data', 'simcal_meta_nonce' );
34
+		wp_nonce_field('simcal_save_data', 'simcal_meta_nonce');
35 35
 
36 36
 		$calendars = simcal_get_calendars();
37 37
 
38
-		simcal_print_field( array(
38
+		simcal_print_field(array(
39 39
 			'type'       => 'select',
40 40
 			'id'         => '_simcal_attach_calendar_id',
41 41
 			'name'       => '_simcal_attach_calendar_id',
42
-			'enhanced'   => count( $calendars ) > 15 ? 'enhanced' : '',
42
+			'enhanced'   => count($calendars) > 15 ? 'enhanced' : '',
43 43
 			'allow_void' => 'allow_void',
44
-			'value'      => absint( get_post_meta( $post->ID, '_simcal_attach_calendar_id', true ) ),
44
+			'value'      => absint(get_post_meta($post->ID, '_simcal_attach_calendar_id', true)),
45 45
 			'options'    => $calendars,
46 46
 			'attributes' => array(
47 47
 				'data-allowclear' => 'true',
48 48
 			)
49
-		) );
49
+		));
50 50
 
51
-		$position = get_post_meta( $post->ID, '_simcal_attach_calendar_position', true );
51
+		$position = get_post_meta($post->ID, '_simcal_attach_calendar_position', true);
52 52
 
53
-		simcal_print_field( array(
53
+		simcal_print_field(array(
54 54
 			'type'      => 'radio',
55 55
 			'id'        => '_simcal_attach_calendar_position',
56 56
 			'name'      => '_simcal_attach_calendar_position',
57 57
 			'value'     => $position ? $position : 'after',
58 58
 			'options'   => array(
59
-				'after'  => __( 'After content', 'google-calendar-events' ),
60
-				'before' => __( 'Before content', 'google-calendar-events' ),
59
+				'after'  => __('After content', 'google-calendar-events'),
60
+				'before' => __('Before content', 'google-calendar-events'),
61 61
 			),
62
-		) );
62
+		));
63 63
 
64 64
 	}
65 65
 
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
 	 * @param int      $post_id
72 72
 	 * @param \WP_Post $post
73 73
 	 */
74
-	public static function save( $post_id, $post ) {
74
+	public static function save($post_id, $post) {
75 75
 
76
-		$id = isset( $_POST['_simcal_attach_calendar_id'] ) ? absint( $_POST['_simcal_attach_calendar_id'] ) : '';
77
-		update_post_meta( $post_id, '_simcal_attach_calendar_id', $id );
76
+		$id = isset($_POST['_simcal_attach_calendar_id']) ? absint($_POST['_simcal_attach_calendar_id']) : '';
77
+		update_post_meta($post_id, '_simcal_attach_calendar_id', $id);
78 78
 
79
-		$position = isset( $_POST['_simcal_attach_calendar_position'] ) ? sanitize_title( $_POST['_simcal_attach_calendar_position'] ) : 'after';
80
-		update_post_meta( $post_id, '_simcal_attach_calendar_position', $position );
79
+		$position = isset($_POST['_simcal_attach_calendar_position']) ? sanitize_title($_POST['_simcal_attach_calendar_position']) : 'after';
80
+		update_post_meta($post_id, '_simcal_attach_calendar_position', $position);
81 81
 
82 82
 	}
83 83
 
Please login to merge, or discard this patch.
includes/admin/metaboxes/get-shortcode.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Meta_Box;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param \WP_Post $post
28 28
 	 */
29
-	public static function html( $post ) {
30
-		simcal_print_shortcode_tip( $post->ID );
29
+	public static function html($post) {
30
+		simcal_print_shortcode_tip($post->ID);
31 31
 	}
32 32
 
33 33
 	/**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @param int      $post_id
39 39
 	 * @param \WP_Post $post
40 40
 	 */
41
-	public static function save( $post_id, $post ) {
41
+	public static function save($post_id, $post) {
42 42
 		// This Meta Box does not have settings.
43 43
 	}
44 44
 
Please login to merge, or discard this patch.