@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | if ( lasso_user_can('edit_posts')) { |
22 | 22 | |
23 | 23 | /** Returns the time offset from UTC |
24 | - */ |
|
24 | + */ |
|
25 | 25 | function get_UTC_offset() { |
26 | 26 | $origin_dtz = new \DateTimeZone(get_option('timezone_string')); |
27 | 27 | $origin_dt = new \DateTime("now", $origin_dtz); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
33 | 33 | |
34 | - //don't load autocomplete if it's a stockholm theme |
|
34 | + //don't load autocomplete if it's a stockholm theme |
|
35 | 35 | $themename = wp_get_theme()->get('Name'); |
36 | 36 | if ($themename !='Stockholm' ) { |
37 | 37 | wp_enqueue_script('jquery-ui-autocomplete'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $tz_offset = get_UTC_offset(); |
100 | 100 | $post_date = get_the_time('U', $postid); |
101 | 101 | $time = (time()+$tz_offset); |
102 | - $delta = $time - $post_date; |
|
102 | + $delta = $time - $post_date; |
|
103 | 103 | |
104 | 104 | $strings = array( |
105 | 105 | 'save' => __('Save','lasso'), |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
152 | 152 | |
153 | 153 | |
154 | - if ($allow_change_date) { |
|
155 | - $permalink = get_site_url().'/?p='.$postid; |
|
156 | - } else { |
|
157 | - $permalink = get_permalink($postid); |
|
158 | - } |
|
154 | + if ($allow_change_date) { |
|
155 | + $permalink = get_site_url().'/?p='.$postid; |
|
156 | + } else { |
|
157 | + $permalink = get_permalink($postid); |
|
158 | + } |
|
159 | 159 | |
160 | 160 | // rest api |
161 | 161 | $rest_nonce = ''; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | 'customFields' => $custom_fields, |
248 | 248 | 'clickToInsert' => ($insert_comp_ui =='click'), |
249 | 249 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
250 | - 'rtl' => is_rtl(), |
|
250 | + 'rtl' => is_rtl(), |
|
251 | 251 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
252 | 252 | ); |
253 | 253 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | |
258 | 258 | if (!$using_restapiv2) { |
259 | - // enqueue REST API V1 |
|
259 | + // enqueue REST API V1 |
|
260 | 260 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
261 | 261 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
262 | 262 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | if ($show_color) { |
273 | 273 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
274 | 274 | } else { |
275 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
275 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
276 | 276 | } |
277 | 277 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
278 | 278 |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
205 | 205 | |
206 | 206 | // mobile styles |
207 | - $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
207 | + $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
|
208 | 208 | $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
209 | 209 | |
210 | 210 | //show color |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | </div> |
485 | 485 | <?php |
486 | 486 | if ($allow_change_date) { |
487 | - $dateformat = get_option( 'date_format' ); |
|
487 | + $dateformat = get_option( 'date_format' ); |
|
488 | 488 | ?> |
489 | 489 | <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
490 | 490 | <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | <?php |
598 | 598 | if ( !empty( $types ) ) { |
599 | 599 | // get the first element |
600 | - $type = key($types); |
|
600 | + $type = key($types); |
|
601 | 601 | $type = preg_replace( '/s\b/','', $type ); |
602 | 602 | printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
603 | 603 | } |
@@ -625,8 +625,8 @@ discard block |
||
625 | 625 | global $post; |
626 | 626 | |
627 | 627 | global $wp_post_types; |
628 | - $labels = &$wp_post_types['post']->labels; |
|
629 | - $labels->name = 'Articles'; |
|
628 | + $labels = &$wp_post_types['post']->labels; |
|
629 | + $labels->name = 'Articles'; |
|
630 | 630 | |
631 | 631 | ob_start(); |
632 | 632 | |
@@ -869,9 +869,9 @@ discard block |
||
869 | 869 | $return .= '</form>'; |
870 | 870 | |
871 | 871 | // extra JS codes |
872 | - if (isset($shortcode['codes'])) { |
|
873 | - $return .= $shortcode['codes']; |
|
874 | - } |
|
872 | + if (isset($shortcode['codes'])) { |
|
873 | + $return .= $shortcode['codes']; |
|
874 | + } |
|
875 | 875 | $blob[$slug] = $return; |
876 | 876 | } |
877 | 877 | |
@@ -920,23 +920,23 @@ discard block |
||
920 | 920 | * @return string |
921 | 921 | */ |
922 | 922 | function lasso_editor_adjustBrightness($hex, $steps) { |
923 | - $steps = max(-255, min(255, $steps)); |
|
923 | + $steps = max(-255, min(255, $steps)); |
|
924 | 924 | |
925 | - // Normalize into a six character long hex string |
|
926 | - $hex = str_replace('#', '', $hex); |
|
927 | - if (strlen($hex) == 3) { |
|
928 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
929 | - } |
|
925 | + // Normalize into a six character long hex string |
|
926 | + $hex = str_replace('#', '', $hex); |
|
927 | + if (strlen($hex) == 3) { |
|
928 | + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
929 | + } |
|
930 | 930 | |
931 | - // Split into three parts: R, G and B |
|
932 | - $color_parts = str_split($hex, 2); |
|
933 | - $return = '#'; |
|
931 | + // Split into three parts: R, G and B |
|
932 | + $color_parts = str_split($hex, 2); |
|
933 | + $return = '#'; |
|
934 | 934 | |
935 | - foreach ($color_parts as $color) { |
|
936 | - $color = hexdec($color); // Convert to decimal |
|
937 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
938 | - $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
939 | - } |
|
935 | + foreach ($color_parts as $color) { |
|
936 | + $color = hexdec($color); // Convert to decimal |
|
937 | + $color = max(0,min(255,$color + $steps)); // Adjust color |
|
938 | + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
|
939 | + } |
|
940 | 940 | |
941 | - return $return; |
|
941 | + return $return; |
|
942 | 942 | } |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | |
100 | 100 | foreach ( $pages as $page ) { |
101 | 101 | wp_enqueue_media(); |
102 | - wp_enqueue_style( 'wp-color-picker'); |
|
103 | - wp_enqueue_script( 'wp-color-picker'); |
|
102 | + wp_enqueue_style( 'wp-color-picker'); |
|
103 | + wp_enqueue_script( 'wp-color-picker'); |
|
104 | 104 | |
105 | 105 | wp_enqueue_script( 'lasso-editor-settings-script', LASSO_URL.'/admin/assets/js/lasso-editor-settings.js', array( 'jquery','wp-color-picker' ), LASSO_VERSION, true ); |
106 | 106 | wp_enqueue_style( 'lasso-editor-settings-style', LASSO_URL.'/admin/assets/css/lasso-editor-settings.css', LASSO_VERSION ); |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * Adds an admin notice reminding the user if their license key has not been saved |
|
135 | - * |
|
136 | - * @since 0.9.7 |
|
137 | - * @todo make dismissible |
|
138 | - */ |
|
134 | + * Adds an admin notice reminding the user if their license key has not been saved |
|
135 | + * |
|
136 | + * @since 0.9.7 |
|
137 | + * @todo make dismissible |
|
138 | + */ |
|
139 | 139 | public function license_nag(){ |
140 | 140 | |
141 | 141 | $screen = get_current_screen(); |
@@ -156,26 +156,26 @@ discard block |
||
156 | 156 | |
157 | 157 | if ( empty( $license ) ) { |
158 | 158 | |
159 | - printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
159 | + printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link ); |
|
160 | 160 | |
161 | - } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
161 | + } else if ( 'invalid' == $status ){ // license key entered wrong or something |
|
162 | 162 | |
163 | 163 | printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link ); |
164 | 164 | |
165 | - } else if ( empty( $status ) ){ // license key saved but not activated |
|
165 | + } else if ( empty( $status ) ){ // license key saved but not activated |
|
166 | 166 | |
167 | 167 | printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link ); |
168 | 168 | |
169 | - } |
|
169 | + } |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
175 | - * Process hiding the dimiss |
|
176 | - * |
|
177 | - * @since 0.9.7 |
|
178 | - */ |
|
175 | + * Process hiding the dimiss |
|
176 | + * |
|
177 | + * @since 0.9.7 |
|
178 | + */ |
|
179 | 179 | public function dismiss_nag() { |
180 | 180 | |
181 | 181 | if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) { |