@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | |
12 | 12 | public function __construct() { |
13 | 13 | |
14 | - $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
14 | + $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * Draw the modal used to house the walk through |
|
22 | - * @since 0.6 |
|
23 | - */ |
|
21 | + * Draw the modal used to house the walk through |
|
22 | + * @since 0.6 |
|
23 | + */ |
|
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | 26 | $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Draw the inner slides for the welcome walkthrough |
|
84 | - * @since 0.6 |
|
85 | - */ |
|
83 | + * Draw the inner slides for the welcome walkthrough |
|
84 | + * @since 0.6 |
|
85 | + */ |
|
86 | 86 | public function tour_slides() { ?> |
87 | 87 | |
88 | 88 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action('wp_footer', array($this, 'draw_tour')); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | - $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
|
26 | + $tour_hidden = get_user_meta(get_current_user_ID(), 'lasso_hide_tour', true); |
|
27 | 27 | |
28 | - if ( lasso_user_can() && !$tour_hidden ) { |
|
28 | + if (lasso_user_can() && !$tour_hidden) { |
|
29 | 29 | |
30 | 30 | global $post; |
31 | 31 | |
32 | - $nonce = wp_create_nonce( 'lasso-editor-tour' ); |
|
32 | + $nonce = wp_create_nonce('lasso-editor-tour'); |
|
33 | 33 | |
34 | 34 | // let users add custom css classes |
35 | - $custom_classes = apply_filters( 'lasso_modal_tour_classes', '' ); |
|
35 | + $custom_classes = apply_filters('lasso_modal_tour_classes', ''); |
|
36 | 36 | |
37 | 37 | ?> |
38 | - <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class( $custom_classes );?>"> |
|
38 | + <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class($custom_classes); ?>"> |
|
39 | 39 | <script> |
40 | 40 | (function( $ ) { |
41 | 41 | $(document).ready(function(){ |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | </script> |
57 | 57 | <div class="lasso--modal__inner"> |
58 | 58 | |
59 | - <?php echo self::tour_slides();?> |
|
59 | + <?php echo self::tour_slides(); ?> |
|
60 | 60 | |
61 | 61 | <div class="lasso--postsettings__footer"> |
62 | 62 | |
63 | 63 | <div class="lasso--postsettings__option"> |
64 | 64 | <label for="hide_tour" class="checkbox-control checkbox"> |
65 | - <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked( $tour_hidden, 1 ); ?>> |
|
65 | + <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked($tour_hidden, 1); ?>> |
|
66 | 66 | <span class="control-indicator"></span> |
67 | - <?php _e('Don\'t show this again','lasso');?> |
|
67 | + <?php _e('Don\'t show this again', 'lasso'); ?> |
|
68 | 68 | </label> |
69 | 69 | </div> |
70 | 70 | |
71 | - <input id ="editus_tour_submit" type="submit" value="<?php _e( 'Okay, got it!', 'lasso' );?>" data-nonce="<?php echo $nonce;?>" > |
|
71 | + <input id ="editus_tour_submit" type="submit" value="<?php _e('Okay, got it!', 'lasso'); ?>" data-nonce="<?php echo $nonce; ?>" > |
|
72 | 72 | </div> |
73 | 73 | |
74 | 74 | </div> |
@@ -92,20 +92,20 @@ discard block |
||
92 | 92 | <?php |
93 | 93 | |
94 | 94 | $out = '<ul><li>'; |
95 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg' ); |
|
96 | - $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.','lasso').'</p>'; |
|
95 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg'); |
|
96 | + $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.', 'lasso').'</p>'; |
|
97 | 97 | $out .= '</li><li>'; |
98 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg' ); |
|
99 | - $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.','lasso').'</p>'; |
|
98 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg'); |
|
99 | + $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.', 'lasso').'</p>'; |
|
100 | 100 | $out .= '</li><li>'; |
101 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg' ); |
|
102 | - $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.','lasso').'</p>'; |
|
101 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg'); |
|
102 | + $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.', 'lasso').'</p>'; |
|
103 | 103 | $out .= '</li><li>'; |
104 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg' ); |
|
105 | - $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.','lasso').'</p>'; |
|
104 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg'); |
|
105 | + $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.', 'lasso').'</p>'; |
|
106 | 106 | $out .= '</li></ul>'; |
107 | 107 | |
108 | - echo apply_filters( 'lasso_tour_slides', $out ); |
|
108 | + echo apply_filters('lasso_tour_slides', $out); |
|
109 | 109 | |
110 | 110 | ?></div><?php |
111 | 111 |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | 13 | if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | - // using rest api v1 |
|
14 | + if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | + // using rest api v1 |
|
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php |
32 | 32 | } else { |
33 | 33 | // using rest api v2 |
34 | - ?> |
|
34 | + ?> |
|
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | 37 | <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </li> |
48 | 48 | </script> |
49 | 49 | <?php |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( !function_exists( 'lasso_backbone_templates' ) ): |
|
3 | +if (!function_exists('lasso_backbone_templates')): |
|
4 | 4 | |
5 | 5 | add_action('wp_footer', 'lasso_backbone_templates'); |
6 | - function lasso_backbone_templates(){ |
|
6 | + function lasso_backbone_templates() { |
|
7 | 7 | |
8 | 8 | $can_delete = lasso_user_can('delete_posts'); |
9 | 9 | $can_delete_class = $can_delete ? false : 'no-delete'; |
10 | 10 | |
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | - if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
|
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
13 | + if (is_user_logged_in() && lasso_user_can('edit_posts')) { |
|
14 | + if (!class_exists('WP_REST_Controller')) { |
|
15 | 15 | // using rest api v1 |
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
19 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
19 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
20 | 20 | <%= post.title %> |
21 | 21 | |
22 | 22 | <div class="lasso--post-list__controls"> |
23 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
24 | - <?php if( $can_delete ): ?> |
|
25 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
23 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
24 | + <?php if ($can_delete): ?> |
|
25 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
26 | 26 | <?php endif; ?> |
27 | 27 | </div> |
28 | 28 | </a> |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | ?> |
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
37 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
38 | 38 | <%= post.title.rendered %> |
39 | 39 | |
40 | 40 | <div class="lasso--post-list__controls"> |
41 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
42 | - <?php if( $can_delete ): ?> |
|
43 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
41 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
42 | + <?php if ($can_delete): ?> |
|
43 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
44 | 44 | <?php endif; ?> |
45 | 45 | </div> |
46 | 46 | </a> |
@@ -163,6 +163,9 @@ |
||
163 | 163 | return $content; |
164 | 164 | } |
165 | 165 | |
166 | + /** |
|
167 | + * @param string $content |
|
168 | + */ |
|
166 | 169 | protected function remove_comments($content) { |
167 | 170 | return preg_replace('/<!--(.*)-->/Uis', '', $content); |
168 | 171 | } |
@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | protected function replace_rendered_shortcodes( $content ) { |
148 | 148 | //debug line |
149 | - //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
149 | + //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
150 | 150 | |
151 | 151 | |
152 | 152 | if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
@@ -19,27 +19,27 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return bool Always returns true. |
21 | 21 | */ |
22 | - public function content( $data ) { |
|
22 | + public function content($data) { |
|
23 | 23 | |
24 | 24 | $save_to_post_disabled = $this->save_to_post_disables(); |
25 | 25 | |
26 | - $postid = (int) $data[ 'post_id' ]; |
|
27 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
28 | - $content = $this->remove_comments( $content ); |
|
26 | + $postid = (int) $data['post_id']; |
|
27 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
28 | + $content = $this->remove_comments($content); |
|
29 | 29 | |
30 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
30 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
31 | 31 | |
32 | 32 | $args = array( |
33 | 33 | 'ID' => (int) $postid, |
34 | 34 | 'post_content' => $content |
35 | 35 | ); |
36 | 36 | |
37 | - wp_update_post( apply_filters( 'lasso_object_save_args', $args ) ); |
|
37 | + wp_update_post(apply_filters('lasso_object_save_args', $args)); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | 41 | // run save action |
42 | - do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() ); |
|
42 | + do_action('lasso_post_saved', $postid, $content, get_current_user_ID()); |
|
43 | 43 | |
44 | 44 | return true; |
45 | 45 | |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return bool Always returns true. |
56 | 56 | */ |
57 | - public function publish_content( $data ) { |
|
57 | + public function publish_content($data) { |
|
58 | 58 | $save_to_post_disabled = $this->save_to_post_disables(); |
59 | 59 | |
60 | - $postid = (int) $data[ 'post_id' ]; |
|
61 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
62 | - $content = $this->remove_comments( $content ); |
|
60 | + $postid = (int) $data['post_id']; |
|
61 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
62 | + $content = $this->remove_comments($content); |
|
63 | 63 | |
64 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
64 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
65 | 65 | |
66 | - $args = array ( |
|
66 | + $args = array( |
|
67 | 67 | 'ID' => $postid, |
68 | 68 | 'post_content' => $content, |
69 | 69 | 'post_status' => 'publish' |
70 | 70 | ); |
71 | - wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) ); |
|
71 | + wp_update_post(apply_filters('lasso_object_publish_args', $args)); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | - do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() ); |
|
75 | + do_action('lasso_post_published', $postid, $content, get_current_user_ID()); |
|
76 | 76 | |
77 | 77 | return true; |
78 | 78 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
87 | 87 | */ |
88 | - public static function params(){ |
|
89 | - $params[ 'process_save_content' ] = array( |
|
88 | + public static function params() { |
|
89 | + $params['process_save_content'] = array( |
|
90 | 90 | 'post_id' => 'absint', |
91 | 91 | 'content' => 'wp_kses_post' |
92 | 92 | ); |
93 | 93 | |
94 | - $params[ 'process_save_publish_content' ] = array( |
|
94 | + $params['process_save_publish_content'] = array( |
|
95 | 95 | 'post_id' => 'absint', |
96 | 96 | 'content' => 'wp_kses_post' |
97 | 97 | ); |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * @return array Array of additional functions to use to authorize action. |
108 | 108 | */ |
109 | 109 | public static function auth_callbacks() { |
110 | - $params[ 'process_save_content' ] = array( |
|
110 | + $params['process_save_content'] = array( |
|
111 | 111 | 'lasso_user_can' |
112 | 112 | ); |
113 | 113 | |
114 | - $params[ 'process_save_publish_content' ] = array(); |
|
114 | + $params['process_save_publish_content'] = array(); |
|
115 | 115 | |
116 | 116 | return $params; |
117 | 117 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @return bool |
128 | 128 | */ |
129 | 129 | protected function save_to_post_disables() { |
130 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
130 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
131 | 131 | |
132 | 132 | return $save_to_post_disabled; |
133 | 133 | |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @return string |
146 | 146 | */ |
147 | - protected function replace_rendered_shortcodes( $content ) { |
|
147 | + protected function replace_rendered_shortcodes($content) { |
|
148 | 148 | //debug line |
149 | 149 | //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
150 | 150 | |
151 | 151 | |
152 | - if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
|
152 | + if (false === strpos($content, '--EDITUS_OTHER_SHORTCODE_START|')) { |
|
153 | 153 | return $content; |
154 | 154 | } |
155 | - $content = htmlspecialchars_decode ($content); |
|
155 | + $content = htmlspecialchars_decode($content); |
|
156 | 156 | |
157 | 157 | $content = preg_replace( |
158 | 158 | '/<!--EDITUS_OTHER_SHORTCODE_START\|\[(.*?)\]-->(.*?)<!--EDITUS_OTHER_SHORTCODE_END-->/s', |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'public' => true, |
244 | 244 | ), 'objects' ); |
245 | 245 | $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
246 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + unset( $post_types[ 'attachment' ] ); |
|
247 | 247 | |
248 | 248 | /** |
249 | 249 | * Set which post types are allowed |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $post_types = get_post_types( array( |
271 | 271 | 'public' => true, |
272 | 272 | ), 'names' ); |
273 | - unset( $post_types[ 'attachment' ] ); |
|
273 | + unset( $post_types[ 'attachment' ] ); |
|
274 | 274 | |
275 | 275 | /** |
276 | 276 | * Set which post types are allowed |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | if ( !function_exists( 'lasso_user_can' ) ): |
384 | 384 | function lasso_user_can( $action = '', $postid = 0 ) { |
385 | - $result = false; |
|
385 | + $result = false; |
|
386 | 386 | if ( empty( $action ) ) |
387 | 387 | $action = 'edit_posts'; |
388 | 388 | |
@@ -397,17 +397,17 @@ discard block |
||
397 | 397 | $allowed_post_types = array_diff($allowed_post_types,array('page')); |
398 | 398 | } |
399 | 399 | |
400 | - if (!empty($allowed_post_types) && !empty($postid)) { |
|
400 | + if (!empty($allowed_post_types) && !empty($postid)) { |
|
401 | 401 | $type = get_post_type( $postid ); |
402 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
402 | + $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | 403 | |
404 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
404 | + if ( in_array( $type, $allowed_post_types ) ) { |
|
405 | 405 | $result = true; |
406 | - } |
|
407 | - } else { |
|
408 | - //we are not checking against a post, return true |
|
406 | + } |
|
407 | + } else { |
|
408 | + //we are not checking against a post, return true |
|
409 | 409 | $result = true; |
410 | - } |
|
410 | + } |
|
411 | 411 | } else { |
412 | 412 | $result = false; |
413 | 413 | } |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
19 | - return; |
|
18 | + if ( empty( $option ) ) { |
|
19 | + return; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
22 | 23 | |
@@ -44,11 +45,12 @@ discard block |
||
44 | 45 | |
45 | 46 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
46 | 47 | |
47 | - if ( $q->have_posts() ) |
|
48 | - return true; |
|
49 | - else |
|
50 | - return false; |
|
51 | -} |
|
48 | + if ( $q->have_posts() ) { |
|
49 | + return true; |
|
50 | + } else { |
|
51 | + return false; |
|
52 | + } |
|
53 | + } |
|
52 | 54 | |
53 | 55 | /** |
54 | 56 | * Return a CSS class of an automatically supported theme |
@@ -194,13 +196,15 @@ discard block |
||
194 | 196 | */ |
195 | 197 | function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
196 | 198 | |
197 | - if ( empty( $postid ) ) |
|
198 | - $postid = get_the_ID(); |
|
199 | + if ( empty( $postid ) ) { |
|
200 | + $postid = get_the_ID(); |
|
201 | + } |
|
199 | 202 | |
200 | 203 | $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
201 | 204 | |
202 | - if ( empty( $objects) ) |
|
203 | - return; |
|
205 | + if ( empty( $objects) ) { |
|
206 | + return; |
|
207 | + } |
|
204 | 208 | |
205 | 209 | $out = ''; |
206 | 210 | foreach( $objects as $object ) { |
@@ -222,8 +226,9 @@ discard block |
||
222 | 226 | |
223 | 227 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 228 | |
225 | - if ( empty( $objects) ) |
|
226 | - return; |
|
229 | + if ( empty( $objects) ) { |
|
230 | + return; |
|
231 | + } |
|
227 | 232 | |
228 | 233 | $out = ""; |
229 | 234 | foreach( $objects as $object ) { |
@@ -345,8 +350,9 @@ discard block |
||
345 | 350 | */ |
346 | 351 | function lasso_clean_string( $string = '' ) { |
347 | 352 | |
348 | - if ( empty( $string ) ) |
|
349 | - return; |
|
353 | + if ( empty( $string ) ) { |
|
354 | + return; |
|
355 | + } |
|
350 | 356 | |
351 | 357 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
352 | 358 | } |
@@ -385,11 +391,13 @@ discard block |
||
385 | 391 | if ( !function_exists( 'lasso_user_can' ) ): |
386 | 392 | function lasso_user_can( $action = '', $postid = 0 ) { |
387 | 393 | $result = false; |
388 | - if ( empty( $action ) ) |
|
389 | - $action = 'edit_posts'; |
|
394 | + if ( empty( $action ) ) { |
|
395 | + $action = 'edit_posts'; |
|
396 | + } |
|
390 | 397 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | - $postid = get_the_ID(); |
|
398 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
399 | + $postid = get_the_ID(); |
|
400 | + } |
|
393 | 401 | |
394 | 402 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
395 | 403 | // check against post types: |
@@ -13,6 +13,10 @@ discard block |
||
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | + |
|
17 | + /** |
|
18 | + * @param string $section |
|
19 | + */ |
|
16 | 20 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 21 | |
18 | 22 | if ( empty( $option ) ) |
@@ -216,7 +220,7 @@ discard block |
||
216 | 220 | * Return an array of categories for autocomplete |
217 | 221 | * |
218 | 222 | * @since 0.9.3 |
219 | - * @return array all categoiries |
|
223 | + * @return null|string all categoiries |
|
220 | 224 | */ |
221 | 225 | function lasso_get_objects( $taxonomy = 'category' ) { |
222 | 226 | |
@@ -309,7 +313,7 @@ discard block |
||
309 | 313 | * Used internally as a callback to build a tab or content area for modal addons |
310 | 314 | * |
311 | 315 | * @param $tab object |
312 | -* @param $type string tab or content |
|
316 | +* @param string $type string tab or content |
|
313 | 317 | * @uses lasso_modal_addons() |
314 | 318 | * @since 0.9.4 |
315 | 319 | */ |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - $options = apply_filters( 'editus_filter_options', $options ); |
|
30 | + $options = apply_filters('editus_filter_options', $options); |
|
31 | 31 | |
32 | - if ( isset( $options[$option] ) ) { |
|
32 | + if (isset($options[$option])) { |
|
33 | 33 | return $options[$option]; |
34 | 34 | } |
35 | 35 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function lasso_editor_galleries_exist() { |
46 | 46 | |
47 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
47 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
48 | 48 | |
49 | - if ( $q->have_posts() ) |
|
49 | + if ($q->have_posts()) |
|
50 | 50 | return true; |
51 | 51 | else |
52 | 52 | return false; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | function lasso_get_supported_theme_class() { |
62 | 62 | |
63 | 63 | $name = wp_get_theme()->get('Name'); |
64 | - $slug = lasso_clean_string( $name ); |
|
64 | + $slug = lasso_clean_string($name); |
|
65 | 65 | |
66 | - switch ( $slug ) { |
|
66 | + switch ($slug) { |
|
67 | 67 | case 'aesop-story-theme': // aesop |
68 | 68 | $out = '.aesop-entry-content'; |
69 | 69 | break; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | } |
114 | 114 | |
115 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
115 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
116 | 116 | //return !empty( $out ) ? $out : false; |
117 | 117 | } |
118 | 118 | |
119 | 119 | function lasso_get_supported_theme_title_class() { |
120 | 120 | |
121 | 121 | $name = wp_get_theme()->get('Name'); |
122 | - $slug = lasso_clean_string( $name ); |
|
122 | + $slug = lasso_clean_string($name); |
|
123 | 123 | |
124 | - switch ( $slug ) { |
|
124 | + switch ($slug) { |
|
125 | 125 | |
126 | 126 | case 'aesop-story-theme': // aesop |
127 | 127 | $out = '.aesop-entry-title'; |
@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | |
152 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
152 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | //since 0.9.9.6 |
156 | 156 | function lasso_get_supported_theme_featured_image_class() { |
157 | 157 | |
158 | 158 | $name = wp_get_theme()->get('Name'); |
159 | - $slug = lasso_clean_string( $name ); |
|
159 | + $slug = lasso_clean_string($name); |
|
160 | 160 | |
161 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
161 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @since 0.8.7 |
170 | 170 | * @return string of comma separated classes |
171 | 171 | */ |
172 | -function lasso_supported_no_save(){ |
|
172 | +function lasso_supported_no_save() { |
|
173 | 173 | |
174 | 174 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel'); |
175 | 175 | } |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return array|mixed|object|string|void |
185 | 185 | */ |
186 | -function lasso_sanitize_data( $data ) { |
|
187 | - return \lasso\sanatize::do_sanitize( $data ); |
|
186 | +function lasso_sanitize_data($data) { |
|
187 | + return \lasso\sanatize::do_sanitize($data); |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
@@ -194,18 +194,18 @@ discard block |
||
194 | 194 | * @since 0.9.3 |
195 | 195 | * @return string of comma delimited category slugs |
196 | 196 | */ |
197 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
197 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
198 | 198 | |
199 | - if ( empty( $postid ) ) |
|
199 | + if (empty($postid)) |
|
200 | 200 | $postid = get_the_ID(); |
201 | 201 | |
202 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
202 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
203 | 203 | |
204 | - if ( empty( $objects) ) |
|
204 | + if (empty($objects)) |
|
205 | 205 | return; |
206 | 206 | |
207 | 207 | $out = ''; |
208 | - foreach( $objects as $object ) { |
|
208 | + foreach ($objects as $object) { |
|
209 | 209 | //$out .= $object->slug.', '; |
210 | 210 | $out .= $object->name.','; |
211 | 211 | } |
@@ -220,15 +220,15 @@ discard block |
||
220 | 220 | * @since 0.9.3 |
221 | 221 | * @return array all categoiries |
222 | 222 | */ |
223 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
223 | +function lasso_get_objects($taxonomy = 'category') { |
|
224 | 224 | |
225 | 225 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
226 | 226 | |
227 | - if ( empty( $objects) ) |
|
227 | + if (empty($objects)) |
|
228 | 228 | return; |
229 | 229 | |
230 | 230 | $out = ""; |
231 | - foreach( $objects as $object ) { |
|
231 | + foreach ($objects as $object) { |
|
232 | 232 | $out .= $object->name.','; |
233 | 233 | } |
234 | 234 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | * @since 0.9.4 |
244 | 244 | */ |
245 | 245 | function lasso_post_types_names() { |
246 | - $post_types = get_post_types( array( |
|
246 | + $post_types = get_post_types(array( |
|
247 | 247 | 'public' => true, |
248 | - ), 'objects' ); |
|
249 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
250 | - unset( $post_types[ 'attachment' ] ); |
|
248 | + ), 'objects'); |
|
249 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
250 | + unset($post_types['attachment']); |
|
251 | 251 | |
252 | 252 | /** |
253 | 253 | * Set which post types are allowed |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
258 | 258 | */ |
259 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
260 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
259 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
260 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
261 | 261 | if (!current_user_can('edit_pages')) { |
262 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
262 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
263 | 263 | } |
264 | - foreach( $post_types as $name => $label ) { |
|
265 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
266 | - unset( $post_types[ $name ] ); |
|
264 | + foreach ($post_types as $name => $label) { |
|
265 | + if (!in_array($name, $allowed_post_types)) { |
|
266 | + unset($post_types[$name]); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | return $post_types; |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | function lasso_post_types() { |
274 | - $post_types = get_post_types( array( |
|
274 | + $post_types = get_post_types(array( |
|
275 | 275 | 'public' => true, |
276 | - ), 'names' ); |
|
277 | - unset( $post_types[ 'attachment' ] ); |
|
276 | + ), 'names'); |
|
277 | + unset($post_types['attachment']); |
|
278 | 278 | |
279 | 279 | /** |
280 | 280 | * Set which post types are allowed |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
285 | 285 | */ |
286 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
287 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
288 | - foreach( $post_types as $name => $label ) { |
|
289 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
290 | - unset( $post_types[ $name ] ); |
|
286 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
287 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
288 | + foreach ($post_types as $name => $label) { |
|
289 | + if (!in_array($name, $allowed_post_types)) { |
|
290 | + unset($post_types[$name]); |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | return $post_types; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | global $wp_post_types; |
298 | 298 | $post_types = lasso_post_types(); |
299 | 299 | $rest_base = array(); |
300 | - foreach ( $post_types as $post_type) { |
|
300 | + foreach ($post_types as $post_type) { |
|
301 | 301 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
302 | 302 | } |
303 | 303 | |
@@ -315,22 +315,22 @@ discard block |
||
315 | 315 | * @uses lasso_modal_addons() |
316 | 316 | * @since 0.9.4 |
317 | 317 | */ |
318 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
318 | +function lasso_modal_addons_content($tab = '', $type) { |
|
319 | 319 | |
320 | - $name = lasso_clean_string( $tab['name'] ); |
|
320 | + $name = lasso_clean_string($tab['name']); |
|
321 | 321 | |
322 | - if ( 'tab' == $type ) { |
|
322 | + if ('tab' == $type) { |
|
323 | 323 | |
324 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
324 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
325 | 325 | |
326 | - } else if ( 'content' == $type ){ |
|
326 | + } else if ('content' == $type) { |
|
327 | 327 | |
328 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
329 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
328 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
329 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
330 | 330 | |
331 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
331 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
332 | 332 | %s%s |
333 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
333 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
334 | 334 | |
335 | 335 | } |
336 | 336 | |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | * |
346 | 346 | * @return void|string |
347 | 347 | */ |
348 | -function lasso_clean_string( $string = '' ) { |
|
348 | +function lasso_clean_string($string = '') { |
|
349 | 349 | |
350 | - if ( empty( $string ) ) |
|
350 | + if (empty($string)) |
|
351 | 351 | return; |
352 | 352 | |
353 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
353 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | * |
364 | 364 | * @return void|string |
365 | 365 | */ |
366 | -function lasso_unclean_string( $string = '' ) { |
|
366 | +function lasso_unclean_string($string = '') { |
|
367 | 367 | |
368 | - if ( empty( $string ) ) { |
|
368 | + if (empty($string)) { |
|
369 | 369 | return; |
370 | 370 | } |
371 | 371 | |
372 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
372 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | |
@@ -384,40 +384,40 @@ discard block |
||
384 | 384 | * @param unknown $postid int the id of the post object to check against |
385 | 385 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
386 | 386 | */ |
387 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
388 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
387 | +if (!function_exists('lasso_user_can')): |
|
388 | + function lasso_user_can($action = '', $postid = 0) { |
|
389 | 389 | $result = false; |
390 | - if ( empty( $action ) ) |
|
390 | + if (empty($action)) |
|
391 | 391 | $action = 'edit_posts'; |
392 | 392 | |
393 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
393 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
394 | 394 | $postid = get_the_ID(); |
395 | 395 | |
396 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
396 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
397 | 397 | // check against post types: |
398 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
398 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
399 | 399 | |
400 | 400 | if (!current_user_can('edit_pages')) { |
401 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
401 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | if (!empty($allowed_post_types) && !empty($postid)) { |
405 | - $type = get_post_type( $postid ); |
|
406 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
405 | + $type = get_post_type($postid); |
|
406 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
407 | 407 | |
408 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
409 | - $result = true; |
|
408 | + if (in_array($type, $allowed_post_types)) { |
|
409 | + $result = true; |
|
410 | 410 | } |
411 | 411 | } else { |
412 | 412 | //we are not checking against a post, return true |
413 | - $result = true; |
|
413 | + $result = true; |
|
414 | 414 | } |
415 | 415 | } else { |
416 | 416 | $result = false; |
417 | 417 | } |
418 | 418 | //if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false; |
419 | 419 | |
420 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
420 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
421 | 421 | } |
422 | 422 | endif; |
423 | 423 | |
@@ -426,25 +426,25 @@ discard block |
||
426 | 426 | * |
427 | 427 | * @since 0.9.5 |
428 | 428 | */ |
429 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
429 | +if (!function_exists('lasso_editor_empty_results')): |
|
430 | 430 | |
431 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
431 | + function lasso_editor_empty_results($type = 'posts') { |
|
432 | 432 | |
433 | - if ( 'posts' == $type ) { |
|
433 | + if ('posts' == $type) { |
|
434 | 434 | |
435 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
435 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
436 | 436 | $icon = 'lasso-icon-file-text2'; |
437 | 437 | $button = false; |
438 | 438 | |
439 | - } elseif ( 'revision' == $type ) { |
|
439 | + } elseif ('revision' == $type) { |
|
440 | 440 | |
441 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
441 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
442 | 442 | $icon = 'lasso-icon-history'; |
443 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
443 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
444 | 444 | |
445 | 445 | } |
446 | 446 | |
447 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
447 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | endif; |
@@ -279,6 +279,9 @@ |
||
279 | 279 | endif; |
280 | 280 | |
281 | 281 | // helper function to retrieve one id for default option |
282 | +/** |
|
283 | + * @param string $type |
|
284 | + */ |
|
282 | 285 | function editus_get_one_id($type) |
283 | 286 | { |
284 | 287 | $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
@@ -236,16 +236,16 @@ discard block |
||
236 | 236 | if ( !function_exists('lasso_wp_image') ): |
237 | 237 | |
238 | 238 | function lasso_wp_image(){ |
239 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
241 | - if ($use_wp_block_image == 'on') { |
|
242 | - return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
243 | - } |
|
244 | - else if ($use_old_wpimg != 'on') { |
|
245 | - return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
246 | - } else { |
|
247 | - return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
248 | - } |
|
239 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
241 | + if ($use_wp_block_image == 'on') { |
|
242 | + return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
243 | + } |
|
244 | + else if ($use_old_wpimg != 'on') { |
|
245 | + return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
246 | + } else { |
|
247 | + return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
248 | + } |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | endif; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | |
288 | 288 | if ( !function_exists('lasso_wp_image_block') ): |
289 | 289 | function lasso_wp_image_block(){ |
290 | - return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
290 | + return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | endif; |
@@ -16,84 +16,84 @@ discard block |
||
16 | 16 | |
17 | 17 | $array = array( |
18 | 18 | 'quote' => array( |
19 | - 'name' => __('Quote','lasso'), |
|
19 | + 'name' => __('Quote', 'lasso'), |
|
20 | 20 | 'content' => lasso_quote_component(), |
21 | 21 | ), |
22 | 22 | 'image' => array( |
23 | - 'name' => __('Image','lasso'), |
|
23 | + 'name' => __('Image', 'lasso'), |
|
24 | 24 | 'content' => lasso_image_component(), |
25 | 25 | ), |
26 | 26 | 'parallax' => array( |
27 | - 'name' => __('Parallax','lasso'), |
|
27 | + 'name' => __('Parallax', 'lasso'), |
|
28 | 28 | 'content' => lasso_parallax_component(), |
29 | 29 | ), |
30 | 30 | 'audio' => array( |
31 | - 'name' => __('Audio','lasso'), |
|
31 | + 'name' => __('Audio', 'lasso'), |
|
32 | 32 | 'content' => lasso_audio_component(), |
33 | 33 | ), |
34 | 34 | 'content' => array( |
35 | - 'name' => __('Content','lasso'), |
|
35 | + 'name' => __('Content', 'lasso'), |
|
36 | 36 | 'content' => lasso_content_component(), |
37 | 37 | ), |
38 | 38 | 'character' => array( |
39 | - 'name' => __('Character','lasso'), |
|
39 | + 'name' => __('Character', 'lasso'), |
|
40 | 40 | 'content' => lasso_character_component(), |
41 | 41 | ), |
42 | 42 | 'collection' => array( |
43 | - 'name' => __('Collection','lasso'), |
|
43 | + 'name' => __('Collection', 'lasso'), |
|
44 | 44 | 'content' => lasso_collections_component(), |
45 | 45 | ), |
46 | 46 | 'document' => array( |
47 | - 'name' => __('Document','lasso'), |
|
47 | + 'name' => __('Document', 'lasso'), |
|
48 | 48 | 'content' => lasso_document_component(), |
49 | 49 | ), |
50 | 50 | 'gallery' => array( |
51 | - 'name' => __('Gallery','lasso'), |
|
51 | + 'name' => __('Gallery', 'lasso'), |
|
52 | 52 | 'content' => lasso_gallery_component(), |
53 | 53 | ), |
54 | 54 | 'chapter' => array( |
55 | - 'name' => __('Chapter','lasso'), |
|
55 | + 'name' => __('Chapter', 'lasso'), |
|
56 | 56 | 'content' => lasso_heading_component(), |
57 | 57 | ), |
58 | 58 | 'map' => array( |
59 | - 'name' => __('Map','lasso'), |
|
59 | + 'name' => __('Map', 'lasso'), |
|
60 | 60 | 'content' => lasso_map_component(), |
61 | 61 | ), |
62 | 62 | 'timeline_stop' => array( |
63 | - 'name' => __('Timeline','lasso'), |
|
63 | + 'name' => __('Timeline', 'lasso'), |
|
64 | 64 | 'content' => lasso_timeline_component(), |
65 | 65 | ), |
66 | 66 | 'video' => array( |
67 | - 'name' => __('Video','lasso'), |
|
67 | + 'name' => __('Video', 'lasso'), |
|
68 | 68 | 'content' => lasso_video_component(), |
69 | 69 | ), |
70 | 70 | 'wpimg' => array( |
71 | - 'name' => __('WordPress Image','lasso'), |
|
71 | + 'name' => __('WordPress Image', 'lasso'), |
|
72 | 72 | 'content' => lasso_wp_image(), |
73 | 73 | ), |
74 | 74 | 'wpimg-block' => array( |
75 | - 'name' => __('WordPress Image Block','lasso'), |
|
75 | + 'name' => __('WordPress Image Block', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_image_block(), |
77 | 77 | ), |
78 | 78 | 'wpquote' => array( |
79 | - 'name' => __('WordPress Quote','lasso'), |
|
79 | + 'name' => __('WordPress Quote', 'lasso'), |
|
80 | 80 | 'content' => lasso_wp_quote(), |
81 | 81 | ), |
82 | 82 | 'gallery_pop' => array( |
83 | - 'name' => __('Gallery Pop','lasso'), |
|
83 | + 'name' => __('Gallery Pop', 'lasso'), |
|
84 | 84 | 'content' => lasso_gallery_pop_component(), |
85 | 85 | ), |
86 | 86 | 'events' => array( |
87 | - 'name' => __('Events','lasso'), |
|
87 | + 'name' => __('Events', 'lasso'), |
|
88 | 88 | 'content' => lasso_event_component(), |
89 | 89 | ), |
90 | 90 | 'wpvideo' => array( |
91 | - 'name' => __('WordPress Image','lasso'), |
|
91 | + 'name' => __('WordPress Image', 'lasso'), |
|
92 | 92 | 'content' => lasso_wp_video(), |
93 | 93 | ), |
94 | 94 | ); |
95 | 95 | |
96 | - return apply_filters( 'lasso_components', $array ); |
|
96 | + return apply_filters('lasso_components', $array); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -119,125 +119,125 @@ discard block |
||
119 | 119 | */ |
120 | 120 | |
121 | 121 | // 1 |
122 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
122 | +if (!function_exists('lasso_quote_component')): |
|
123 | 123 | function lasso_quote_component() { |
124 | 124 | |
125 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
125 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
126 | 126 | } |
127 | 127 | endif; |
128 | 128 | |
129 | 129 | // 2 |
130 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
130 | +if (!function_exists('lasso_image_component')): |
|
131 | 131 | function lasso_image_component() { |
132 | 132 | |
133 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]' ); |
|
133 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="100%"]'); |
|
134 | 134 | } |
135 | 135 | endif; |
136 | 136 | |
137 | 137 | // 3 |
138 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
138 | +if (!function_exists('lasso_parallax_component')): |
|
139 | 139 | function lasso_parallax_component() { |
140 | 140 | |
141 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
141 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
142 | 142 | } |
143 | 143 | endif; |
144 | 144 | |
145 | 145 | // 4 |
146 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
146 | +if (!function_exists('lasso_audio_component')): |
|
147 | 147 | function lasso_audio_component() { |
148 | 148 | |
149 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
149 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
150 | 150 | |
151 | 151 | } |
152 | 152 | endif; |
153 | 153 | |
154 | 154 | // 5 |
155 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
155 | +if (!function_exists('lasso_content_component')): |
|
156 | 156 | function lasso_content_component() { |
157 | 157 | |
158 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
158 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
159 | 159 | } |
160 | 160 | endif; |
161 | 161 | |
162 | 162 | // 6 |
163 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
163 | +if (!function_exists('lasso_character_component')): |
|
164 | 164 | function lasso_character_component() { |
165 | 165 | |
166 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
166 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | endif; |
170 | 170 | |
171 | 171 | // 7 |
172 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
172 | +if (!function_exists('lasso_collections_component')): |
|
173 | 173 | function lasso_collections_component() { |
174 | 174 | |
175 | - return do_shortcode( '[aesop_collection]' ); |
|
175 | + return do_shortcode('[aesop_collection]'); |
|
176 | 176 | } |
177 | 177 | endif; |
178 | 178 | |
179 | 179 | // 8 |
180 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
180 | +if (!function_exists('lasso_document_component')): |
|
181 | 181 | function lasso_document_component() { |
182 | 182 | |
183 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
183 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | endif; |
187 | 187 | |
188 | 188 | // 9 |
189 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
189 | +if (!function_exists('lasso_gallery_component')): |
|
190 | 190 | function lasso_gallery_component() { |
191 | 191 | |
192 | - return do_shortcode( '[aesop_gallery]' ); |
|
192 | + return do_shortcode('[aesop_gallery]'); |
|
193 | 193 | |
194 | 194 | } |
195 | 195 | endif; |
196 | 196 | |
197 | 197 | // 10 |
198 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
198 | +if (!function_exists('lasso_heading_component')): |
|
199 | 199 | function lasso_heading_component() { |
200 | 200 | |
201 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
201 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
202 | 202 | } |
203 | 203 | endif; |
204 | 204 | |
205 | 205 | // 11 |
206 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
206 | +if (!function_exists('lasso_map_component')): |
|
207 | 207 | function lasso_map_component() { |
208 | 208 | |
209 | 209 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
210 | 210 | '.lasso_map_form_footer().' |
211 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
211 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
212 | 212 | </form>'; |
213 | 213 | |
214 | 214 | } |
215 | 215 | endif; |
216 | 216 | |
217 | 217 | // 12 |
218 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
218 | +if (!function_exists('lasso_timeline_component')): |
|
219 | 219 | function lasso_timeline_component() { |
220 | 220 | |
221 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
221 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
222 | 222 | |
223 | 223 | } |
224 | 224 | endif; |
225 | 225 | |
226 | 226 | // 13 |
227 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
227 | +if (!function_exists('lasso_video_component')): |
|
228 | 228 | function lasso_video_component() { |
229 | 229 | |
230 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
230 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
231 | 231 | |
232 | 232 | } |
233 | 233 | endif; |
234 | 234 | |
235 | 235 | // 14 - since 0.9.1 |
236 | -if ( !function_exists('lasso_wp_image') ): |
|
236 | +if (!function_exists('lasso_wp_image')): |
|
237 | 237 | |
238 | - function lasso_wp_image(){ |
|
239 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
240 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
238 | + function lasso_wp_image() { |
|
239 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
240 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
241 | 241 | if ($use_wp_block_image == 'on') { |
242 | 242 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
243 | 243 | } |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | endif; |
252 | 252 | |
253 | 253 | // 15 - since 0.9.2 |
254 | -if ( !function_exists('lasso_wp_quote') ): |
|
254 | +if (!function_exists('lasso_wp_quote')): |
|
255 | 255 | |
256 | - function lasso_wp_quote(){ |
|
256 | + function lasso_wp_quote() { |
|
257 | 257 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote><p><br></p>'; |
258 | 258 | } |
259 | 259 | |
@@ -261,15 +261,15 @@ discard block |
||
261 | 261 | |
262 | 262 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
263 | 263 | |
264 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
264 | +if (!function_exists('lasso_gallery_pop_component')): |
|
265 | 265 | function lasso_gallery_pop_component() { |
266 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
266 | + return do_shortcode('[aesop_gallery_pop]'); |
|
267 | 267 | } |
268 | 268 | endif; |
269 | 269 | |
270 | 270 | // 17 - work in progress |
271 | 271 | |
272 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
272 | +if (!function_exists('lasso_event_component')): |
|
273 | 273 | function lasso_event_component() { |
274 | 274 | $id = editus_get_one_id('aesop_events'); |
275 | 275 | return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>'; |
@@ -277,16 +277,16 @@ discard block |
||
277 | 277 | endif; |
278 | 278 | |
279 | 279 | // 18 - work in progress |
280 | -if ( !function_exists('lasso_wp_video') ): |
|
280 | +if (!function_exists('lasso_wp_video')): |
|
281 | 281 | |
282 | - function lasso_wp_video(){ |
|
282 | + function lasso_wp_video() { |
|
283 | 283 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
284 | 284 | } |
285 | 285 | |
286 | 286 | endif; |
287 | 287 | |
288 | -if ( !function_exists('lasso_wp_image_block') ): |
|
289 | - function lasso_wp_image_block(){ |
|
288 | +if (!function_exists('lasso_wp_image_block')): |
|
289 | + function lasso_wp_image_block() { |
|
290 | 290 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
291 | 291 | } |
292 | 292 | |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | // helper function to retrieve one id for default option |
296 | 296 | function editus_get_one_id($type) |
297 | 297 | { |
298 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
299 | - $posts = get_posts( $args ); |
|
300 | - if ( $posts ) { |
|
301 | - foreach ( $posts as $post ) { |
|
298 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
299 | + $posts = get_posts($args); |
|
300 | + if ($posts) { |
|
301 | + foreach ($posts as $post) { |
|
302 | 302 | return $post->ID; |
303 | 303 | } |
304 | 304 | } |
@@ -240,8 +240,7 @@ |
||
240 | 240 | $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
241 | 241 | if ($use_wp_block_image == 'on') { |
242 | 242 | return '<figure class="wp-block-image size-large" data-component-type="wpimg-block"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
243 | - } |
|
244 | - else if ($use_old_wpimg != 'on') { |
|
243 | + } else if ($use_old_wpimg != 'on') { |
|
245 | 244 | return '<figure data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
246 | 245 | } else { |
247 | 246 | return '<figure data-component-type="wpimg" data-linkoption="img" class="lasso--wpimg__wrap lasso-component"><img src="'.LASSO_URL.'/public/assets/img/empty-img.png"></figure><p><br></p>'; |
@@ -63,8 +63,9 @@ |
||
63 | 63 | |
64 | 64 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
67 | - return; |
|
66 | + if ( empty( $option ) ) { |
|
67 | + return; |
|
68 | + } |
|
68 | 69 | |
69 | 70 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
70 | 71 |
@@ -61,6 +61,9 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | +/** |
|
65 | + * @param string $section |
|
66 | + */ |
|
64 | 67 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
65 | 68 | |
66 | 69 | if ( empty( $option ) ) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | 49 | function lasso_show_in_rest($args, $post_type){ |
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
51 | + $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | 52 | $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
53 | 53 | if (in_array( $post_type,$allowed_post_types)) { |
54 | 54 | $args['show_in_rest'] = true; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - return $args; |
|
60 | + return $args; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -106,25 +106,25 @@ discard block |
||
106 | 106 | //table codes to be added |
107 | 107 | class editus_table { |
108 | 108 | |
109 | - public function __construct(){ |
|
110 | - $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
111 | - if ($add_table) { |
|
112 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
109 | + public function __construct(){ |
|
110 | + $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
111 | + if ($add_table) { |
|
112 | + add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
113 | 113 | |
114 | - } |
|
114 | + } |
|
115 | 115 | } |
116 | 116 | |
117 | - function scripts() |
|
118 | - { |
|
119 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu')); |
|
120 | - add_filter('lasso_components',array($this,'editus_components_add_table'),10,1); |
|
121 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 ); |
|
122 | - wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
123 | - wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
124 | - } |
|
117 | + function scripts() |
|
118 | + { |
|
119 | + add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu')); |
|
120 | + add_filter('lasso_components',array($this,'editus_components_add_table'),10,1); |
|
121 | + add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 ); |
|
122 | + wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
123 | + wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
124 | + } |
|
125 | 125 | |
126 | - function editus_table_edit_menu() |
|
127 | - { ?> |
|
126 | + function editus_table_edit_menu() |
|
127 | + { ?> |
|
128 | 128 | |
129 | 129 | <ul class='editus-table-menu'> |
130 | 130 | <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li> |
@@ -134,31 +134,31 @@ discard block |
||
134 | 134 | <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li |
135 | 135 | </ul> |
136 | 136 | <?php |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | 139 | |
140 | - function editus_html_table() |
|
141 | - { |
|
142 | - return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>'; |
|
143 | - } |
|
140 | + function editus_html_table() |
|
141 | + { |
|
142 | + return '<figure class="wp-block-table"><table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></figure><p><br></p>'; |
|
143 | + } |
|
144 | 144 | |
145 | 145 | |
146 | - function editus_components_add_table( $array ){ |
|
147 | - $custom = array( |
|
148 | - 'htmltable' => array( |
|
149 | - 'name' => __('HTML Table','lasso'), |
|
150 | - 'content' => self::editus_html_table(), |
|
151 | - ) |
|
152 | - ); |
|
153 | - return array_merge( $array, $custom ); |
|
154 | - } |
|
146 | + function editus_components_add_table( $array ){ |
|
147 | + $custom = array( |
|
148 | + 'htmltable' => array( |
|
149 | + 'name' => __('HTML Table','lasso'), |
|
150 | + 'content' => self::editus_html_table(), |
|
151 | + ) |
|
152 | + ); |
|
153 | + return array_merge( $array, $custom ); |
|
154 | + } |
|
155 | 155 | |
156 | 156 | |
157 | - function editus_toolbar_components_add_table( ) { |
|
158 | - ?> |
|
157 | + function editus_toolbar_components_add_table( ) { |
|
158 | + ?> |
|
159 | 159 | <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
160 | 160 | <?php |
161 | - } |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,37 +169,37 @@ discard block |
||
169 | 169 | //table codes to be added |
170 | 170 | class editus_paragraph { |
171 | 171 | |
172 | - public function __construct(){ |
|
173 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
172 | + public function __construct(){ |
|
173 | + add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
174 | 174 | } |
175 | 175 | |
176 | - function scripts() |
|
177 | - { |
|
178 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | - add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
181 | - //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
182 | - //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
183 | - } |
|
176 | + function scripts() |
|
177 | + { |
|
178 | + add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | + add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | + add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
181 | + //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
182 | + //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
183 | + } |
|
184 | 184 | |
185 | - function editus_components_add_paragraph( $array ){ |
|
186 | - $custom = array( |
|
187 | - 'htmlparagraph' => array( |
|
188 | - 'name' => __('HTML Paragraph','lasso'), |
|
189 | - 'content' => self::editus_html_paragraph(), |
|
190 | - ) |
|
191 | - ); |
|
192 | - return array_merge( $array, $custom ); |
|
193 | - } |
|
185 | + function editus_components_add_paragraph( $array ){ |
|
186 | + $custom = array( |
|
187 | + 'htmlparagraph' => array( |
|
188 | + 'name' => __('HTML Paragraph','lasso'), |
|
189 | + 'content' => self::editus_html_paragraph(), |
|
190 | + ) |
|
191 | + ); |
|
192 | + return array_merge( $array, $custom ); |
|
193 | + } |
|
194 | 194 | |
195 | 195 | |
196 | - function editus_html_paragraph() |
|
197 | - { |
|
198 | - return '<p contenteditable="true"><br></p>'; |
|
199 | - } |
|
196 | + function editus_html_paragraph() |
|
197 | + { |
|
198 | + return '<p contenteditable="true"><br></p>'; |
|
199 | + } |
|
200 | 200 | |
201 | - function editus_paragraph_style() |
|
202 | - { ?> |
|
201 | + function editus_paragraph_style() |
|
202 | + { ?> |
|
203 | 203 | <style> |
204 | 204 | #lasso-toolbar--components__list .lasso-toolbar--component__htmlparagraph:before |
205 | 205 | { |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | } |
209 | 209 | </style> |
210 | 210 | <?php |
211 | - } |
|
211 | + } |
|
212 | 212 | |
213 | 213 | |
214 | - function editus_toolbar_components_add_paragraph( ) { |
|
215 | - ?> |
|
214 | + function editus_toolbar_components_add_paragraph( ) { |
|
215 | + ?> |
|
216 | 216 | <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
217 | 217 | <?php |
218 | - } |
|
218 | + } |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | //Disable it for now |
@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '1.3.8' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '1.3.8'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
49 | +function lasso_show_in_rest($args, $post_type) { |
|
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
66 | + if (empty($option)) |
|
67 | 67 | return; |
68 | 68 | |
69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
70 | 70 | |
71 | - $options = get_site_option( $section ); |
|
71 | + $options = get_site_option($section); |
|
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - $options = get_option( $section ); |
|
75 | + $options = get_option($section); |
|
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $options[$option] ) ) { |
|
78 | + if (isset($options[$option])) { |
|
79 | 79 | return $options[$option]; |
80 | 80 | } |
81 | 81 | |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | )); |
89 | 89 | |
90 | 90 | // Gutenberg |
91 | -if( function_exists( 'is_gutenberg_page' ) ) { |
|
92 | - function add_raw_to_post( $response, $post, $request ) { |
|
91 | +if (function_exists('is_gutenberg_page')) { |
|
92 | + function add_raw_to_post($response, $post, $request) { |
|
93 | 93 | $response_data = $response->get_data(); |
94 | - if ( is_array( $response_data['content'] )) { |
|
95 | - $response_data['content']['raw'] = $post->post_content ; |
|
96 | - $response->set_data( $response_data ); |
|
94 | + if (is_array($response_data['content'])) { |
|
95 | + $response_data['content']['raw'] = $post->post_content; |
|
96 | + $response->set_data($response_data); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $response; |
100 | 100 | } |
101 | - add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 ); |
|
101 | + add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -106,32 +106,32 @@ discard block |
||
106 | 106 | //table codes to be added |
107 | 107 | class editus_table { |
108 | 108 | |
109 | - public function __construct(){ |
|
109 | + public function __construct() { |
|
110 | 110 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
111 | 111 | if ($add_table) { |
112 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
112 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
113 | 113 | |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | 117 | function scripts() |
118 | 118 | { |
119 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu')); |
|
120 | - add_filter('lasso_components',array($this,'editus_components_add_table'),10,1); |
|
121 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 ); |
|
122 | - wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
123 | - wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
119 | + add_action('lasso_editor_controls_after_outside', array($this, 'editus_table_edit_menu')); |
|
120 | + add_filter('lasso_components', array($this, 'editus_components_add_table'), 10, 1); |
|
121 | + add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_table'), 10); |
|
122 | + wp_enqueue_style('editus-table-style', LASSO_URL.'/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true); |
|
123 | + wp_enqueue_script('editus_table', LASSO_URL.'/public/assets/js/editus-table-edit-public.js', array('jquery'), LASSO_VERSION, true); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | function editus_table_edit_menu() |
127 | 127 | { ?> |
128 | 128 | |
129 | 129 | <ul class='editus-table-menu'> |
130 | - <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li> |
|
131 | - <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li> |
|
132 | - <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li> |
|
133 | - <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li> |
|
134 | - <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li |
|
130 | + <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li> |
|
131 | + <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li> |
|
132 | + <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li> |
|
133 | + <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li> |
|
134 | + <li data-action="deltable"><?php echo __('Delete Table', 'lasso')?></li |
|
135 | 135 | </ul> |
136 | 136 | <?php |
137 | 137 | } |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | |
146 | - function editus_components_add_table( $array ){ |
|
146 | + function editus_components_add_table($array) { |
|
147 | 147 | $custom = array( |
148 | 148 | 'htmltable' => array( |
149 | - 'name' => __('HTML Table','lasso'), |
|
149 | + 'name' => __('HTML Table', 'lasso'), |
|
150 | 150 | 'content' => self::editus_html_table(), |
151 | 151 | ) |
152 | 152 | ); |
153 | - return array_merge( $array, $custom ); |
|
153 | + return array_merge($array, $custom); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
157 | 157 | function editus_toolbar_components_add_table( ) { |
158 | 158 | ?> |
159 | - <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
|
159 | + <li data-type="htmltable" title="<?php esc_attr_e('HTML Table', 'lasso'); ?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
|
160 | 160 | <?php |
161 | 161 | } |
162 | 162 | } |
@@ -169,27 +169,27 @@ discard block |
||
169 | 169 | //table codes to be added |
170 | 170 | class editus_paragraph { |
171 | 171 | |
172 | - public function __construct(){ |
|
173 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
172 | + public function __construct() { |
|
173 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | function scripts() |
177 | 177 | { |
178 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
179 | - add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
180 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
178 | + add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style')); |
|
179 | + add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1); |
|
180 | + add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10); |
|
181 | 181 | //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
182 | 182 | //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
183 | 183 | } |
184 | 184 | |
185 | - function editus_components_add_paragraph( $array ){ |
|
185 | + function editus_components_add_paragraph($array) { |
|
186 | 186 | $custom = array( |
187 | 187 | 'htmlparagraph' => array( |
188 | - 'name' => __('HTML Paragraph','lasso'), |
|
188 | + 'name' => __('HTML Paragraph', 'lasso'), |
|
189 | 189 | 'content' => self::editus_html_paragraph(), |
190 | 190 | ) |
191 | 191 | ); |
192 | - return array_merge( $array, $custom ); |
|
192 | + return array_merge($array, $custom); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | function editus_toolbar_components_add_paragraph( ) { |
215 | 215 | ?> |
216 | - <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
216 | + <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
217 | 217 | <?php |
218 | 218 | } |
219 | 219 | } |
@@ -182,7 +182,7 @@ |
||
182 | 182 | * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | - * @return bool True if update was successful, false if not. |
|
185 | + * @return boolean|null True if update was successful, false if not. |
|
186 | 186 | */ |
187 | 187 | public function set_custom_taxonomy( $postid, $value) { |
188 | 188 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @since 0.9.3 |
135 | 135 | * |
136 | 136 | * @param int $postid The current postid |
137 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
137 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
138 | 138 | * @param string $taxonomy The name of the taxonomy to which the term belongs. |
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($taxonomy =='category') { |
150 | - // convert from names to category ids |
|
150 | + // convert from names to category ids |
|
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
153 | 153 | foreach ($value as $cat) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * |
180 | 180 | * |
181 | 181 | * @param int $postid The current postid |
182 | - * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
182 | + * @param string|bool $value The term slug, or a comma separated list of slugs. Or false to remove all terms set for post. |
|
183 | 183 | * The first item is the name of taxonomy |
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $value = explode( ',', $value ); |
193 | 193 | } |
194 | 194 | |
195 | - // Deleting first array item |
|
195 | + // Deleting first array item |
|
196 | 196 | $taxonomy = array_shift($value); |
197 | 197 | $cats = array(); |
198 | 198 | foreach ($value as $cat) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | if( $value ) { |
216 | 216 | $time = current_time('mysql'); |
217 | - wp_update_post( |
|
217 | + wp_update_post( |
|
218 | 218 | array ( |
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | 220 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | use lasso\internal_api\api_action; |
11 | 11 | |
12 | -class update_object implements api_action{ |
|
12 | +class update_object implements api_action { |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The nonce action for this request. |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return bool Always returns true. |
31 | 31 | */ |
32 | - public function post( $data ) { |
|
32 | + public function post($data) { |
|
33 | 33 | |
34 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
35 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
36 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
34 | + $status = isset($data['status']) ? $data['status'] : false; |
|
35 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
36 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
37 | 37 | |
38 | 38 | |
39 | 39 | |
@@ -43,28 +43,28 @@ discard block |
||
43 | 43 | 'post_status' => $status |
44 | 44 | ); |
45 | 45 | |
46 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
46 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
47 | 47 | |
48 | 48 | |
49 | 49 | // update categories |
50 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
51 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
50 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
51 | + self::set_post_terms($postid, $cats, 'category'); |
|
52 | 52 | |
53 | 53 | |
54 | 54 | // update tags |
55 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
56 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
55 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
56 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
57 | 57 | |
58 | 58 | // update custom taxonomy |
59 | - $taxs = isset( $data['story_custom_taxonomy'] ) ? $data['story_custom_taxonomy'] : false; |
|
60 | - self::set_custom_taxonomy( $postid, $taxs ); |
|
59 | + $taxs = isset($data['story_custom_taxonomy']) ? $data['story_custom_taxonomy'] : false; |
|
60 | + self::set_custom_taxonomy($postid, $taxs); |
|
61 | 61 | |
62 | 62 | //update date |
63 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
64 | - self::set_date( $postid, $date ); |
|
63 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
64 | + self::set_date($postid, $date); |
|
65 | 65 | |
66 | 66 | |
67 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
67 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
68 | 68 | |
69 | 69 | return true; |
70 | 70 | |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
80 | 80 | */ |
81 | - public static function params(){ |
|
82 | - $params[ 'process_update_object_post' ] = array( |
|
81 | + public static function params() { |
|
82 | + $params['process_update_object_post'] = array( |
|
83 | 83 | 'postid' => 'absint', |
84 | 84 | 'status' => 'strip_tags', |
85 | 85 | 'story_slug' => array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @return array Array of additional functions to use to authorize action. |
118 | 118 | */ |
119 | 119 | public static function auth_callbacks() { |
120 | - $params[ 'process_update_object_post' ] = array( |
|
120 | + $params['process_update_object_post'] = array( |
|
121 | 121 | 'lasso_user_can' |
122 | 122 | ); |
123 | 123 | |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @return bool True if update was successful, false if not. |
141 | 141 | */ |
142 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
143 | - if( $value ) { |
|
142 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
143 | + if ($value) { |
|
144 | 144 | // first check if multiple, make array if so. |
145 | - if ( self::has_multiple_objects( $value ) ) { |
|
146 | - $value = explode( ',', $value ); |
|
145 | + if (self::has_multiple_objects($value)) { |
|
146 | + $value = explode(',', $value); |
|
147 | 147 | } |
148 | 148 | |
149 | - if ($taxonomy =='category') { |
|
149 | + if ($taxonomy == 'category') { |
|
150 | 150 | // convert from names to category ids |
151 | 151 | $cats = array(); |
152 | 152 | if (is_array($value)) { |
@@ -159,17 +159,17 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
162 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
163 | 163 | } |
164 | - else { |
|
164 | + else { |
|
165 | 165 | //remove all terms from post |
166 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
166 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - if ( ! is_wp_error( $result ) ) { |
|
170 | + if (!is_wp_error($result)) { |
|
171 | 171 | return true; |
172 | - }else{ |
|
172 | + } else { |
|
173 | 173 | return false; |
174 | 174 | } |
175 | 175 | } |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | * |
185 | 185 | * @return bool True if update was successful, false if not. |
186 | 186 | */ |
187 | - public function set_custom_taxonomy( $postid, $value) { |
|
187 | + public function set_custom_taxonomy($postid, $value) { |
|
188 | 188 | |
189 | - if( $value ) { |
|
189 | + if ($value) { |
|
190 | 190 | // first check if multiple, make array if so. |
191 | - if ( self::has_multiple_objects( $value ) ) { |
|
192 | - $value = explode( ',', $value ); |
|
191 | + if (self::has_multiple_objects($value)) { |
|
192 | + $value = explode(',', $value); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | // Deleting first array item |
@@ -201,24 +201,24 @@ discard block |
||
201 | 201 | $value = $cats; |
202 | 202 | |
203 | 203 | |
204 | - $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
|
205 | - if ( ! is_wp_error( $result ) ) { |
|
204 | + $result = wp_set_object_terms($postid, $cats, $taxonomy); |
|
205 | + if (!is_wp_error($result)) { |
|
206 | 206 | return true; |
207 | - }else{ |
|
207 | + } else { |
|
208 | 208 | return false; |
209 | 209 | } |
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | - public function set_date( $postid, $value) { |
|
213 | + public function set_date($postid, $value) { |
|
214 | 214 | |
215 | - if( $value ) { |
|
215 | + if ($value) { |
|
216 | 216 | $time = current_time('mysql'); |
217 | 217 | wp_update_post( |
218 | - array ( |
|
218 | + array( |
|
219 | 219 | 'ID' => $postid, // ID of the post to update |
220 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
221 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
220 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
221 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
222 | 222 | ) |
223 | 223 | ); |
224 | 224 | } |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | * @return bool True if there are multiple terms; otherwise, false. |
233 | 233 | * @since 0.9.3 |
234 | 234 | */ |
235 | - public function has_multiple_objects( $value ) { |
|
235 | + public function has_multiple_objects($value) { |
|
236 | 236 | |
237 | - return 0 < strpos( $value, ',' ); |
|
237 | + return 0 < strpos($value, ','); |
|
238 | 238 | |
239 | 239 | } |
240 | 240 |
@@ -160,8 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
163 | - } |
|
164 | - else { |
|
163 | + } else { |
|
165 | 164 | //remove all terms from post |
166 | 165 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
167 | 166 | |
@@ -169,7 +168,7 @@ discard block |
||
169 | 168 | |
170 | 169 | if ( ! is_wp_error( $result ) ) { |
171 | 170 | return true; |
172 | - }else{ |
|
171 | + } else{ |
|
173 | 172 | return false; |
174 | 173 | } |
175 | 174 | } |
@@ -204,7 +203,7 @@ discard block |
||
204 | 203 | $result = wp_set_object_terms( $postid, $cats, $taxonomy ); |
205 | 204 | if ( ! is_wp_error( $result ) ) { |
206 | 205 | return true; |
207 | - }else{ |
|
206 | + } else{ |
|
208 | 207 | return false; |
209 | 208 | } |
210 | 209 | } |
@@ -28,26 +28,26 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.0 |
30 | 30 | */ |
31 | - public function post( $data ) { |
|
31 | + public function post($data) { |
|
32 | 32 | |
33 | - $title = $data[ 'story_title' ]; |
|
33 | + $title = $data['story_title']; |
|
34 | 34 | |
35 | - $object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ]; |
|
35 | + $object = is_null($data['object']) ? false : $data['object']; |
|
36 | 36 | |
37 | 37 | // insert a new post |
38 | 38 | $args = array( |
39 | 39 | 'post_title' => $title, |
40 | 40 | 'post_status' => 'draft', |
41 | 41 | 'post_type' => $object, |
42 | - 'post_content' => apply_filters( 'lasso_new_object_content', '<p>'.__( 'Once upon a time...','lasso').'</p>' ) |
|
42 | + 'post_content' => apply_filters('lasso_new_object_content', '<p>'.__('Once upon a time...', 'lasso').'</p>') |
|
43 | 43 | ); |
44 | 44 | |
45 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) ); |
|
45 | + $postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args)); |
|
46 | 46 | |
47 | - do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() ); |
|
47 | + do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID()); |
|
48 | 48 | |
49 | 49 | return array( |
50 | - 'postlink' => get_permalink( $postid ) |
|
50 | + 'postlink' => get_permalink($postid) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | } |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
61 | 61 | */ |
62 | 62 | public static function params() { |
63 | - $params[ 'process_new_object_post' ] = array( |
|
64 | - 'story_title' => array( 'wp_strip_all_tags', 'trim' ), |
|
63 | + $params['process_new_object_post'] = array( |
|
64 | + 'story_title' => array('wp_strip_all_tags', 'trim'), |
|
65 | 65 | 'object' => 'trim' |
66 | 66 | ); |
67 | 67 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return array Array of additional functions to use to authorize action. |
78 | 78 | */ |
79 | 79 | public static function auth_callbacks() { |
80 | - $params[ 'process_new_object_post' ] = array(); |
|
80 | + $params['process_new_object_post'] = array(); |
|
81 | 81 | |
82 | 82 | return $params; |
83 | 83 |
@@ -79,6 +79,10 @@ |
||
79 | 79 | |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param string $id |
|
84 | + * @param string $defvalue |
|
85 | + */ |
|
82 | 86 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | 87 | $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
84 | 88 |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
49 | - return; |
|
48 | + if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) { |
|
49 | + return; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
52 | 53 | |
@@ -95,8 +96,9 @@ discard block |
||
95 | 96 | */ |
96 | 97 | function lasso_editor_settings_form() { |
97 | 98 | |
98 | - if ( !is_user_logged_in() ) |
|
99 | - return; |
|
99 | + if ( !is_user_logged_in() ) { |
|
100 | + return; |
|
101 | + } |
|
100 | 102 | |
101 | 103 | // check for lasso story engine and add a class doniting this |
102 | 104 | $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
@@ -176,7 +178,9 @@ discard block |
||
176 | 178 | $post_types = get_post_types( $args, 'objects' ); |
177 | 179 | |
178 | 180 | foreach ( $post_types as $post_type ) { |
179 | - if ($post_type->name == 'attachment') continue; |
|
181 | + if ($post_type->name == 'attachment') { |
|
182 | + continue; |
|
183 | + } |
|
180 | 184 | $checked =""; |
181 | 185 | if ( in_array( $post_type->name, $allowed_post_types ) ) { |
182 | 186 | $checked = 'checked="checked"'; |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | if ( !is_user_logged_in() ) |
99 | 99 | return; |
100 | 100 | |
101 | - // check for lasso story engine and add a class doniting this |
|
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
101 | + // check for lasso story engine and add a class doniting this |
|
102 | + $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | 103 | |
104 | 104 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
105 | 105 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
111 | 111 | $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
112 | 112 | $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | 114 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
115 | 115 | $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
116 | 116 | $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
136 | 136 | $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
137 | 137 | |
138 | - $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
138 | + $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
|
139 | 139 | |
140 | 140 | // do we support pending status |
141 | 141 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | $insert_comp_ui = 'drag'; |
148 | 148 | } |
149 | 149 | |
150 | - $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
150 | + $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
|
151 | 151 | |
152 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
152 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
154 | 154 | |
155 | 155 | ?> |
156 | 156 | <div class="wrap"> |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | function __construct() { |
11 | 11 | |
12 | - add_action( 'admin_menu', array( $this, 'menu' ) ); |
|
13 | - add_action( 'network_admin_menu', array( $this, 'menu' ) ); |
|
14 | - add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) ); |
|
12 | + add_action('admin_menu', array($this, 'menu')); |
|
13 | + add_action('network_admin_menu', array($this, 'menu')); |
|
14 | + add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings')); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function menu() { |
24 | 24 | |
25 | 25 | // CHANGED Removed condition. |
26 | - add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) ); |
|
26 | + add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings')); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
48 | + if (!current_user_can('manage_options') || !is_user_logged_in()) |
|
49 | 49 | return; |
50 | 50 | |
51 | - if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
|
51 | + if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) { |
|
52 | 52 | |
53 | - $options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false; |
|
53 | + $options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false; |
|
54 | 54 | |
55 | 55 | $arr = $options['allowed_post_types']; |
56 | - $options = array_map( 'sanitize_text_field', $options ); |
|
57 | - $options['allowed_post_types'] = array_keys( $arr); |
|
56 | + $options = array_map('sanitize_text_field', $options); |
|
57 | + $options['allowed_post_types'] = array_keys($arr); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
61 | + if (function_exists('is_multisite') && is_multisite()) { |
|
62 | 62 | |
63 | - update_site_option( 'lasso_editor', $options ); |
|
63 | + update_site_option('lasso_editor', $options); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | |
67 | - update_option( 'lasso_editor', $options ); |
|
67 | + update_option('lasso_editor', $options); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | wp_send_json_success(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | - $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
|
83 | + $color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue); |
|
84 | 84 | |
85 | 85 | echo '<div lass="lasso-editor-settings--option-inner">'."\n"; |
86 | 86 | echo '<label>'.$title.'</label>'; |
@@ -95,45 +95,45 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function lasso_editor_settings_form() { |
97 | 97 | |
98 | - if ( !is_user_logged_in() ) |
|
98 | + if (!is_user_logged_in()) |
|
99 | 99 | return; |
100 | 100 | |
101 | 101 | // check for lasso story engine and add a class doniting this |
102 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
103 | - |
|
104 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
105 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
106 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
107 | - |
|
108 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
109 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
110 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
111 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
112 | - $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
|
113 | - $allow_edit_excerpt = lasso_editor_get_option( 'allow_edit_excerpt', 'lasso_editor' ); |
|
114 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
115 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
116 | - $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
|
117 | - |
|
118 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
119 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
120 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
121 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
122 | - $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
|
123 | - $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
|
102 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
103 | + |
|
104 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
105 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
106 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
107 | + |
|
108 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
109 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
110 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
111 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
112 | + $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
|
113 | + $allow_edit_excerpt = lasso_editor_get_option('allow_edit_excerpt', 'lasso_editor'); |
|
114 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
115 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
116 | + $enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor'); |
|
117 | + |
|
118 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
119 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
120 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
121 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
122 | + $toolbar_show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
|
123 | + $toolbar_show_alignment = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
|
124 | 124 | |
125 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
126 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
125 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
126 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
127 | 127 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
128 | 128 | $show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor'); |
129 | 129 | $save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
130 | 130 | |
131 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
132 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
131 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
132 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
133 | 133 | |
134 | 134 | $links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false); |
135 | - $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
|
136 | - $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
|
135 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b"); |
|
136 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i"); |
|
137 | 137 | |
138 | 138 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
139 | 139 | |
@@ -149,37 +149,37 @@ discard block |
||
149 | 149 | |
150 | 150 | $link_prefix_http = lasso_editor_get_option('link_prefix_http', 'lasso_editor'); |
151 | 151 | |
152 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
153 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
152 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
153 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
154 | 154 | |
155 | 155 | ?> |
156 | 156 | <div class="wrap"> |
157 | 157 | |
158 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
158 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
159 | 159 | |
160 | 160 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
161 | 161 | |
162 | - <?php do_action('lasso_settings_before');?> |
|
162 | + <?php do_action('lasso_settings_before'); ?> |
|
163 | 163 | |
164 | 164 | |
165 | 165 | |
166 | - <h3><?php _e( 'Enable for:', 'lasso' );?></h3> |
|
166 | + <h3><?php _e('Enable for:', 'lasso'); ?></h3> |
|
167 | 167 | <div class="lasso-editor-settings--option-wrap"> |
168 | 168 | <div class="lasso-editor-settings--option-inner"> |
169 | 169 | |
170 | - <span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span> |
|
170 | + <span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span> |
|
171 | 171 | <?php |
172 | 172 | $args = array( |
173 | 173 | 'public' => true |
174 | 174 | ); |
175 | 175 | |
176 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
177 | - $post_types = get_post_types( $args, 'objects' ); |
|
176 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
177 | + $post_types = get_post_types($args, 'objects'); |
|
178 | 178 | |
179 | - foreach ( $post_types as $post_type ) { |
|
179 | + foreach ($post_types as $post_type) { |
|
180 | 180 | if ($post_type->name == 'attachment') continue; |
181 | - $checked =""; |
|
182 | - if ( in_array( $post_type->name, $allowed_post_types ) ) { |
|
181 | + $checked = ""; |
|
182 | + if (in_array($post_type->name, $allowed_post_types)) { |
|
183 | 183 | $checked = 'checked="checked"'; |
184 | 184 | } |
185 | 185 | echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>'; |
@@ -189,126 +189,126 @@ discard block |
||
189 | 189 | </div> |
190 | 190 | |
191 | 191 | |
192 | - <h3><?php _e( 'Internal Settings', 'lasso' );?></h3> |
|
192 | + <h3><?php _e('Internal Settings', 'lasso'); ?></h3> |
|
193 | 193 | <div class="lasso-editor-settings--option-wrap"> |
194 | 194 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
195 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
196 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span> |
|
197 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
195 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
196 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span> |
|
197 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
198 | 198 | </div> |
199 | 199 | |
200 | 200 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
201 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
202 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span> |
|
203 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
201 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
202 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span> |
|
203 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
204 | 204 | </div> |
205 | 205 | |
206 | 206 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
207 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
208 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span> |
|
209 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
207 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
208 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span> |
|
209 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
210 | 210 | </div> |
211 | 211 | |
212 | 212 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
213 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
214 | - <span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span> |
|
215 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
213 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
214 | + <span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span> |
|
215 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
219 | - <label><?php _e( 'Read Only Items', 'lasso' );?></label> |
|
220 | - <span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span> |
|
221 | - <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea> |
|
219 | + <label><?php _e('Read Only Items', 'lasso'); ?></label> |
|
220 | + <span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span> |
|
221 | + <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea> |
|
222 | 222 | </div> |
223 | 223 | |
224 | 224 | <div class="lasso-editor-settings--option-inner" > |
225 | - <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> > |
|
226 | - <label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label> |
|
227 | - <span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span> |
|
225 | + <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> > |
|
226 | + <label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label> |
|
227 | + <span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span> |
|
228 | 228 | </div> |
229 | 229 | </div> |
230 | 230 | |
231 | - <h3><?php _e( 'Editor UI', 'lasso' );?></h3> |
|
231 | + <h3><?php _e('Editor UI', 'lasso'); ?></h3> |
|
232 | 232 | <div class="lasso-editor-settings--option-wrap"> |
233 | 233 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
234 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> > |
|
235 | - <label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label> |
|
236 | - <span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span> |
|
234 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> > |
|
235 | + <label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label> |
|
236 | + <span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span> |
|
237 | 237 | </div> |
238 | 238 | <div id="lasso-editor-settings--colors"> |
239 | 239 | <?php |
240 | - self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff'); |
|
241 | - self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030'); |
|
242 | - self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055'); |
|
243 | - self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff'); |
|
240 | + self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff'); |
|
241 | + self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030'); |
|
242 | + self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055'); |
|
243 | + self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff'); |
|
244 | 244 | ?> |
245 | - <button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button> |
|
245 | + <button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button> |
|
246 | 246 | <div style="height:50px;"></div> |
247 | 247 | </div> |
248 | 248 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
249 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
250 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label> |
|
251 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span> |
|
249 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
250 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label> |
|
251 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span> |
|
252 | 252 | |
253 | 253 | </div> |
254 | 254 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
255 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> > |
|
256 | - <label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label> |
|
257 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span> |
|
255 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> > |
|
256 | + <label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label> |
|
257 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span> |
|
258 | 258 | |
259 | 259 | </div> |
260 | 260 | |
261 | 261 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
262 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked( $toolbar_list, 'on' );?> > |
|
263 | - <label for="lasso_editor[toolbar_list]"><?php _e( 'Enable OL/UL Buttons', 'lasso' );?></label> |
|
264 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso' );?></span> |
|
262 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_list]" id="lasso_editor[toolbar_list]" <?php echo checked($toolbar_list, 'on'); ?> > |
|
263 | + <label for="lasso_editor[toolbar_list]"><?php _e('Enable OL/UL Buttons', 'lasso'); ?></label> |
|
264 | + <span class="lasso--setting-description"><?php _e('Show the buttons to create Ordered and Unordered Lists from text selection.', 'lasso'); ?></span> |
|
265 | 265 | </div> |
266 | 266 | |
267 | 267 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
268 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> > |
|
269 | - <label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label> |
|
270 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span> |
|
268 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> > |
|
269 | + <label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label> |
|
270 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span> |
|
271 | 271 | |
272 | 272 | </div> |
273 | 273 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
274 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> > |
|
275 | - <label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label> |
|
276 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span> |
|
274 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> > |
|
275 | + <label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label> |
|
276 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span> |
|
277 | 277 | |
278 | 278 | </div> |
279 | 279 | |
280 | 280 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
281 | - <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> > |
|
282 | - <label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label> |
|
283 | - <span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span> |
|
281 | + <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> > |
|
282 | + <label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label> |
|
283 | + <span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span> |
|
284 | 284 | |
285 | 285 | </div> |
286 | 286 | <div class="lasso-editor-settings--option-inner"> |
287 | - <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label> |
|
288 | - <span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span> |
|
287 | + <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label> |
|
288 | + <span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span> |
|
289 | 289 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
290 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?> |
|
290 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?> |
|
291 | 291 | </div> |
292 | 292 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
293 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?> |
|
293 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?> |
|
294 | 294 | </div> |
295 | 295 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
296 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?> |
|
296 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?> |
|
297 | 297 | </div> |
298 | 298 | </div> |
299 | 299 | |
300 | 300 | </div> |
301 | 301 | |
302 | - <h3><?php _e( 'Component', 'lasso' );?></h3> |
|
302 | + <h3><?php _e('Component', 'lasso'); ?></h3> |
|
303 | 303 | <div class="lasso-editor-settings--option-wrap" style="border:none;" > |
304 | 304 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
305 | - <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked( $add_table, 'on' );?> > |
|
306 | - <label for="lasso_editor[add_table]"><?php _e( 'Additional Component: Table', 'lasso' );?></label> |
|
307 | - <span class="lasso--setting-description"><?php _e( 'Allow user to add and edit tables.', 'lasso' );?></span> |
|
305 | + <input type="checkbox" class="checkbox" name="lasso_editor[add_table]" id="lasso_editor[add_table]" <?php echo checked($add_table, 'on'); ?> > |
|
306 | + <label for="lasso_editor[add_table]"><?php _e('Additional Component: Table', 'lasso'); ?></label> |
|
307 | + <span class="lasso--setting-description"><?php _e('Allow user to add and edit tables.', 'lasso'); ?></span> |
|
308 | 308 | |
309 | 309 | </div> |
310 | 310 | |
311 | - <?php if ( 'ase-active' != $ase_status ) { ?> |
|
311 | + <?php if ('ase-active' != $ase_status) { ?> |
|
312 | 312 | <script> |
313 | 313 | $(document).ready(function(){ |
314 | 314 | $("#lasso_editor\\[use_old_wpimg\\]").on('change', function(){ |
@@ -334,131 +334,131 @@ discard block |
||
334 | 334 | </script> |
335 | 335 | |
336 | 336 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
337 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked( $use_old_wpimg, 'on' );?> > |
|
338 | - <label for="lasso_editor[use_old_wpimg]"><?php _e( 'Use Simple Image', 'lasso' );?></label> |
|
339 | - <span class="lasso--setting-description"><?php _e( 'Use Simple Image Component without Extra Options.', 'lasso' );?></span> |
|
337 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_wpimg]" id="lasso_editor[use_old_wpimg]" <?php echo checked($use_old_wpimg, 'on'); ?> > |
|
338 | + <label for="lasso_editor[use_old_wpimg]"><?php _e('Use Simple Image', 'lasso'); ?></label> |
|
339 | + <span class="lasso--setting-description"><?php _e('Use Simple Image Component without Extra Options.', 'lasso'); ?></span> |
|
340 | 340 | |
341 | 341 | </div> |
342 | 342 | |
343 | 343 | |
344 | 344 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
345 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked( $use_wp_block_image, 'on' );?> > |
|
346 | - <label for="lasso_editor[use_wp_block_image]"><?php _e( 'Use WP Image Block', 'lasso' );?></label> |
|
347 | - <span class="lasso--setting-description"><?php _e( 'Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso' );?></span> |
|
345 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_wp_block_image]" id="lasso_editor[use_wp_block_image]" <?php echo checked($use_wp_block_image, 'on'); ?> > |
|
346 | + <label for="lasso_editor[use_wp_block_image]"><?php _e('Use WP Image Block', 'lasso'); ?></label> |
|
347 | + <span class="lasso--setting-description"><?php _e('Use WP Image Block as the image component. Gutenberg Block Editor needs to be enabled.', 'lasso'); ?></span> |
|
348 | 348 | |
349 | 349 | </div> |
350 | 350 | <?php }?> |
351 | 351 | </div> |
352 | 352 | |
353 | 353 | |
354 | - <h3><?php _e( 'Post Settings UI', 'lasso' );?></h3> |
|
354 | + <h3><?php _e('Post Settings UI', 'lasso'); ?></h3> |
|
355 | 355 | <div class="lasso-editor-settings--option-wrap" > |
356 | 356 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
357 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
358 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
359 | - <span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span> |
|
357 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
358 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
359 | + <span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span> |
|
360 | 360 | </div> |
361 | 361 | |
362 | 362 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
363 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> > |
|
364 | - <label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label> |
|
365 | - <span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span> |
|
363 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> > |
|
364 | + <label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label> |
|
365 | + <span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span> |
|
366 | 366 | </div> |
367 | 367 | |
368 | 368 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
369 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked( $allow_edit_excerpt, 'on' );?> > |
|
370 | - <label for="lasso_editor[allow_edit_excerpt]"> <?php _e( 'Allow Editing Excerpt', 'lasso' );?></label> |
|
371 | - <span class="lasso--setting-description"><?php _e( 'Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso' );?></span> |
|
369 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_edit_excerpt]" id="lasso_editor[allow_edit_excerpt]" <?php echo checked($allow_edit_excerpt, 'on'); ?> > |
|
370 | + <label for="lasso_editor[allow_edit_excerpt]"> <?php _e('Allow Editing Excerpt', 'lasso'); ?></label> |
|
371 | + <span class="lasso--setting-description"><?php _e('Allow the post\'s excerpt to be edited in the Post Setting dialog', 'lasso'); ?></span> |
|
372 | 372 | </div> |
373 | 373 | |
374 | 374 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
375 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> > |
|
376 | - <label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label> |
|
377 | - <span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span> |
|
375 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> > |
|
376 | + <label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label> |
|
377 | + <span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span> |
|
378 | 378 | </div> |
379 | 379 | |
380 | 380 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
381 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> > |
|
382 | - <label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label> |
|
383 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span> |
|
381 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> > |
|
382 | + <label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label> |
|
383 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span> |
|
384 | 384 | </div> |
385 | 385 | |
386 | 386 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
387 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> > |
|
388 | - <label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label> |
|
389 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span> |
|
387 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> > |
|
388 | + <label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label> |
|
389 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span> |
|
390 | 390 | </div> |
391 | 391 | |
392 | 392 | <div class="lasso-editor-settings--option-inner" > |
393 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
394 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
395 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span> |
|
393 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
394 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
395 | + <span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span> |
|
396 | 396 | </div> |
397 | 397 | |
398 | 398 | |
399 | 399 | </div> |
400 | 400 | |
401 | - <h3><?php _e( 'Misc', 'lasso' );?></h3> |
|
401 | + <h3><?php _e('Misc', 'lasso'); ?></h3> |
|
402 | 402 | <div class="lasso-editor-settings--option-wrap"> |
403 | 403 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
404 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> > |
|
405 | - <label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label> |
|
406 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span> |
|
404 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> > |
|
405 | + <label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label> |
|
406 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span> |
|
407 | 407 | </div> |
408 | 408 | |
409 | 409 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
410 | - <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label> |
|
411 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span> |
|
412 | - <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b |
|
413 | - <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong |
|
410 | + <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label> |
|
411 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span> |
|
412 | + <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b |
|
413 | + <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong |
|
414 | 414 | </div> |
415 | 415 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
416 | - <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label> |
|
417 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span> |
|
418 | - <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i |
|
419 | - <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em |
|
416 | + <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label> |
|
417 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span> |
|
418 | + <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i |
|
419 | + <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em |
|
420 | 420 | </div> |
421 | 421 | <div class="lasso-editor-settings--option-inner" > |
422 | - <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked( $link_prefix_http, 'on' );?> > |
|
423 | - <label for="lasso_editor[link_prefix_http]"><?php _e( 'Auto Prefix HTTP to links', 'lasso' );?></label> |
|
424 | - <span class="lasso--setting-description"><?php _e( 'When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso' );?></span> |
|
422 | + <input type="checkbox" class="checkbox" name="lasso_editor[link_prefix_http]" id="lasso_editor[link_prefix_http]" <?php echo checked($link_prefix_http, 'on'); ?> > |
|
423 | + <label for="lasso_editor[link_prefix_http]"><?php _e('Auto Prefix HTTP to links', 'lasso'); ?></label> |
|
424 | + <span class="lasso--setting-description"><?php _e('When user adds a hyperlink, automatically add http:// if the user does not specify it explicitly.', 'lasso'); ?></span> |
|
425 | 425 | </div> |
426 | 426 | </div> |
427 | 427 | |
428 | - <h3><?php _e( 'Advanced Options', 'lasso' );?></h3> |
|
429 | - <span class="lasso--setting-description"><?php _e( 'Suggested not to turn these options on without consulting the developer.', 'lasso' );?></span> |
|
428 | + <h3><?php _e('Advanced Options', 'lasso'); ?></h3> |
|
429 | + <span class="lasso--setting-description"><?php _e('Suggested not to turn these options on without consulting the developer.', 'lasso'); ?></span> |
|
430 | 430 | <span class="lasso--setting-description"> </span> |
431 | 431 | <div class="lasso-editor-settings--option-wrap "> |
432 | 432 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
433 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
434 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
435 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
433 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
434 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
435 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
436 | 436 | </div> |
437 | 437 | |
438 | 438 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
439 | - <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> > |
|
440 | - <label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label> |
|
441 | - <span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span> |
|
439 | + <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> > |
|
440 | + <label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label> |
|
441 | + <span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span> |
|
442 | 442 | </div> |
443 | 443 | |
444 | 444 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
445 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> > |
|
446 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
447 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span> |
|
445 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> > |
|
446 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
447 | + <span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span> |
|
448 | 448 | |
449 | 449 | </div> |
450 | 450 | |
451 | 451 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
452 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> > |
|
453 | - <label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label> |
|
454 | - <span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span> |
|
452 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> > |
|
453 | + <label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label> |
|
454 | + <span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span> |
|
455 | 455 | |
456 | 456 | </div> |
457 | 457 | |
458 | 458 | <div class="lasso-editor-settings--option-inner"> |
459 | - <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> > |
|
460 | - <label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label> |
|
461 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span> |
|
459 | + <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> > |
|
460 | + <label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label> |
|
461 | + <span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span> |
|
462 | 462 | |
463 | 463 | </div> |
464 | 464 | </div> |
@@ -468,11 +468,11 @@ discard block |
||
468 | 468 | |
469 | 469 | <div class="lasso-editor-settings--submit"> |
470 | 470 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
471 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
472 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
471 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
472 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
473 | 473 | </div> |
474 | 474 | |
475 | - <?php do_action('lasso_settings_after');?> |
|
475 | + <?php do_action('lasso_settings_after'); ?> |
|
476 | 476 | </form> |
477 | 477 | |
478 | 478 | </div><?php |