@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | global $post; |
22 | 22 | if ( lasso_user_can('edit_posts') |
23 | - /* uncomment this line to disable Editus on Gutenberg posts*/ |
|
24 | - /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
|
25 | - ) { |
|
23 | + /* uncomment this line to disable Editus on Gutenberg posts*/ |
|
24 | + /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
|
25 | + ) { |
|
26 | 26 | |
27 | 27 | /** Returns the time offset from UTC |
28 | - */ |
|
28 | + */ |
|
29 | 29 | function get_UTC_offset() { |
30 | 30 | $timezone_string = get_option( 'timezone_string' ); |
31 | 31 | if (empty( $timezone_string ) ) { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
42 | 42 | |
43 | - //don't load autocomplete if it's a stockholm theme |
|
43 | + //don't load autocomplete if it's a stockholm theme |
|
44 | 44 | $themename = wp_get_theme()->get('Name'); |
45 | 45 | if ($themename !='Stockholm' ) { |
46 | 46 | wp_enqueue_script('jquery-ui-autocomplete'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $tz_offset = get_UTC_offset(); |
116 | 116 | $post_date = get_the_time('U', $postid); |
117 | 117 | $time = (time()+$tz_offset); |
118 | - $delta = $time - $post_date; |
|
118 | + $delta = $time - $post_date; |
|
119 | 119 | |
120 | 120 | $strings = array( |
121 | 121 | 'save' => __('Save','lasso'), |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
171 | 171 | |
172 | 172 | |
173 | - if ($allow_change_date) { |
|
174 | - $permalink = get_site_url().'/?p='.$postid; |
|
175 | - } else { |
|
176 | - $permalink = get_permalink($postid); |
|
177 | - } |
|
173 | + if ($allow_change_date) { |
|
174 | + $permalink = get_site_url().'/?p='.$postid; |
|
175 | + } else { |
|
176 | + $permalink = get_permalink($postid); |
|
177 | + } |
|
178 | 178 | |
179 | 179 | // rest api |
180 | 180 | $rest_nonce = ''; |
@@ -268,12 +268,12 @@ discard block |
||
268 | 268 | 'customFields' => $custom_fields, |
269 | 269 | 'clickToInsert' => ($insert_comp_ui =='click'), |
270 | 270 | 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
271 | - 'rtl' => is_rtl(), |
|
271 | + 'rtl' => is_rtl(), |
|
272 | 272 | 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
273 | 273 | 'linksEditable' => $links_editable, |
274 | 274 | 'supportPendingStatus' => !$no_pending_status, |
275 | 275 | 'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table>'), |
276 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) |
|
276 | + 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) |
|
277 | 277 | ); |
278 | 278 | |
279 | 279 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | |
283 | 283 | if (!$using_restapiv2) { |
284 | - // enqueue REST API V1 |
|
284 | + // enqueue REST API V1 |
|
285 | 285 | wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
286 | 286 | $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
287 | 287 | wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | if ($show_color) { |
298 | 298 | wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
299 | 299 | } else { |
300 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
300 | + wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
301 | 301 | } |
302 | 302 | wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
303 | 303 |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | |
11 | 11 | class assets { |
12 | 12 | |
13 | - public function __construct(){ |
|
13 | + public function __construct() { |
|
14 | 14 | |
15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function scripts(){ |
|
18 | + public function scripts() { |
|
19 | 19 | |
20 | 20 | |
21 | 21 | global $post; |
22 | - if ( lasso_user_can('edit_posts') |
|
22 | + if (lasso_user_can('edit_posts') |
|
23 | 23 | /* uncomment this line to disable Editus on Gutenberg posts*/ |
24 | 24 | /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
25 | 25 | ) { |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | /** Returns the time offset from UTC |
28 | 28 | */ |
29 | 29 | function get_UTC_offset() { |
30 | - $timezone_string = get_option( 'timezone_string' ); |
|
31 | - if (empty( $timezone_string ) ) { |
|
32 | - return get_option('gmt_offset')*3600; |
|
30 | + $timezone_string = get_option('timezone_string'); |
|
31 | + if (empty($timezone_string)) { |
|
32 | + return get_option('gmt_offset') * 3600; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $origin_dtz = new \DateTimeZone($timezone_string); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
42 | 42 | |
43 | 43 | //don't load autocomplete if it's a stockholm theme |
44 | - $themename = wp_get_theme()->get('Name'); |
|
45 | - if ($themename !='Stockholm' ) { |
|
44 | + $themename = wp_get_theme()->get('Name'); |
|
45 | + if ($themename != 'Stockholm') { |
|
46 | 46 | wp_enqueue_script('jquery-ui-autocomplete'); |
47 | 47 | } |
48 | 48 | wp_enqueue_script('jquery-ui-draggable'); |
@@ -55,28 +55,28 @@ discard block |
||
55 | 55 | // url for json api |
56 | 56 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
57 | 57 | |
58 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
58 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
59 | 59 | |
60 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
60 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
61 | 61 | |
62 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
63 | - if (empty( $featImgClass )) { |
|
62 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
63 | + if (empty($featImgClass)) { |
|
64 | 64 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
65 | 65 | } |
66 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
67 | - if (empty( $titleClass )) { |
|
66 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
67 | + if (empty($titleClass)) { |
|
68 | 68 | $titleClass = lasso_get_supported_theme_title_class(); |
69 | 69 | } |
70 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
71 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
70 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
71 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
72 | 72 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
73 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
73 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
74 | 74 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
75 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
76 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
75 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
76 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
77 | 77 | |
78 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
79 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
78 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
79 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | //text alignement |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | |
94 | 94 | if ($show_color) { |
95 | 95 | //color picker |
96 | - wp_enqueue_style( 'wp-color-picker' ); |
|
97 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
96 | + wp_enqueue_style('wp-color-picker'); |
|
97 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // click to insert components, not drag and drop |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // custom fields |
108 | 108 | |
109 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
109 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
110 | 110 | |
111 | 111 | |
112 | 112 | |
@@ -114,47 +114,47 @@ discard block |
||
114 | 114 | $postid = get_the_ID(); |
115 | 115 | $tz_offset = get_UTC_offset(); |
116 | 116 | $post_date = get_the_time('U', $postid); |
117 | - $time = (time()+$tz_offset); |
|
117 | + $time = (time() + $tz_offset); |
|
118 | 118 | $delta = $time - $post_date; |
119 | 119 | |
120 | 120 | $strings = array( |
121 | - 'save' => __('Save','lasso'), |
|
122 | - 'selectText' => __('Please Select Text First.','lasso'), |
|
123 | - 'cancel' => __('Cancel','lasso'), |
|
124 | - 'exiteditor' => __('Exit Editor','lasso'), |
|
125 | - 'saving' => __('Saving...','lasso'), |
|
126 | - 'saved' => __('Saved!','lasso'), |
|
127 | - 'adding' => __('Adding...','lasso'), |
|
128 | - 'added' => __('Added!','lasso'), |
|
129 | - 'loading' => __('Loading...','lasso'), |
|
130 | - 'loadMore' => __('Load More','lasso'), |
|
131 | - 'close' => __('Close','lasso'), |
|
132 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
133 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
134 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
135 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
136 | - 'justWrite' => __('Just write...','lasso'), |
|
137 | - 'chooseImage' => __('Choose an image','lasso'), |
|
138 | - 'updateImage' => __('Update Image','lasso'), |
|
139 | - 'insertImage' => __('Insert Image','lasso'), |
|
140 | - 'selectImage' => __('Select Image','lasso'), |
|
141 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
142 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
143 | - 'chooseImages' => __('Choose images','lasso'), |
|
144 | - 'editImage' => __('Edit Image','lasso'), |
|
145 | - 'addImages' => __('Add Images','lasso'), |
|
146 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
147 | - 'selectGallery' => __('Select Editus Gallery Image','lasso'), |
|
148 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
149 | - 'publishPost' => __('Publish Post?','lasso'), |
|
150 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
151 | - 'deletePost' => __('Trash Post?','lasso'), |
|
152 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
153 | - 'warning' => __('Oh snap!','laso'), |
|
154 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
155 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
121 | + 'save' => __('Save', 'lasso'), |
|
122 | + 'selectText' => __('Please Select Text First.', 'lasso'), |
|
123 | + 'cancel' => __('Cancel', 'lasso'), |
|
124 | + 'exiteditor' => __('Exit Editor', 'lasso'), |
|
125 | + 'saving' => __('Saving...', 'lasso'), |
|
126 | + 'saved' => __('Saved!', 'lasso'), |
|
127 | + 'adding' => __('Adding...', 'lasso'), |
|
128 | + 'added' => __('Added!', 'lasso'), |
|
129 | + 'loading' => __('Loading...', 'lasso'), |
|
130 | + 'loadMore' => __('Load More', 'lasso'), |
|
131 | + 'close' => __('Close', 'lasso'), |
|
132 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
133 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
134 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
135 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
136 | + 'justWrite' => __('Just write...', 'lasso'), |
|
137 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
138 | + 'updateImage' => __('Update Image', 'lasso'), |
|
139 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
140 | + 'selectImage' => __('Select Image', 'lasso'), |
|
141 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
142 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
143 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
144 | + 'editImage' => __('Edit Image', 'lasso'), |
|
145 | + 'addImages' => __('Add Images', 'lasso'), |
|
146 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
147 | + 'selectGallery' => __('Select Editus Gallery Image', 'lasso'), |
|
148 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
149 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
150 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
151 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
152 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
153 | + 'warning' => __('Oh snap!', 'laso'), |
|
154 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
155 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
156 | 156 | 'missingConfirm' => __('Update Settings', 'lasso'), |
157 | - 'helperText' => __('one more letter','lasso'), |
|
157 | + 'helperText' => __('one more letter', 'lasso'), |
|
158 | 158 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
159 | 159 | |
160 | 160 | 'catsPlaceholder' => __('add categories...'), |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | |
164 | 164 | ); |
165 | 165 | |
166 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
166 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
167 | 167 | |
168 | 168 | $gallery_class = new gallery(); |
169 | 169 | $gallery_nonce_action = $gallery_class->nonce_action; |
170 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
170 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
171 | 171 | |
172 | 172 | |
173 | 173 | if ($allow_change_date) { |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | |
183 | 183 | if (function_exists('rest_url')) { |
184 | 184 | //$rest_root = esc_url_raw( rest_url()); |
185 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
186 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
187 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
188 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
189 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
185 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
186 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
187 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
188 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
189 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
190 | 190 | |
191 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
191 | + if (class_exists('WP_REST_Controller')) { |
|
192 | 192 | // we are using REST API V2 |
193 | 193 | $using_restapiv2 = true; |
194 | 194 | } |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | |
197 | 197 | // localized objects |
198 | 198 | $objects = array( |
199 | - 'ajaxurl' => esc_url( $api_url ), |
|
200 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
199 | + 'ajaxurl' => esc_url($api_url), |
|
200 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
201 | 201 | 'siteUrl' => site_url(), |
202 | 202 | 'rest_root' => $rest_root, |
203 | 203 | 'rest_nonce' => $rest_nonce, |
@@ -206,13 +206,13 @@ discard block |
||
206 | 206 | 'featImgClass' => $featImgClass, |
207 | 207 | 'titleClass' => $titleClass, |
208 | 208 | 'strings' => $strings, |
209 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
210 | - 'post_status' => get_post_status( $postid ), |
|
209 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
210 | + 'post_status' => get_post_status($postid), |
|
211 | 211 | 'postid' => $postid, |
212 | 212 | 'permalink' => $permalink, |
213 | 213 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
214 | 214 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
215 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
215 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
216 | 216 | 'can_publish' => is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'), |
217 | 217 | //'can_publish_posts' => current_user_can('publish_posts'), |
218 | 218 | //'can_publish_pages' => current_user_can('publish_pages'), |
@@ -248,32 +248,32 @@ discard block |
||
248 | 248 | 'postTags' => lasso_get_objects('tag'), |
249 | 249 | 'noResultsDiv' => lasso_editor_empty_results(), |
250 | 250 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
251 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
252 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
253 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
254 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
251 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
252 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
253 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
254 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
255 | 255 | 'revisionModal' => lasso_editor_revision_modal(), |
256 | 256 | 'isMobile' => wp_is_mobile(), |
257 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
257 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
258 | 258 | 'showColor' => $show_color, |
259 | 259 | 'showAlignment' => $show_align, |
260 | 260 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
261 | 261 | 'restapi2' => $using_restapiv2, |
262 | 262 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
263 | - 'newObjectContent' => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>', |
|
263 | + 'newObjectContent' => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>', |
|
264 | 264 | 'disableSavePost' => $save_to_post_disabled, |
265 | 265 | 'disableEditPost' => $edit_post_disabled, |
266 | 266 | 'boldTag' => $bold_tag, |
267 | 267 | 'iTag' => $i_tag, |
268 | 268 | 'customFields' => $custom_fields, |
269 | - 'clickToInsert' => ($insert_comp_ui =='click'), |
|
270 | - 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
|
269 | + 'clickToInsert' => ($insert_comp_ui == 'click'), |
|
270 | + 'buttonOnEmptyP' => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph |
|
271 | 271 | 'rtl' => is_rtl(), |
272 | - 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
|
272 | + 'skipToEdit' =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode |
|
273 | 273 | 'linksEditable' => $links_editable, |
274 | 274 | 'supportPendingStatus' => !$no_pending_status, |
275 | - 'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table>'), |
|
276 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)) |
|
275 | + 'tableCode' => apply_filters('lasso_table_html_code', '<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table>'), |
|
276 | + 'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)) |
|
277 | 277 | ); |
278 | 278 | |
279 | 279 | |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | |
283 | 283 | if (!$using_restapiv2) { |
284 | 284 | // enqueue REST API V1 |
285 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
286 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
287 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
285 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
286 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
287 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | if ($allow_change_date) { |
@@ -293,13 +293,13 @@ discard block |
||
293 | 293 | wp_enqueue_style('jquery-ui'); |
294 | 294 | } |
295 | 295 | |
296 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
296 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
297 | 297 | if ($show_color) { |
298 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
298 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
299 | 299 | } else { |
300 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
300 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
301 | 301 | } |
302 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
302 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
303 | 303 | |
304 | 304 | |
305 | 305 | } |
@@ -11,39 +11,39 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @since 1.0 |
13 | 13 | */ |
14 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
14 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
15 | 15 | function lasso_editor_controls() { |
16 | 16 | |
17 | 17 | global $post; |
18 | 18 | |
19 | - if ( lasso_user_can('edit_posts') ) { |
|
19 | + if (lasso_user_can('edit_posts')) { |
|
20 | 20 | |
21 | - $status = get_post_status( get_the_ID() ); |
|
22 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
23 | - $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff'); |
|
24 | - $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000'); |
|
25 | - $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055'); |
|
26 | - $text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff'); |
|
21 | + $status = get_post_status(get_the_ID()); |
|
22 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
23 | + $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff'); |
|
24 | + $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000'); |
|
25 | + $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055'); |
|
26 | + $text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff'); |
|
27 | 27 | $hover_color1 = lasso_editor_adjustBrightness($button_color1, 50); |
28 | 28 | $hover_color2 = lasso_editor_adjustBrightness($button_color2, 50); |
29 | 29 | |
30 | 30 | // let users add custom css classes |
31 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
31 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
32 | 32 | |
33 | 33 | $post_access_class = ''; |
34 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
35 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
36 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
34 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
35 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
36 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // CSS class if adding new post objects is disabled |
40 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
40 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if adjust settings is disabled |
43 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
43 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
44 | 44 | |
45 | 45 | // CSS class if adding new post objects AND settings are disabled |
46 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
46 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
47 | 47 | |
48 | 48 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
49 | 49 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ?> |
58 | 58 | <style> |
59 | 59 | #lasso-html--table:before { |
60 | - content: "<?php esc_attr_e( 'Table', 'lasso' );?>"; |
|
60 | + content: "<?php esc_attr_e('Table', 'lasso'); ?>"; |
|
61 | 61 | } |
62 | 62 | </style> |
63 | 63 | |
@@ -68,31 +68,31 @@ discard block |
||
68 | 68 | <style> |
69 | 69 | |
70 | 70 | .lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish { |
71 | - background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
72 | - background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
73 | - background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
74 | - color: <?php echo $text_color;?>; |
|
71 | + background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
72 | + background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
73 | + background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
74 | + color: <?php echo $text_color; ?>; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | .lasso--controls__right a:before, #lasso-toolbar--html__footer_desc { |
78 | - color: <?php echo $text_color;?> !important; |
|
78 | + color: <?php echo $text_color; ?> !important; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | 83 | ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover { |
84 | - background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
85 | - background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
86 | - background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
84 | + background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
85 | + background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
86 | + background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | .lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap, |
90 | 90 | #lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap { |
91 | - background: <?php echo $dialog_color;?>; |
|
92 | - color: <?php echo $text_color;?>; |
|
91 | + background: <?php echo $dialog_color; ?>; |
|
92 | + color: <?php echo $text_color; ?>; |
|
93 | 93 | } |
94 | 94 | .sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label { |
95 | - color: <?php echo $text_color;?> !important; |
|
95 | + color: <?php echo $text_color; ?> !important; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | <?php if (!$is_mobile) { ?> |
@@ -122,48 +122,48 @@ discard block |
||
122 | 122 | <?php |
123 | 123 | } |
124 | 124 | ?> |
125 | - <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" > |
|
125 | + <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" > |
|
126 | 126 | |
127 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
127 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
128 | 128 | |
129 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
129 | + <?php do_action('lasso_editor_controls_before'); |
|
130 | 130 | |
131 | - if ( $is_capable ) { ?> |
|
131 | + if ($is_capable) { ?> |
|
132 | 132 | |
133 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
133 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
134 | 134 | |
135 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
136 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
135 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
136 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
137 | 137 | <?php } |
138 | 138 | |
139 | 139 | } ?> |
140 | 140 | |
141 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
141 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
142 | 142 | |
143 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
144 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
143 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
144 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
145 | 145 | <?php } ?> |
146 | 146 | |
147 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?> |
|
148 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
147 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?> |
|
148 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
149 | 149 | <?php } ?> |
150 | 150 | |
151 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
151 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
152 | 152 | |
153 | 153 | </ul> |
154 | 154 | |
155 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
155 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
156 | 156 | |
157 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
157 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
158 | 158 | |
159 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
160 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
159 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
160 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
161 | 161 | |
162 | 162 | |
163 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
163 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
164 | 164 | |
165 | - <?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?> |
|
166 | - <a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
165 | + <?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?> |
|
166 | + <a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
167 | 167 | <?php } ?> |
168 | 168 | |
169 | 169 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | </div> |
175 | 175 | |
176 | 176 | |
177 | - <?php do_action( 'lasso_editor_controls_after_outside' );?> |
|
177 | + <?php do_action('lasso_editor_controls_after_outside'); ?> |
|
178 | 178 | |
179 | 179 | <?php } |
180 | 180 | } |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | |
193 | 193 | |
194 | 194 | // let users add custom css classes |
195 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
195 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
196 | 196 | ?> |
197 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
197 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
198 | 198 | <div class="lasso--sidebar__inner"> |
199 | 199 | <div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div> |
200 | 200 | </div> |
@@ -216,21 +216,21 @@ discard block |
||
216 | 216 | $is_mobile = wp_is_mobile(); |
217 | 217 | |
218 | 218 | // check for lasso story engine and add a class doniting this |
219 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
219 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
220 | 220 | |
221 | 221 | // let users add custom css classes |
222 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
222 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
223 | 223 | |
224 | 224 | // are toolbar headings enabled |
225 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
226 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
227 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
225 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
226 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
227 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
228 | 228 | |
229 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
229 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
230 | 230 | |
231 | 231 | // mobile styles |
232 | 232 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
233 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
233 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
234 | 234 | |
235 | 235 | //show color |
236 | 236 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -238,126 +238,126 @@ discard block |
||
238 | 238 | //show alignment |
239 | 239 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
240 | 240 | |
241 | - $status = get_post_status( get_the_ID() ); |
|
241 | + $status = get_post_status(get_the_ID()); |
|
242 | 242 | |
243 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
243 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
244 | 244 | |
245 | 245 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
246 | 246 | |
247 | 247 | |
248 | 248 | ?> |
249 | - <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
|
250 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
251 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
252 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
253 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
254 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
255 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
256 | - <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
249 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
250 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
251 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
252 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
253 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
254 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
255 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
256 | + <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
257 | 257 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
258 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
259 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
260 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
261 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
262 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
263 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
264 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
265 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
266 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
267 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
268 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
269 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
270 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
271 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
272 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
273 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
258 | + <?php if ('ase-active' == $ase_status): ?> |
|
259 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
260 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
261 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
262 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
263 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
264 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
265 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
266 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
267 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
268 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
269 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
270 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
271 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
272 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
273 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
274 | 274 | <?php }?> |
275 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
276 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
275 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
276 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
277 | 277 | <?php }?> |
278 | 278 | <?php else: ?> |
279 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
280 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
281 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
279 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
280 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
281 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
282 | 282 | <?php endif; ?> |
283 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
283 | + <?php do_action('lasso_toolbar_components'); ?> |
|
284 | 284 | </ul> |
285 | 285 | </li> |
286 | - <?php if ( $toolbar_headings ): ?> |
|
287 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
288 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
286 | + <?php if ($toolbar_headings): ?> |
|
287 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
288 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
289 | 289 | <?php endif; ?> |
290 | 290 | |
291 | 291 | |
292 | 292 | |
293 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
294 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
295 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
296 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
293 | + <?php if ($toolbar_headings_h4): ?> |
|
294 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
295 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
296 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
297 | 297 | <?php endif; ?> |
298 | 298 | |
299 | - <?php if ( $show_color ): ?> |
|
300 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
301 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
299 | + <?php if ($show_color): ?> |
|
300 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
301 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
302 | 302 | <?php endif; ?> |
303 | 303 | |
304 | - <?php if ( $toolbar_list ): ?> |
|
305 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
306 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
304 | + <?php if ($toolbar_list): ?> |
|
305 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
306 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
307 | 307 | <?php endif; ?> |
308 | 308 | |
309 | 309 | |
310 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
310 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
311 | 311 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
312 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
313 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
312 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
313 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
314 | 314 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
315 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
315 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
316 | 316 | </div> |
317 | 317 | </li> |
318 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
319 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
318 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
319 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
320 | 320 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
321 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
321 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
322 | 322 | <div id="lasso-toolbar--html__footer"> |
323 | 323 | <div id="lasso-toolbar--html__footer_desc" > |
324 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
325 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
326 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
324 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
325 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
326 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
327 | 327 | </div> |
328 | 328 | <ul class="lasso-toolbar--html-snips"> |
329 | 329 | |
330 | - <?php if ( !$toolbar_headings ): ?> |
|
331 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
332 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
330 | + <?php if (!$toolbar_headings): ?> |
|
331 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
332 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
333 | 333 | <?php endif; ?> |
334 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
335 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
334 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
335 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
336 | 336 | |
337 | - <li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>"> |
|
337 | + <li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>"> |
|
338 | 338 | </ul> |
339 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
340 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
339 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
340 | + <a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
341 | 341 | </div> |
342 | 342 | </div> |
343 | 343 | </li> |
344 | - <?php if ( $show_align ): ?> |
|
345 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
346 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
347 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
344 | + <?php if ($show_align): ?> |
|
345 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
346 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
347 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
348 | 348 | <?php endif; ?> |
349 | 349 | </ul> |
350 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
350 | + <?php if (is_singular() && $is_mobile) { ?> |
|
351 | 351 | |
352 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
352 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
353 | 353 | |
354 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
355 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
354 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
355 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
356 | 356 | |
357 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
357 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
358 | 358 | |
359 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
360 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
359 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
360 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
361 | 361 | <?php } ?> |
362 | 362 | |
363 | 363 | </div> |
@@ -375,20 +375,20 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function lasso_editor_settings_toolbar() { |
377 | 377 | |
378 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
378 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
379 | 379 | |
380 | 380 | ob_start(); |
381 | 381 | |
382 | 382 | |
383 | 383 | // let users add custom css classes |
384 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
384 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
385 | 385 | |
386 | 386 | ?> |
387 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
388 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
389 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
390 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
391 | - <li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
387 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
388 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
389 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
390 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
391 | + <li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
392 | 392 | </ul> |
393 | 393 | |
394 | 394 | <?php return ob_get_clean(); |
@@ -406,13 +406,13 @@ discard block |
||
406 | 406 | |
407 | 407 | |
408 | 408 | // has post thumbnail |
409 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
409 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
410 | 410 | |
411 | 411 | ?> |
412 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
413 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
414 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
415 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
412 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
413 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
414 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
415 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
416 | 416 | </ul> |
417 | 417 | |
418 | 418 | <?php return ob_get_clean(); |
@@ -436,55 +436,55 @@ discard block |
||
436 | 436 | |
437 | 437 | $postid = get_the_ID(); |
438 | 438 | |
439 | - $status = get_post_status( $postid ); |
|
440 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
439 | + $status = get_post_status($postid); |
|
440 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
441 | 441 | |
442 | 442 | // let users add custom css classes |
443 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
443 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
444 | 444 | |
445 | 445 | // objects categories |
446 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
447 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
446 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
447 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
448 | 448 | |
449 | 449 | // modal tabs |
450 | - $tabs = lasso_modal_addons('tab'); |
|
451 | - $content = lasso_modal_addons('content'); |
|
450 | + $tabs = lasso_modal_addons('tab'); |
|
451 | + $content = lasso_modal_addons('content'); |
|
452 | 452 | |
453 | 453 | //editor options |
454 | 454 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
455 | 455 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
456 | 456 | |
457 | 457 | // are we singular |
458 | - $is_singular = is_singular(); |
|
458 | + $is_singular = is_singular(); |
|
459 | 459 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
460 | 460 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
461 | 461 | $theme_supports = current_theme_supports('post-thumbnails'); |
462 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
462 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
463 | 463 | |
464 | 464 | // do we support pending status |
465 | 465 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
466 | 466 | |
467 | 467 | ?> |
468 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
468 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
469 | 469 | <div class="lasso--modal__inner"> |
470 | 470 | |
471 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
471 | + <?php if ($tabs) { echo $tabs; } ?> |
|
472 | 472 | |
473 | 473 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
474 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
474 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
475 | 475 | |
476 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
476 | + <?php if ($is_singular && $theme_supports) : ?> |
|
477 | 477 | <div class="lasso--postsettings__left"> |
478 | - <label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
479 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
478 | + <label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
479 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
480 | 480 | |
481 | 481 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
482 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
483 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
482 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
483 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
484 | 484 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
485 | 485 | </div> |
486 | 486 | |
487 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
487 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
488 | 488 | |
489 | 489 | </div> |
490 | 490 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -494,15 +494,15 @@ discard block |
||
494 | 494 | |
495 | 495 | <div class="lasso--postsettings__right"> |
496 | 496 | |
497 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
497 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
498 | 498 | <div class="lasso--postsettings__option story-status-option"> |
499 | - <label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
500 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
501 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
502 | - <?php if( !$no_pending_status ): ?> |
|
503 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
499 | + <label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
500 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
501 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
502 | + <?php if (!$no_pending_status): ?> |
|
503 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
504 | 504 | <?php endif; ?> |
505 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
505 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
506 | 506 | </ul> |
507 | 507 | <div class="lasso--slider_wrap"> |
508 | 508 | <div id="lasso--slider"></div> |
@@ -510,10 +510,10 @@ discard block |
||
510 | 510 | </div> |
511 | 511 | <?php endif; ?> |
512 | 512 | |
513 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
513 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
514 | 514 | <div class="lasso--postsettings__option story-slug-option"> |
515 | - <label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
516 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
515 | + <label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
516 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
517 | 517 | </div> |
518 | 518 | <?php endif; ?> |
519 | 519 | |
@@ -522,21 +522,21 @@ discard block |
||
522 | 522 | <div class="lasso--postsettings__middle"> |
523 | 523 | |
524 | 524 | <div class="lasso--postsettings__option story-categories-option"> |
525 | - <label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
526 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
525 | + <label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
526 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
527 | 527 | </div> |
528 | 528 | |
529 | 529 | <div class="lasso--postsettings__option story-tags-option"> |
530 | - <label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
531 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
530 | + <label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
531 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
532 | 532 | </div> |
533 | 533 | <?php |
534 | 534 | if ($allow_change_date) { |
535 | - $dateformat = get_option( 'date_format' ); |
|
535 | + $dateformat = get_option('date_format'); |
|
536 | 536 | ?> |
537 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
538 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
539 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
537 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
538 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
539 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
540 | 540 | <?php |
541 | 541 | }?> |
542 | 542 | |
@@ -558,23 +558,23 @@ discard block |
||
558 | 558 | ?> |
559 | 559 | <!--/div--> |
560 | 560 | |
561 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
561 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
562 | 562 | |
563 | 563 | <div class="lasso--postsettings__footer" > |
564 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
564 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
565 | 565 | <input type="hidden" name="status" value=""> |
566 | 566 | <input type="hidden" name="categories" value=""> |
567 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
567 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
568 | 568 | <input type="hidden" name="action" value="process_update-object_post"> |
569 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
570 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
571 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
569 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
570 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
571 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
572 | 572 | </div> |
573 | 573 | |
574 | 574 | </form> |
575 | 575 | </div> |
576 | 576 | |
577 | - <?php if( $tabs ) { echo $content; } ?> |
|
577 | + <?php if ($tabs) { echo $content; } ?> |
|
578 | 578 | |
579 | 579 | </div> |
580 | 580 | |
@@ -596,41 +596,41 @@ discard block |
||
596 | 596 | ob_start(); |
597 | 597 | |
598 | 598 | |
599 | - $status = get_post_status( get_the_ID() ); |
|
599 | + $status = get_post_status(get_the_ID()); |
|
600 | 600 | |
601 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
601 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
602 | 602 | |
603 | 603 | // let users add custom css classes |
604 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
604 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
605 | 605 | |
606 | 606 | // return the post type |
607 | - $type = get_post_type( get_the_ID() ); |
|
607 | + $type = get_post_type(get_the_ID()); |
|
608 | 608 | |
609 | 609 | $mobile_style = ""; |
610 | 610 | if (wp_is_mobile()) { |
611 | 611 | $mobile_style = 'style="top:140px !important;"'; |
612 | 612 | } |
613 | 613 | ?> |
614 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
614 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
615 | 615 | <div class="lasso--modal__inner lasso--hasnewform"> |
616 | 616 | |
617 | 617 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
618 | 618 | |
619 | 619 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
620 | - <label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
621 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
620 | + <label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
621 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
622 | 622 | <div class="lasso--select-wrap" style="width:90px"> |
623 | 623 | <select id="lasso--select-type" name="story_type"> |
624 | 624 | |
625 | 625 | <?php |
626 | 626 | $types = lasso_post_types_names(); |
627 | - if ( !empty( $types ) ) { |
|
628 | - foreach( $types as $name => $label ) { |
|
629 | - $type = preg_replace( '/s\b/','', $name ); |
|
627 | + if (!empty($types)) { |
|
628 | + foreach ($types as $name => $label) { |
|
629 | + $type = preg_replace('/s\b/', '', $name); |
|
630 | 630 | if ($type == 'page' && !current_user_can('edit_pages')) { |
631 | 631 | continue; |
632 | 632 | } |
633 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
633 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
634 | 634 | } |
635 | 635 | |
636 | 636 | } |
@@ -641,19 +641,19 @@ discard block |
||
641 | 641 | </div> |
642 | 642 | |
643 | 643 | <div class="lasso--postsettings__footer"> |
644 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
644 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
645 | 645 | <input type="hidden" name="action" value="process_new-object_post"> |
646 | 646 | <?php |
647 | - if ( !empty( $types ) ) { |
|
647 | + if (!empty($types)) { |
|
648 | 648 | // get the first element |
649 | 649 | $keys = array_keys($types); |
650 | - $type =$keys[0]; |
|
651 | - $type = preg_replace( '/s\b/','', $type ); |
|
652 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
650 | + $type = $keys[0]; |
|
651 | + $type = preg_replace('/s\b/', '', $type); |
|
652 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
653 | 653 | } |
654 | 654 | ?> |
655 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
656 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
655 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
656 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
657 | 657 | </div> |
658 | 658 | |
659 | 659 | </form> |
@@ -681,18 +681,18 @@ discard block |
||
681 | 681 | ob_start(); |
682 | 682 | |
683 | 683 | // post status |
684 | - $status = get_post_status( get_the_ID() ); |
|
684 | + $status = get_post_status(get_the_ID()); |
|
685 | 685 | |
686 | 686 | // let users add custom css classes |
687 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
687 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
688 | 688 | |
689 | 689 | ?> |
690 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
690 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
691 | 691 | <div class="lasso--modal__inner"> |
692 | 692 | |
693 | 693 | <div class="lasso--post-filtering not-visible"> |
694 | 694 | <div class="lasso--search__results"> |
695 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
695 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
696 | 696 | </div> |
697 | 697 | <div class="lasso--search"> |
698 | 698 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -706,18 +706,18 @@ discard block |
||
706 | 706 | $post_types = lasso_post_types_names(); |
707 | 707 | $rest_bases = lasso_post_types_rest_base(); |
708 | 708 | |
709 | - if ( ! empty( $post_types ) ) { |
|
709 | + if (!empty($post_types)) { |
|
710 | 710 | $first = 'active'; |
711 | - foreach( $post_types as $name => $label ) { |
|
711 | + foreach ($post_types as $name => $label) { |
|
712 | 712 | if (array_key_exists($name, $rest_bases)) { |
713 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
713 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
714 | 714 | } |
715 | 715 | $first = ''; |
716 | 716 | } |
717 | 717 | |
718 | 718 | } |
719 | 719 | |
720 | - do_action('lasso_modal_post_objects');?> |
|
720 | + do_action('lasso_modal_post_objects'); ?> |
|
721 | 721 | |
722 | 722 | </ul> |
723 | 723 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -737,14 +737,14 @@ discard block |
||
737 | 737 | |
738 | 738 | |
739 | 739 | // let users add custom css classes |
740 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
740 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
741 | 741 | |
742 | 742 | ?> |
743 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
744 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
745 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
746 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
747 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
743 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
744 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
745 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
746 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
747 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
748 | 748 | </ul> |
749 | 749 | |
750 | 750 | <?php return ob_get_clean(); |
@@ -756,14 +756,14 @@ discard block |
||
756 | 756 | |
757 | 757 | |
758 | 758 | // let users add custom css classes |
759 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
759 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
760 | 760 | |
761 | 761 | ?> |
762 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
763 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
764 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
765 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
766 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
762 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
763 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
764 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
765 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
766 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
767 | 767 | </ul> |
768 | 768 | |
769 | 769 | <?php return ob_get_clean(); |
@@ -776,16 +776,16 @@ discard block |
||
776 | 776 | */ |
777 | 777 | function lasso_map_form_footer() { |
778 | 778 | |
779 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
779 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
780 | 780 | |
781 | 781 | ob_start(); |
782 | 782 | |
783 | 783 | ?> |
784 | 784 | <div class="lasso--map-form__footer"> |
785 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
786 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
785 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
786 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
787 | 787 | <input type="hidden" name="action" value="process_map_save"> |
788 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
788 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
789 | 789 | </div> |
790 | 790 | |
791 | 791 | <?php return ob_get_clean(); |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | |
804 | 804 | ?> |
805 | 805 | <div id="lasso--pagerefresh" class="visible"> |
806 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
806 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
807 | 807 | </div> |
808 | 808 | |
809 | 809 | <?php return ob_get_clean(); |
@@ -817,43 +817,43 @@ discard block |
||
817 | 817 | */ |
818 | 818 | function lasso_editor_options_blob() { |
819 | 819 | |
820 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
821 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
820 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
821 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
822 | 822 | |
823 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
823 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
824 | 824 | |
825 | 825 | $blob = array(); |
826 | 826 | |
827 | - if ( empty( $codes ) ) |
|
827 | + if (empty($codes)) |
|
828 | 828 | return; |
829 | 829 | |
830 | - foreach ( $codes as $slug => $shortcode ) { |
|
830 | + foreach ($codes as $slug => $shortcode) { |
|
831 | 831 | $return = ''; |
832 | 832 | // Shortcode has atts |
833 | 833 | |
834 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
834 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
835 | 835 | |
836 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
836 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
837 | 837 | |
838 | 838 | |
839 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
839 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
840 | 840 | |
841 | 841 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
842 | 842 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
843 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
843 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
844 | 844 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
845 | 845 | // Select |
846 | 846 | |
847 | - if ( isset( $attr_info['values'] ) ) { |
|
847 | + if (isset($attr_info['values'])) { |
|
848 | 848 | |
849 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
849 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
850 | 850 | |
851 | - $i=0; |
|
851 | + $i = 0; |
|
852 | 852 | |
853 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
853 | + foreach ($attr_info['values'] as $attr_value) { |
|
854 | 854 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
855 | 855 | |
856 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
856 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
857 | 857 | |
858 | 858 | $i++; |
859 | 859 | } |
@@ -862,24 +862,24 @@ discard block |
||
862 | 862 | |
863 | 863 | } else { |
864 | 864 | |
865 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
865 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
866 | 866 | |
867 | 867 | // image upload |
868 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
868 | + if ('media_upload' == $attr_info['type']) { |
|
869 | 869 | |
870 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
870 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
871 | 871 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
872 | 872 | |
873 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
873 | + } elseif ('color' == $attr_info['type']) { |
|
874 | 874 | |
875 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
875 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
876 | 876 | |
877 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
877 | + } elseif ('text_area' == $attr_info['type']) { |
|
878 | 878 | |
879 | - $return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
879 | + $return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
880 | 880 | |
881 | 881 | } else { |
882 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
882 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
883 | 883 | } |
884 | 884 | } |
885 | 885 | $return .= '</p>'; |
@@ -890,9 +890,9 @@ discard block |
||
890 | 890 | /////////////////////////// |
891 | 891 | // START GALLERY AND MAP FRONT END STUFFS |
892 | 892 | /////////////////////////// |
893 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
893 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
894 | 894 | |
895 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
895 | + if ('gallery' == $shortcode['front_type']) { |
|
896 | 896 | |
897 | 897 | $return .= lasso_gallery_editor_module(); |
898 | 898 | |
@@ -903,13 +903,13 @@ discard block |
||
903 | 903 | /////////////////////////// |
904 | 904 | |
905 | 905 | // Single shortcode (not closed) |
906 | - if ( 'single' == $shortcode['type'] ) { |
|
906 | + if ('single' == $shortcode['type']) { |
|
907 | 907 | |
908 | 908 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
909 | 909 | |
910 | 910 | } else { |
911 | 911 | |
912 | - $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>'; |
|
912 | + $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>'; |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>'; |
@@ -945,14 +945,14 @@ discard block |
||
945 | 945 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
946 | 946 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
947 | 947 | <i class="lasso-icon lasso-icon-move"></i> |
948 | - <label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
948 | + <label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
949 | 949 | <div class="lasso--slider_wrap"> |
950 | 950 | <div id="lasso--slider"></div> |
951 | 951 | </div> |
952 | 952 | <ul id="lasso--revision-list"></ul> |
953 | 953 | <div class="lasso--btn-group lasso--btn-group-small"> |
954 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
955 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
954 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
955 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
956 | 956 | </div> |
957 | 957 | </div> |
958 | 958 | |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | // Normalize into a six character long hex string |
976 | 976 | $hex = str_replace('#', '', $hex); |
977 | 977 | if (strlen($hex) == 3) { |
978 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
978 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | // Split into three parts: R, G and B |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | |
985 | 985 | foreach ($color_parts as $color) { |
986 | 986 | $color = hexdec($color); // Convert to decimal |
987 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
987 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
988 | 988 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
989 | 989 | } |
990 | 990 |
@@ -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.1.7' ); |
|
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.1.7'); |
|
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,16 +88,16 @@ 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 |