@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 all Pro Add-ons', 'google-calendar-events' ), |
|
93 | + __('Get 20% off all Pro Add-ons', 'google-calendar-events'), |
|
94 | 94 | '\SimpleCalendar\Admin\Metaboxes\Newsletter::html', |
95 | 95 | 'calendar', |
96 | 96 | 'side', |
@@ -101,7 +101,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function html() { |
49 | 49 | |
50 | - if ( ! empty( $this->addon ) ) { |
|
50 | + if ( ! empty($this->addon)) { |
|
51 | 51 | |
52 | - $status = apply_filters( 'simcal_addon_status_' . $this->addon, simcal_get_license_status( $this->addon ) ); |
|
52 | + $status = apply_filters('simcal_addon_status_'.$this->addon, simcal_get_license_status($this->addon)); |
|
53 | 53 | |
54 | - if ( $status !== 'valid' ) { |
|
54 | + if ($status !== 'valid') { |
|
55 | 55 | $display_activate = 'display: inline-block'; |
56 | 56 | $display_deactivate = 'display: none'; |
57 | 57 | $active = 'valid' == $status ? 'display: block' : 'display: none'; |
@@ -59,7 +59,7 @@ discard block |
||
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 |
||
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 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use SimpleCalendar\Abstracts\Field; |
10 | 10 | |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; // Exit if accessed directly. |
13 | 13 | } |
14 | 14 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @param array $field |
30 | 30 | */ |
31 | - public function __construct( $field ) { |
|
31 | + public function __construct($field) { |
|
32 | 32 | $this->type_class = 'simcal-field-checkboxes'; |
33 | - parent::__construct( $field ); |
|
33 | + parent::__construct($field); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function html() { |
42 | 42 | |
43 | - if ( ! empty( $this->options ) && count( (array) $this->options ) > 1 ) { |
|
43 | + if ( ! empty($this->options) && count((array) $this->options) > 1) { |
|
44 | 44 | |
45 | - if ( ! empty( $this->description ) ) { |
|
46 | - echo '<p class="description">' . wp_kses_post( $this->description ) . ' ' . $this->tooltip . '</p>'; |
|
45 | + if ( ! empty($this->description)) { |
|
46 | + echo '<p class="description">'.wp_kses_post($this->description).' '.$this->tooltip.'</p>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | ?> |
50 | - <fieldset class="<?php echo $this->class; ?>" <?php echo ! empty( $this->style ) ? 'style="' . $this->style . '"' : ''; ?>> |
|
50 | + <fieldset class="<?php echo $this->class; ?>" <?php echo ! empty($this->style) ? 'style="'.$this->style.'"' : ''; ?>> |
|
51 | 51 | <?php |
52 | 52 | |
53 | - if ( ! empty( $this->title ) ) { |
|
54 | - echo '<legend class="screen-reader-text"><span>' . $this->title . '</span></legend>'; |
|
53 | + if ( ! empty($this->title)) { |
|
54 | + echo '<legend class="screen-reader-text"><span>'.$this->title.'</span></legend>'; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | ?> |
58 | 58 | <ul> |
59 | - <?php foreach ( $this->options as $option => $name ) : ?> |
|
59 | + <?php foreach ($this->options as $option => $name) : ?> |
|
60 | 60 | <li> |
61 | - <label for="<?php echo $this->id . '-' . trim( strval( $option ) ); ?>"> |
|
61 | + <label for="<?php echo $this->id.'-'.trim(strval($option)); ?>"> |
|
62 | 62 | <input name="<?php echo $this->name; ?>" |
63 | - id="<?php echo $this->id . '-' . trim( strval( $option ) ); ?>" |
|
63 | + id="<?php echo $this->id.'-'.trim(strval($option)); ?>" |
|
64 | 64 | class="simcal-field simcal-field-checkbox" |
65 | 65 | type="checkbox" |
66 | - value="<?php echo trim( strval( $option ) ); ?>" |
|
67 | - <?php checked( $this->value, 'yes', true ); ?> |
|
66 | + value="<?php echo trim(strval($option)); ?>" |
|
67 | + <?php checked($this->value, 'yes', true); ?> |
|
68 | 68 | <?php echo $this->attributes; ?> |
69 | - /><?php echo esc_attr( $name ); ?> |
|
69 | + /><?php echo esc_attr($name); ?> |
|
70 | 70 | </label> |
71 | 71 | </li> |
72 | 72 | <?php endforeach; ?> |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | } else { |
78 | 78 | |
79 | 79 | ?> |
80 | - <span class="simcal-field-bool" <?php echo $this->style ? 'style="' . $this->style . '"' : ''; ?>> |
|
81 | - <?php if ( ! empty( $this->title ) ) : ?> |
|
80 | + <span class="simcal-field-bool" <?php echo $this->style ? 'style="'.$this->style.'"' : ''; ?>> |
|
81 | + <?php if ( ! empty($this->title)) : ?> |
|
82 | 82 | <span class="screen-reader-text"><?php echo $this->title; ?></span> |
83 | 83 | <?php endif; ?> |
84 | 84 | <input name="<?php echo $this->name; ?>" |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | id="<?php echo $this->id; ?>" |
87 | 87 | class="simcal-field simcal-field-checkbox <?php echo $this->class; ?>" |
88 | 88 | value="yes" |
89 | - <?php checked( $this->value, 'yes', true ); ?> |
|
90 | - <?php echo $this->attributes; ?>/><?php echo ( ! empty( $this->text ) ? $this->text : __( 'Yes', 'google-calendar-events' ) ); ?> |
|
89 | + <?php checked($this->value, 'yes', true); ?> |
|
90 | + <?php echo $this->attributes; ?>/><?php echo ( ! empty($this->text) ? $this->text : __('Yes', 'google-calendar-events')); ?> |
|
91 | 91 | </span> |
92 | 92 | <?php |
93 | 93 | |
94 | 94 | echo $this->tooltip; |
95 | 95 | |
96 | - if ( ! empty( $this->description ) ) { |
|
97 | - echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>'; |
|
96 | + if ( ! empty($this->description)) { |
|
97 | + echo '<p class="description">'.wp_kses_post($this->description).'</p>'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | |
144 | 144 | $links = array(); |
145 | 145 | $links['add-ons'] = '<a href="' . simcal_ga_campaign_url( simcal_get_url( 'addons' ), 'core-plugin', 'plugin-listing' ) . '" target="_blank" >' . |
146 | - __( 'Add-ons', 'google-calendar-events' ) . '</a>'; |
|
146 | + __( 'Add-ons', 'google-calendar-events' ) . '</a>'; |
|
147 | 147 | |
148 | 148 | return apply_filters( 'simcal_plugin_action_links', array_merge( $meta_links, $links ) ); |
149 | 149 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | namespace SimpleCalendar\Admin; |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | |
45 | 45 | self::$main_menu = 'edit.php?post_type=calendar'; |
46 | 46 | |
47 | - add_action( 'admin_menu', array( __CLASS__, 'add_menu_items' ) ); |
|
47 | + add_action('admin_menu', array(__CLASS__, 'add_menu_items')); |
|
48 | 48 | |
49 | - self::$plugin = plugin_basename( SIMPLE_CALENDAR_MAIN_FILE ); |
|
49 | + self::$plugin = plugin_basename(SIMPLE_CALENDAR_MAIN_FILE); |
|
50 | 50 | |
51 | 51 | new Welcome(); |
52 | 52 | |
53 | 53 | // Links and meta content in plugins page. |
54 | - add_filter( 'plugin_action_links_' . self::$plugin, array( __CLASS__, 'plugin_action_links' ), 10, 5 ); |
|
55 | - add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 ); |
|
54 | + add_filter('plugin_action_links_'.self::$plugin, array(__CLASS__, 'plugin_action_links'), 10, 5); |
|
55 | + add_filter('plugin_row_meta', array(__CLASS__, 'plugin_row_meta'), 10, 2); |
|
56 | 56 | // Custom text in admin footer. |
57 | - add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); |
|
57 | + add_filter('admin_footer_text', array($this, 'admin_footer_text'), 1); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -66,41 +66,41 @@ discard block |
||
66 | 66 | |
67 | 67 | add_submenu_page( |
68 | 68 | self::$main_menu, |
69 | - __( 'Settings', 'google-calendar-events' ), |
|
70 | - __( 'Settings', 'google-calendar-events' ), |
|
69 | + __('Settings', 'google-calendar-events'), |
|
70 | + __('Settings', 'google-calendar-events'), |
|
71 | 71 | 'manage_options', |
72 | 72 | 'simple-calendar_settings', |
73 | - function () { |
|
74 | - $page = new Pages( 'settings' ); |
|
73 | + function() { |
|
74 | + $page = new Pages('settings'); |
|
75 | 75 | $page->html(); |
76 | 76 | } |
77 | 77 | ); |
78 | 78 | |
79 | 79 | add_submenu_page( |
80 | 80 | self::$main_menu, |
81 | - __( 'Add-ons', 'google-calendar-events' ), |
|
82 | - __( 'Add-ons', 'google-calendar-events' ), |
|
81 | + __('Add-ons', 'google-calendar-events'), |
|
82 | + __('Add-ons', 'google-calendar-events'), |
|
83 | 83 | 'manage_options', |
84 | 84 | 'simple-calendar_add_ons', |
85 | 85 | function() { |
86 | - $page = new Pages( 'add-ons' ); |
|
86 | + $page = new Pages('add-ons'); |
|
87 | 87 | $page->html(); |
88 | 88 | } |
89 | 89 | ); |
90 | 90 | |
91 | 91 | add_submenu_page( |
92 | 92 | self::$main_menu, |
93 | - __( 'Tools', 'google-calendar-events' ), |
|
94 | - __( 'Tools', 'google-calendar-events' ), |
|
93 | + __('Tools', 'google-calendar-events'), |
|
94 | + __('Tools', 'google-calendar-events'), |
|
95 | 95 | 'manage_options', |
96 | 96 | 'simple-calendar_tools', |
97 | - function () { |
|
98 | - $page = new Pages( 'tools' ); |
|
97 | + function() { |
|
98 | + $page = new Pages('tools'); |
|
99 | 99 | $page->html(); |
100 | 100 | } |
101 | 101 | ); |
102 | 102 | |
103 | - do_action( 'simcal_admin_add_menu_items' ); |
|
103 | + do_action('simcal_admin_add_menu_items'); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -113,15 +113,15 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return array |
115 | 115 | */ |
116 | - public static function plugin_action_links( $action_links, $file ) { |
|
116 | + public static function plugin_action_links($action_links, $file) { |
|
117 | 117 | |
118 | - if ( self::$plugin == $file ) { |
|
118 | + if (self::$plugin == $file) { |
|
119 | 119 | |
120 | 120 | $links = array(); |
121 | - $links['settings'] = '<a href="' . admin_url( 'edit.php?post_type=calendar&page=simple-calendar_settings' ) . '">' . __( 'Settings', 'google-calendar-events' ) . '</a>'; |
|
122 | - $links['feeds'] = '<a href="' . admin_url( 'edit.php?post_type=calendar' ) . '">' . __( 'Calendars', 'google-calendar-events' ) . '</a>'; |
|
121 | + $links['settings'] = '<a href="'.admin_url('edit.php?post_type=calendar&page=simple-calendar_settings').'">'.__('Settings', 'google-calendar-events').'</a>'; |
|
122 | + $links['feeds'] = '<a href="'.admin_url('edit.php?post_type=calendar').'">'.__('Calendars', 'google-calendar-events').'</a>'; |
|
123 | 123 | |
124 | - return apply_filters( 'simcal_plugin_action_links', array_merge( $links, $action_links ) ); |
|
124 | + return apply_filters('simcal_plugin_action_links', array_merge($links, $action_links)); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | return $action_links; |
@@ -137,15 +137,15 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @return array |
139 | 139 | */ |
140 | - public static function plugin_row_meta( $meta_links, $file ) { |
|
140 | + public static function plugin_row_meta($meta_links, $file) { |
|
141 | 141 | |
142 | - if ( self::$plugin == $file ) { |
|
142 | + if (self::$plugin == $file) { |
|
143 | 143 | |
144 | 144 | $links = array(); |
145 | - $links['add-ons'] = '<a href="' . simcal_ga_campaign_url( simcal_get_url( 'addons' ), 'core-plugin', 'plugin-listing' ) . '" target="_blank" >' . |
|
146 | - __( 'Add-ons', 'google-calendar-events' ) . '</a>'; |
|
145 | + $links['add-ons'] = '<a href="'.simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'plugin-listing').'" target="_blank" >'. |
|
146 | + __('Add-ons', 'google-calendar-events').'</a>'; |
|
147 | 147 | |
148 | - return apply_filters( 'simcal_plugin_action_links', array_merge( $meta_links, $links ) ); |
|
148 | + return apply_filters('simcal_plugin_action_links', array_merge($meta_links, $links)); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $meta_links; |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @return string|void |
164 | 164 | */ |
165 | - public function admin_footer_text( $footer_text ) { |
|
165 | + public function admin_footer_text($footer_text) { |
|
166 | 166 | |
167 | 167 | // Check to make sure we're on a SimpleCal admin page |
168 | 168 | $screen = simcal_is_admin_screen(); |
169 | - if ( $screen !== false ) { |
|
169 | + if ($screen !== false) { |
|
170 | 170 | |
171 | - if ( 'calendar' == $screen ) { |
|
171 | + if ('calendar' == $screen) { |
|
172 | 172 | |
173 | 173 | // Add Drip promo signup form (@see Newsletter meta box). |
174 | 174 | |
@@ -196,23 +196,23 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | // Change the footer text |
199 | - if ( ! get_option( 'simple-calendar_admin_footer_text_rated' ) ) { |
|
199 | + if ( ! get_option('simple-calendar_admin_footer_text_rated')) { |
|
200 | 200 | |
201 | 201 | $footer_text = sprintf( |
202 | - __( 'If you like <strong>Simple Calendar</strong> please leave us a %s★★★★★ rating on WordPress.org%s. A huge thank you in advance!', 'google-calendar-events' ), |
|
203 | - '<a href="https://wordpress.org/support/view/plugin-reviews/google-calendar-events?filter=5#postform" target="_blank" class="simcal-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'google-calendar-events' ) . '">', '</a>' |
|
202 | + __('If you like <strong>Simple Calendar</strong> please leave us a %s★★★★★ rating on WordPress.org%s. A huge thank you in advance!', 'google-calendar-events'), |
|
203 | + '<a href="https://wordpress.org/support/view/plugin-reviews/google-calendar-events?filter=5#postform" target="_blank" class="simcal-rating-link" data-rated="'.esc_attr__('Thanks :)', 'google-calendar-events').'">', '</a>' |
|
204 | 204 | ); |
205 | 205 | |
206 | 206 | $footer_text .= '<script type="text/javascript">'; |
207 | 207 | $footer_text .= "jQuery( 'a.simcal-rating-link' ).click( function() { |
208 | - jQuery.post( '" . \SimpleCalendar\plugin()->ajax_url() . "', { action: 'simcal_rated' } ); |
|
208 | + jQuery.post( '" . \SimpleCalendar\plugin()->ajax_url()."', { action: 'simcal_rated' } ); |
|
209 | 209 | jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) ); |
210 | 210 | });"; |
211 | 211 | $footer_text .= '</script>'; |
212 | 212 | |
213 | 213 | } else { |
214 | 214 | |
215 | - $footer_text = __( 'Thanks for using Simple Calendar!', 'google-calendar-events' ); |
|
215 | + $footer_text = __('Thanks for using Simple Calendar!', 'google-calendar-events'); |
|
216 | 216 | |
217 | 217 | } |
218 | 218 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | namespace SimpleCalendar\Admin; |
8 | 8 | |
9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
9 | +if ( ! defined('ABSPATH')) { |
|
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
@@ -25,19 +25,19 @@ discard block |
||
25 | 25 | public function __construct() { |
26 | 26 | |
27 | 27 | // Set an option if the user rated the plugin. |
28 | - add_action( 'wp_ajax_simcal_rated', array( $this, 'rate_plugin' ) ); |
|
28 | + add_action('wp_ajax_simcal_rated', array($this, 'rate_plugin')); |
|
29 | 29 | |
30 | 30 | // Set an option if the user rated the plugin. |
31 | - add_action( 'wp_ajax_simcal_clear_cache', array( $this, 'clear_cache' ) ); |
|
31 | + add_action('wp_ajax_simcal_clear_cache', array($this, 'clear_cache')); |
|
32 | 32 | |
33 | 33 | // Convert a datetime format. |
34 | - add_action( 'wp_ajax_simcal_date_i18n_input_preview', array( $this, 'date_i18n' ) ); |
|
34 | + add_action('wp_ajax_simcal_date_i18n_input_preview', array($this, 'date_i18n')); |
|
35 | 35 | |
36 | 36 | // Manage an add-on license activation or deactivation. |
37 | - add_action( 'wp_ajax_simcal_manage_add_on_license', array( $this, 'manage_add_on_license' ) ); |
|
37 | + add_action('wp_ajax_simcal_manage_add_on_license', array($this, 'manage_add_on_license')); |
|
38 | 38 | |
39 | 39 | // Reset add-ons licenses. |
40 | - add_action( 'wp_ajax_simcal_reset_add_ons_licenses', array( $this, 'reset_licenses' ) ); |
|
40 | + add_action('wp_ajax_simcal_reset_add_ons_licenses', array($this, 'reset_licenses')); |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function clear_cache() { |
50 | 50 | |
51 | - $id = isset( $_POST['id'] ) ? ( is_array( $_POST['id'] ) ? array_map( 'intval', $_POST['id'] ) : intval( $_POST['id'] ) ) : ''; |
|
51 | + $id = isset($_POST['id']) ? (is_array($_POST['id']) ? array_map('intval', $_POST['id']) : intval($_POST['id'])) : ''; |
|
52 | 52 | |
53 | - if ( ! empty( $id ) ) { |
|
54 | - simcal_delete_feed_transients( $id ); |
|
53 | + if ( ! empty($id)) { |
|
54 | + simcal_delete_feed_transients($id); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @since 3.0.0 |
62 | 62 | */ |
63 | 63 | public function rate_plugin() { |
64 | - update_option( 'simple-calendar_admin_footer_text_rated', date( 'Y-m-d', time() ) ); |
|
64 | + update_option('simple-calendar_admin_footer_text_rated', date('Y-m-d', time())); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function date_i18n() { |
73 | 73 | |
74 | - $value = isset( $_POST['value'] ) ? esc_attr( $_POST['value'] ) : ' '; |
|
75 | - $timestamp = isset( $_POST['timestamp'] ) ? absint( $_POST['timestamp'] ) : time(); |
|
74 | + $value = isset($_POST['value']) ? esc_attr($_POST['value']) : ' '; |
|
75 | + $timestamp = isset($_POST['timestamp']) ? absint($_POST['timestamp']) : time(); |
|
76 | 76 | |
77 | - wp_send_json_success( date_i18n( $value, $timestamp ) ); |
|
77 | + wp_send_json_success(date_i18n($value, $timestamp)); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -86,35 +86,35 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function manage_add_on_license() { |
88 | 88 | |
89 | - $addon = isset( $_POST['add_on'] ) ? sanitize_key( $_POST['add_on'] ) : false; |
|
90 | - $action = isset( $_POST['license_action'] ) ? esc_attr( $_POST['license_action'] ) : false; |
|
91 | - $key = isset( $_POST['license_key'] ) ? esc_attr( $_POST['license_key'] ) : ''; |
|
92 | - $nonce = isset( $_POST['nonce'] ) ? esc_attr( $_POST['nonce'] ) : ''; |
|
89 | + $addon = isset($_POST['add_on']) ? sanitize_key($_POST['add_on']) : false; |
|
90 | + $action = isset($_POST['license_action']) ? esc_attr($_POST['license_action']) : false; |
|
91 | + $key = isset($_POST['license_key']) ? esc_attr($_POST['license_key']) : ''; |
|
92 | + $nonce = isset($_POST['nonce']) ? esc_attr($_POST['nonce']) : ''; |
|
93 | 93 | |
94 | 94 | // Verify that there are valid variables to process. |
95 | - if ( false === $addon || ! in_array( $action, array( 'activate_license', 'deactivate_license' ) ) ) { |
|
96 | - wp_send_json_error( __( 'Add-on unspecified or invalid action.', 'google-calendar-events' ) ); |
|
95 | + if (false === $addon || ! in_array($action, array('activate_license', 'deactivate_license'))) { |
|
96 | + wp_send_json_error(__('Add-on unspecified or invalid action.', 'google-calendar-events')); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // Verify this request comes from the add-ons licenses activation settings page. |
100 | - if ( ! wp_verify_nonce( $nonce, 'simcal_license_manager' ) ) { |
|
101 | - wp_send_json_error( sprintf( __( 'An error occurred: %s', 'google-calendar-events' ), 'Nonce verification failed.' ) ); |
|
100 | + if ( ! wp_verify_nonce($nonce, 'simcal_license_manager')) { |
|
101 | + wp_send_json_error(sprintf(__('An error occurred: %s', 'google-calendar-events'), 'Nonce verification failed.')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | // Removes the prefix and converts simcal_{id_no} to {id_no}. |
105 | - $id = intval( substr( $addon, 7 ) ); |
|
105 | + $id = intval(substr($addon, 7)); |
|
106 | 106 | |
107 | 107 | // Data to send in API request. |
108 | 108 | $api_request = array( |
109 | 109 | 'edd_action' => $action, |
110 | 110 | 'license' => $key, |
111 | - 'item_id' => urlencode( $id ), |
|
111 | + 'item_id' => urlencode($id), |
|
112 | 112 | 'url' => home_url() |
113 | 113 | ); |
114 | 114 | |
115 | 115 | // Call the custom API. |
116 | 116 | $response = wp_remote_post( |
117 | - defined( 'SIMPLE_CALENDAR_STORE_URL' ) ? SIMPLE_CALENDAR_STORE_URL : simcal_get_url( 'home' ), |
|
117 | + defined('SIMPLE_CALENDAR_STORE_URL') ? SIMPLE_CALENDAR_STORE_URL : simcal_get_url('home'), |
|
118 | 118 | array( |
119 | 119 | 'timeout' => 15, |
120 | 120 | 'sslverify' => false, |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | ); |
124 | 124 | |
125 | 125 | // Update license in db. |
126 | - $keys = get_option( 'simple-calendar_settings_licenses', array() ); |
|
127 | - $keys['keys'][ $addon ] = $key; |
|
128 | - update_option( 'simple-calendar_settings_licenses', $keys ); |
|
126 | + $keys = get_option('simple-calendar_settings_licenses', array()); |
|
127 | + $keys['keys'][$addon] = $key; |
|
128 | + update_option('simple-calendar_settings_licenses', $keys); |
|
129 | 129 | |
130 | 130 | // Make sure there is a response. |
131 | - if ( is_wp_error( $response ) ) { |
|
132 | - wp_send_json_error( sprintf( __( 'There was an error processing your request: %s', 'google-calendar-events' ), $response->get_error_message() ) ); |
|
131 | + if (is_wp_error($response)) { |
|
132 | + wp_send_json_error(sprintf(__('There was an error processing your request: %s', 'google-calendar-events'), $response->get_error_message())); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | // Decode the license data and save. |
136 | - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); |
|
136 | + $license_data = json_decode(wp_remote_retrieve_body($response)); |
|
137 | 137 | $status = simcal_get_license_status(); |
138 | 138 | |
139 | - if ( ! empty( $license_data ) ) { |
|
139 | + if ( ! empty($license_data)) { |
|
140 | 140 | if ('deactivated' == $license_data->license) { |
141 | 141 | unset($status[$addon]); |
142 | 142 | update_option('simple-calendar_licenses_status', $status); |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | $message = 'valid' == $license_data->license ? 'valid' : __('License key is invalid.', 'google-calendar-events'); |
148 | 148 | wp_send_json_success($message); |
149 | 149 | } else { |
150 | - wp_send_json_error( '' ); |
|
150 | + wp_send_json_error(''); |
|
151 | 151 | } |
152 | 152 | } else { |
153 | - wp_send_json_error( __( 'An error has occurred, please try again.', 'google-calendar-events' ) ); |
|
153 | + wp_send_json_error(__('An error has occurred, please try again.', 'google-calendar-events')); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function reset_licenses() { |
163 | 163 | |
164 | - $nonce = isset( $_POST['nonce'] ) ? esc_attr( $_POST['nonce'] ) : ''; |
|
164 | + $nonce = isset($_POST['nonce']) ? esc_attr($_POST['nonce']) : ''; |
|
165 | 165 | |
166 | 166 | // Verify this request comes from the add-ons licenses activation settings page. |
167 | - if ( empty ( $nonce ) || ! wp_verify_nonce( $nonce, 'simcal_license_manager' ) ) { |
|
168 | - wp_send_json_error( sprintf( __( 'An error occurred: %s', 'google-calendar-events' ), 'Nonce verification failed.' ) ); |
|
167 | + if (empty ($nonce) || ! wp_verify_nonce($nonce, 'simcal_license_manager')) { |
|
168 | + wp_send_json_error(sprintf(__('An error occurred: %s', 'google-calendar-events'), 'Nonce verification failed.')); |
|
169 | 169 | } |
170 | 170 | |
171 | - delete_option( 'simple-calendar_settings_licenses' ); |
|
172 | - delete_option( 'simple-calendar_licenses_status' ); |
|
171 | + delete_option('simple-calendar_settings_licenses'); |
|
172 | + delete_option('simple-calendar_licenses_status'); |
|
173 | 173 | |
174 | - wp_send_json_success( 'success' ); |
|
174 | + wp_send_json_success('success'); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use SimpleCalendar\Abstracts\Admin_Page; |
10 | 10 | |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function __construct() { |
30 | 30 | $this->id = 'advanced'; |
31 | 31 | $this->option_group = 'settings'; |
32 | - $this->label = __( 'Advanced', 'google-calendar-events' ); |
|
32 | + $this->label = __('Advanced', 'google-calendar-events'); |
|
33 | 33 | //$this->description = __( 'Advanced settings.', 'google-calendar-events' ); |
34 | 34 | $this->sections = $this->add_sections(); |
35 | 35 | $this->fields = $this->add_fields(); |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | * @return array |
44 | 44 | */ |
45 | 45 | public function add_sections() { |
46 | - return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', array( |
|
46 | + return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', array( |
|
47 | 47 | 'assets' => array( |
48 | - 'title' => __( 'Styles', 'google-calendar-events' ), |
|
49 | - 'description' => __( 'Manage front end assets that handle the calendars appearance.', 'google-calendar-events' ) |
|
48 | + 'title' => __('Styles', 'google-calendar-events'), |
|
49 | + 'description' => __('Manage front end assets that handle the calendars appearance.', 'google-calendar-events') |
|
50 | 50 | ), |
51 | 51 | 'installation' => array( |
52 | - 'title' => __( 'Installation', 'google-calendar-events' ), |
|
53 | - 'description' => __( 'Manage your data (plugin settings and saved calendars).', 'google-calendar-events' ) |
|
52 | + 'title' => __('Installation', 'google-calendar-events'), |
|
53 | + 'description' => __('Manage your data (plugin settings and saved calendars).', 'google-calendar-events') |
|
54 | 54 | ) |
55 | - ) ); |
|
55 | + )); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -65,41 +65,41 @@ discard block |
||
65 | 65 | public function add_fields() { |
66 | 66 | |
67 | 67 | $fields = array(); |
68 | - $this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id ); |
|
68 | + $this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id); |
|
69 | 69 | |
70 | - foreach ( $this->sections as $section => $a ) : |
|
70 | + foreach ($this->sections as $section => $a) : |
|
71 | 71 | |
72 | - if ( 'assets' == $section ) { |
|
72 | + if ('assets' == $section) { |
|
73 | 73 | |
74 | - $fields[ $section ] = array( |
|
74 | + $fields[$section] = array( |
|
75 | 75 | 'disable_css' => array( |
76 | - 'title' => __( 'Disable CSS', 'google-calendar-events' ), |
|
77 | - 'tooltip' => __( 'If ticked, this option will prevent all front end stylesheets to load. This also includes all add-on stylesheets.', 'google-calendar-events' ), |
|
76 | + 'title' => __('Disable CSS', 'google-calendar-events'), |
|
77 | + 'tooltip' => __('If ticked, this option will prevent all front end stylesheets to load. This also includes all add-on stylesheets.', 'google-calendar-events'), |
|
78 | 78 | 'type' => 'checkbox', |
79 | - 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][disable_css]', |
|
80 | - 'id' => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-disable-css', |
|
81 | - 'value' => $this->get_option_value( $section, 'disable_css' ) |
|
79 | + 'name' => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][disable_css]', |
|
80 | + 'id' => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$section.'-disable-css', |
|
81 | + 'value' => $this->get_option_value($section, 'disable_css') |
|
82 | 82 | ), |
83 | 83 | ); |
84 | 84 | |
85 | - } elseif ( 'installation' == $section ) { |
|
85 | + } elseif ('installation' == $section) { |
|
86 | 86 | |
87 | - $fields[ $section ] = array( |
|
87 | + $fields[$section] = array( |
|
88 | 88 | 'delete_settings' => array( |
89 | - 'title' => __( 'Delete settings', 'google-calendar-events' ), |
|
90 | - 'tooltip' => __( 'Tick this option if you want to wipe this plugin settings from database when uninstalling.', 'google-calendar-events' ), |
|
89 | + 'title' => __('Delete settings', 'google-calendar-events'), |
|
90 | + 'tooltip' => __('Tick this option if you want to wipe this plugin settings from database when uninstalling.', 'google-calendar-events'), |
|
91 | 91 | 'type' => 'checkbox', |
92 | - 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][delete_settings]', |
|
93 | - 'id' => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-delete-settings', |
|
94 | - 'value' => $this->get_option_value( $section, 'delete_settings' ), |
|
92 | + 'name' => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][delete_settings]', |
|
93 | + 'id' => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$section.'-delete-settings', |
|
94 | + 'value' => $this->get_option_value($section, 'delete_settings'), |
|
95 | 95 | ), |
96 | 96 | 'erase_data' => array( |
97 | - 'title' => __( 'Erase calendar data', 'google-calendar-events' ), |
|
98 | - 'tooltip' => __( 'By default your data will be retained in database even after uninstall. Tick this option if you want to delete all your calendar data when uninstalling.', 'google-calendar-events' ), |
|
97 | + 'title' => __('Erase calendar data', 'google-calendar-events'), |
|
98 | + 'tooltip' => __('By default your data will be retained in database even after uninstall. Tick this option if you want to delete all your calendar data when uninstalling.', 'google-calendar-events'), |
|
99 | 99 | 'type' => 'checkbox', |
100 | - 'name' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][erase_data]', |
|
101 | - 'id' => 'simple-calendar_' . $this->option_group . '_' . $this->id . '-delete-data', |
|
102 | - 'value' => $this->get_option_value( $section, 'erase_data' ), |
|
100 | + 'name' => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][erase_data]', |
|
101 | + 'id' => 'simple-calendar_'.$this->option_group.'_'.$this->id.'-delete-data', |
|
102 | + 'value' => $this->get_option_value($section, 'erase_data'), |
|
103 | 103 | ) |
104 | 104 | ); |
105 | 105 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | endforeach; |
109 | 109 | |
110 | - return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields ); |
|
110 | + return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use SimpleCalendar\Abstracts\Admin_Page; |
10 | 10 | |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | |
29 | 29 | $this->id = $tab = 'add-ons'; |
30 | 30 | $this->option_group = $page = 'add-ons'; |
31 | - $this->label = __( 'Add-ons', 'google-calendar-events' ); |
|
31 | + $this->label = __('Add-ons', 'google-calendar-events'); |
|
32 | 32 | $this->description = ''; |
33 | 33 | $this->sections = $this->add_sections(); |
34 | 34 | $this->fields = $this->add_fields(); |
35 | 35 | |
36 | 36 | // Disable the submit button for this page. |
37 | - add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } ); |
|
37 | + add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } ); |
|
38 | 38 | |
39 | 39 | // Add html. |
40 | - add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( $this, 'html' ) ); |
|
40 | + add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array($this, 'html')); |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | // @todo pull data from simplecalendar.io to showcase add-ons |
52 | 52 | $js_redirect = '<script type="text/javascript">'; |
53 | - $js_redirect .= 'window.location = "' . simcal_ga_campaign_url( simcal_get_url( 'addons' ), 'core-plugin', 'plugin-submenu-link', true ) . '"'; |
|
53 | + $js_redirect .= 'window.location = "'.simcal_ga_campaign_url(simcal_get_url('addons'), 'core-plugin', 'plugin-submenu-link', true).'"'; |
|
54 | 54 | $js_redirect .= '</script>'; |
55 | 55 | |
56 | 56 | echo $js_redirect; |
@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use Carbon\Carbon; |
10 | 10 | |
11 | -if ( ! defined( 'ABSPATH' ) ) { |
|
11 | +if ( ! defined('ABSPATH')) { |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -239,35 +239,35 @@ discard block |
||
239 | 239 | * |
240 | 240 | * @param array $event |
241 | 241 | */ |
242 | - public function __construct( array $event ) { |
|
242 | + public function __construct(array $event) { |
|
243 | 243 | |
244 | 244 | /* ================= * |
245 | 245 | * Event Identifiers * |
246 | 246 | * ================= */ |
247 | 247 | |
248 | 248 | // Event unique id. |
249 | - if ( ! empty( $event['uid'] ) ) { |
|
250 | - $this->uid = esc_attr( $event['uid'] ); |
|
249 | + if ( ! empty($event['uid'])) { |
|
250 | + $this->uid = esc_attr($event['uid']); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | // iCal ID |
254 | - if ( ! empty( $event['ical_id'] ) ) { |
|
255 | - $this->ical_id = esc_attr( $event['ical_id'] ); |
|
254 | + if ( ! empty($event['ical_id'])) { |
|
255 | + $this->ical_id = esc_attr($event['ical_id']); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | // Event source. |
259 | - if ( ! empty( $event['source'] ) ) { |
|
260 | - $this->source = esc_attr( $event['source'] ); |
|
259 | + if ( ! empty($event['source'])) { |
|
260 | + $this->source = esc_attr($event['source']); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // Event parent calendar id. |
264 | - if ( ! empty( $event['calendar'] ) ) { |
|
265 | - $this->calendar = max( intval( $event['calendar'] ), 0 ); |
|
264 | + if ( ! empty($event['calendar'])) { |
|
265 | + $this->calendar = max(intval($event['calendar']), 0); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | // Event parent calendar timezone. |
269 | - if ( ! empty( $event['timezone'] ) ) { |
|
270 | - $this->timezone = esc_attr( $event['timezone'] ); |
|
269 | + if ( ! empty($event['timezone'])) { |
|
270 | + $this->timezone = esc_attr($event['timezone']); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /* ============= * |
@@ -275,23 +275,23 @@ discard block |
||
275 | 275 | * ============= */ |
276 | 276 | |
277 | 277 | // Event title. |
278 | - if ( ! empty( $event['title'] ) ) { |
|
279 | - $this->title = esc_html( $event['title'] ); |
|
278 | + if ( ! empty($event['title'])) { |
|
279 | + $this->title = esc_html($event['title']); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | // Event description. |
283 | - if ( ! empty( $event['description'] ) ) { |
|
284 | - $this->description = wp_kses_post( $event['description'] ); |
|
283 | + if ( ! empty($event['description'])) { |
|
284 | + $this->description = wp_kses_post($event['description']); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | // Event link URL. |
288 | - if ( ! empty( $event['link'] ) ) { |
|
289 | - $this->link = esc_url_raw( $event['link'] ); |
|
288 | + if ( ! empty($event['link'])) { |
|
289 | + $this->link = esc_url_raw($event['link']); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | // Event visibility. |
293 | - if ( ! empty( $event['visibility'] ) ) { |
|
294 | - $this->visibility = esc_attr( $event['visibility'] ); |
|
293 | + if ( ! empty($event['visibility'])) { |
|
294 | + $this->visibility = esc_attr($event['visibility']); |
|
295 | 295 | $this->public = $this->visibility == 'public' ? true : false; |
296 | 296 | } |
297 | 297 | |
@@ -299,34 +299,34 @@ discard block |
||
299 | 299 | * Event Start * |
300 | 300 | * =========== */ |
301 | 301 | |
302 | - if ( ! empty( $event['start'] ) ) { |
|
303 | - $this->start = is_numeric( $event['start'] ) ? intval( $event['start'] ) : 0; |
|
304 | - if ( ! empty( $event['start_utc'] ) ) { |
|
305 | - $this->start_utc = is_numeric( $event['start_utc'] ) ? intval( $event['start_utc'] ) : 0; |
|
302 | + if ( ! empty($event['start'])) { |
|
303 | + $this->start = is_numeric($event['start']) ? intval($event['start']) : 0; |
|
304 | + if ( ! empty($event['start_utc'])) { |
|
305 | + $this->start_utc = is_numeric($event['start_utc']) ? intval($event['start_utc']) : 0; |
|
306 | 306 | } |
307 | - if ( ! empty( $event['start_timezone'] ) ) { |
|
308 | - $this->start_timezone = esc_attr( $event['start_timezone'] ); |
|
307 | + if ( ! empty($event['start_timezone'])) { |
|
308 | + $this->start_timezone = esc_attr($event['start_timezone']); |
|
309 | 309 | } |
310 | - $this->start_dt = Carbon::createFromTimestamp( $this->start, $this->start_timezone ); |
|
311 | - $start_location = isset( $event['start_location'] ) ? $event['start_location'] : ''; |
|
312 | - $this->start_location = $this->esc_location( $start_location ); |
|
310 | + $this->start_dt = Carbon::createFromTimestamp($this->start, $this->start_timezone); |
|
311 | + $start_location = isset($event['start_location']) ? $event['start_location'] : ''; |
|
312 | + $this->start_location = $this->esc_location($start_location); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /* ========= * |
316 | 316 | * Event End * |
317 | 317 | * ========= */ |
318 | 318 | |
319 | - if ( ! empty( $event['end'] ) ) { |
|
320 | - $this->end = is_numeric( $event['end'] ) ? intval( $event['end'] ): false; |
|
321 | - if ( ! empty( $event['end_timezone'] ) ) { |
|
322 | - $this->end_timezone = esc_attr( $event['end_timezone'] ); |
|
319 | + if ( ! empty($event['end'])) { |
|
320 | + $this->end = is_numeric($event['end']) ? intval($event['end']) : false; |
|
321 | + if ( ! empty($event['end_timezone'])) { |
|
322 | + $this->end_timezone = esc_attr($event['end_timezone']); |
|
323 | 323 | } |
324 | - if ( ! empty( $event['end_utc'] ) ) { |
|
325 | - $this->end_utc = is_numeric( $event['end_utc'] ) ? intval( $event['end_utc'] ) : false; |
|
326 | - $this->end_dt = Carbon::createFromTimestamp( $this->end, $this->end_timezone ); |
|
324 | + if ( ! empty($event['end_utc'])) { |
|
325 | + $this->end_utc = is_numeric($event['end_utc']) ? intval($event['end_utc']) : false; |
|
326 | + $this->end_dt = Carbon::createFromTimestamp($this->end, $this->end_timezone); |
|
327 | 327 | } |
328 | - $end_location = isset( $event['end_location'] ) ? $event['end_location'] : ''; |
|
329 | - $this->end_location = $this->esc_location( $end_location ); |
|
328 | + $end_location = isset($event['end_location']) ? $event['end_location'] : ''; |
|
329 | + $this->end_location = $this->esc_location($end_location); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /* ================== * |
@@ -334,18 +334,18 @@ discard block |
||
334 | 334 | * ================== */ |
335 | 335 | |
336 | 336 | // Whole day event. |
337 | - if ( ! empty( $event['whole_day'] ) ) { |
|
338 | - $this->whole_day = true === $event['whole_day'] ? true: false; |
|
337 | + if ( ! empty($event['whole_day'])) { |
|
338 | + $this->whole_day = true === $event['whole_day'] ? true : false; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | // Multi day event. |
342 | - if ( ! empty( $event['multiple_days'] ) ) { |
|
343 | - $this->multiple_days = max( absint( $event['multiple_days'] ), 1 ); |
|
342 | + if ( ! empty($event['multiple_days'])) { |
|
343 | + $this->multiple_days = max(absint($event['multiple_days']), 1); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | // Event recurrence. |
347 | - if ( isset( $event['recurrence'] ) ) { |
|
348 | - $this->recurrence = ! empty( $event['recurrence'] ) ? $event['recurrence'] : false; |
|
347 | + if (isset($event['recurrence'])) { |
|
348 | + $this->recurrence = ! empty($event['recurrence']) ? $event['recurrence'] : false; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /* ========== * |
@@ -353,18 +353,18 @@ discard block |
||
353 | 353 | * ========== */ |
354 | 354 | |
355 | 355 | // Event has venue(s). |
356 | - if ( $this->start_location['venue'] || $this->end_location['venue'] ) { |
|
356 | + if ($this->start_location['venue'] || $this->end_location['venue']) { |
|
357 | 357 | $this->venue = true; |
358 | 358 | } |
359 | 359 | |
360 | 360 | // Event meta. |
361 | - if ( ! empty( $event['meta'] ) ) { |
|
362 | - $this->meta = is_array( $event['meta'] ) ? $event['meta'] : array(); |
|
361 | + if ( ! empty($event['meta'])) { |
|
362 | + $this->meta = is_array($event['meta']) ? $event['meta'] : array(); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | // Event template. |
366 | - if ( ! empty( $event['template'] ) ) { |
|
367 | - $this->template = wp_kses_post( $event['template'] ); |
|
366 | + if ( ! empty($event['template'])) { |
|
367 | + $this->template = wp_kses_post($event['template']); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | } |
@@ -379,27 +379,27 @@ discard block |
||
379 | 379 | * |
380 | 380 | * @return array |
381 | 381 | */ |
382 | - private function esc_location( $var = '' ) { |
|
382 | + private function esc_location($var = '') { |
|
383 | 383 | |
384 | 384 | $location = array(); |
385 | 385 | |
386 | - if ( is_string( $var ) ) { |
|
386 | + if (is_string($var)) { |
|
387 | 387 | $var = array( |
388 | 388 | 'name' => $var, |
389 | 389 | 'address' => $var, |
390 | 390 | ); |
391 | - } elseif ( is_bool( $var ) || is_null( $var ) ) { |
|
391 | + } elseif (is_bool($var) || is_null($var)) { |
|
392 | 392 | $var = array(); |
393 | 393 | } else { |
394 | 394 | $var = (array) $var; |
395 | 395 | } |
396 | 396 | |
397 | - $location['name'] = isset( $var['name'] ) ? esc_attr( strip_tags( $var['name'] ) ) : ''; |
|
398 | - $location['address'] = isset( $var['address'] ) ? esc_attr( strip_tags( $var['address'] ) ) : ''; |
|
399 | - $location['lat'] = isset( $var['lat'] ) ? $this->esc_coordinate( $var['lat'] ) : 0; |
|
400 | - $location['lng'] = isset( $var['lng'] ) ? $this->esc_coordinate( $var['lng'] ) : 0; |
|
397 | + $location['name'] = isset($var['name']) ? esc_attr(strip_tags($var['name'])) : ''; |
|
398 | + $location['address'] = isset($var['address']) ? esc_attr(strip_tags($var['address'])) : ''; |
|
399 | + $location['lat'] = isset($var['lat']) ? $this->esc_coordinate($var['lat']) : 0; |
|
400 | + $location['lng'] = isset($var['lng']) ? $this->esc_coordinate($var['lng']) : 0; |
|
401 | 401 | |
402 | - if ( ! empty( $location['name'] ) || ! empty( $location['address'] ) ) { |
|
402 | + if ( ! empty($location['name']) || ! empty($location['address'])) { |
|
403 | 403 | $location['venue'] = true; |
404 | 404 | } else { |
405 | 405 | $location['venue'] = false; |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @return int|float |
420 | 420 | */ |
421 | - private function esc_coordinate( $latlng = 0 ) { |
|
422 | - return is_numeric( $latlng ) ? floatval( $latlng ) : 0; |
|
421 | + private function esc_coordinate($latlng = 0) { |
|
422 | + return is_numeric($latlng) ? floatval($latlng) : 0; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
@@ -432,8 +432,8 @@ discard block |
||
432 | 432 | * |
433 | 433 | * @return bool |
434 | 434 | */ |
435 | - public function set_timezone( $tz ) { |
|
436 | - if ( in_array( $tz, timezone_identifiers_list() ) ) { |
|
435 | + public function set_timezone($tz) { |
|
436 | + if (in_array($tz, timezone_identifiers_list())) { |
|
437 | 437 | $this->timezone = $tz; |
438 | 438 | return true; |
439 | 439 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | * @return bool |
460 | 460 | */ |
461 | 461 | public function starts_today() { |
462 | - return $this->start_dt->setTimezone( $this->timezone )->isToday(); |
|
462 | + return $this->start_dt->setTimezone($this->timezone)->isToday(); |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | * @return bool |
471 | 471 | */ |
472 | 472 | public function ends_today() { |
473 | - return ! is_null( $this->end_dt ) ? $this->end_dt->setTimezone( $this->timezone )->isToday() : true; |
|
473 | + return ! is_null($this->end_dt) ? $this->end_dt->setTimezone($this->timezone)->isToday() : true; |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | * @return bool |
482 | 482 | */ |
483 | 483 | public function starts_tomorrow() { |
484 | - return $this->start_dt->setTimezone( $this->timezone )->isTomorrow(); |
|
484 | + return $this->start_dt->setTimezone($this->timezone)->isTomorrow(); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | /** |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | * @return bool |
493 | 493 | */ |
494 | 494 | public function ends_tomorrow() { |
495 | - return ! is_null( $this->end_dt ) ? $this->end_dt->setTimezone( $this->timezone )->isTomorrow() : false; |
|
495 | + return ! is_null($this->end_dt) ? $this->end_dt->setTimezone($this->timezone)->isTomorrow() : false; |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | /** |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * @return bool |
504 | 504 | */ |
505 | 505 | public function started_yesterday() { |
506 | - return $this->start_dt->setTimezone( $this->timezone )->isYesterday(); |
|
506 | + return $this->start_dt->setTimezone($this->timezone)->isYesterday(); |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | /** |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | * @return bool |
515 | 515 | */ |
516 | 516 | public function ended_yesterday() { |
517 | - return ! is_null( $this->end_dt ) ? $this->end_dt->setTimezone( $this->timezone )->isYesterday() : false; |
|
517 | + return ! is_null($this->end_dt) ? $this->end_dt->setTimezone($this->timezone)->isYesterday() : false; |
|
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | * @return bool |
526 | 526 | */ |
527 | 527 | public function starts_future() { |
528 | - return $this->start_dt->setTimezone( $this->timezone )->isFuture(); |
|
528 | + return $this->start_dt->setTimezone($this->timezone)->isFuture(); |
|
529 | 529 | } |
530 | 530 | |
531 | 531 | /** |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | * @return bool |
537 | 537 | */ |
538 | 538 | public function ends_future() { |
539 | - return ! is_null( $this->end_dt ) ? $this->end_dt->setTimezone( $this->timezone )->isFuture() : false; |
|
539 | + return ! is_null($this->end_dt) ? $this->end_dt->setTimezone($this->timezone)->isFuture() : false; |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | /** |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | * @return bool |
548 | 548 | */ |
549 | 549 | public function started_past() { |
550 | - return $this->start_dt->setTimezone( $this->timezone )->isPast(); |
|
550 | + return $this->start_dt->setTimezone($this->timezone)->isPast(); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | /** |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | * @return bool |
559 | 559 | */ |
560 | 560 | public function ended_past() { |
561 | - return ! is_null( $this->end_dt ) ? $this->end_dt->setTimezone( $this->timezone )->isPast() : false; |
|
561 | + return ! is_null($this->end_dt) ? $this->end_dt->setTimezone($this->timezone)->isPast() : false; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | /** |
@@ -570,9 +570,9 @@ discard block |
||
570 | 570 | * |
571 | 571 | * @return string |
572 | 572 | */ |
573 | - public function get_color( $default = '' ) { |
|
574 | - if ( isset( $this->meta['color'] ) ) { |
|
575 | - return ! empty( $this->meta['color'] ) ? esc_attr( $this->meta['color'] ) : $default; |
|
573 | + public function get_color($default = '') { |
|
574 | + if (isset($this->meta['color'])) { |
|
575 | + return ! empty($this->meta['color']) ? esc_attr($this->meta['color']) : $default; |
|
576 | 576 | } |
577 | 577 | return $default; |
578 | 578 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | * @return array |
586 | 586 | */ |
587 | 587 | public function get_attachments() { |
588 | - return isset( $this->meta['attachments'] ) ? $this->meta['attachments'] : array(); |
|
588 | + return isset($this->meta['attachments']) ? $this->meta['attachments'] : array(); |
|
589 | 589 | } |
590 | 590 | |
591 | 591 | /** |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | * @return array |
597 | 597 | */ |
598 | 598 | public function get_attendees() { |
599 | - return isset( $this->meta['attendees'] ) ? $this->meta['attendees'] : array(); |
|
599 | + return isset($this->meta['attendees']) ? $this->meta['attendees'] : array(); |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | * @return array |
608 | 608 | */ |
609 | 609 | public function get_organizer() { |
610 | - return isset( $this->meta['organizer'] ) ? $this->meta['organizer'] : array(); |
|
610 | + return isset($this->meta['organizer']) ? $this->meta['organizer'] : array(); |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | } |
@@ -414,7 +414,7 @@ |
||
414 | 414 | * @since 3.0.0 |
415 | 415 | * @access private |
416 | 416 | * |
417 | - * @param int|float $latlng |
|
417 | + * @param integer $latlng |
|
418 | 418 | * |
419 | 419 | * @return int|float |
420 | 420 | */ |