@@ -10,15 +10,15 @@ 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 | - if ( lasso_user_can('edit_posts')) { |
|
21 | + if (lasso_user_can('edit_posts')) { |
|
22 | 22 | |
23 | 23 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
24 | 24 | |
@@ -33,27 +33,27 @@ discard block |
||
33 | 33 | // url for json api |
34 | 34 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
35 | 35 | |
36 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
36 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
37 | 37 | |
38 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
38 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
39 | 39 | |
40 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
41 | - if (empty( $featImgClass )) { |
|
40 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
41 | + if (empty($featImgClass)) { |
|
42 | 42 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
43 | 43 | } |
44 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
45 | - if (empty( $titleClass )) { |
|
44 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
45 | + if (empty($titleClass)) { |
|
46 | 46 | $titleClass = lasso_get_supported_theme_title_class(); |
47 | 47 | } |
48 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
49 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
50 | 50 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
51 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
51 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
52 | 52 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
53 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
53 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
54 | 54 | |
55 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
56 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
55 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
56 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | //text alignement |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | |
65 | 65 | if ($show_color) { |
66 | 66 | //color picker |
67 | - wp_enqueue_style( 'wp-color-picker' ); |
|
68 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
67 | + wp_enqueue_style('wp-color-picker'); |
|
68 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // custom fields |
72 | 72 | |
73 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
73 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | |
@@ -81,60 +81,60 @@ discard block |
||
81 | 81 | $delta = time() - $post_date; |
82 | 82 | |
83 | 83 | $strings = array( |
84 | - 'save' => __('Save','lasso'), |
|
85 | - 'saving' => __('Saving...','lasso'), |
|
86 | - 'saved' => __('Saved!','lasso'), |
|
87 | - 'adding' => __('Adding...','lasso'), |
|
88 | - 'added' => __('Added!','lasso'), |
|
89 | - 'loading' => __('Loading...','lasso'), |
|
90 | - 'loadMore' => __('Load More','lasso'), |
|
91 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
92 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
93 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
94 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
95 | - 'justWrite' => __('Just write...','lasso'), |
|
96 | - 'chooseImage' => __('Choose an image','lasso'), |
|
97 | - 'updateImage' => __('Update Image','lasso'), |
|
98 | - 'insertImage' => __('Insert Image','lasso'), |
|
99 | - 'selectImage' => __('Select Image','lasso'), |
|
100 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
101 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
102 | - 'chooseImages' => __('Choose images','lasso'), |
|
103 | - 'editImage' => __('Edit Image','lasso'), |
|
104 | - 'addImages' => __('Add Images','lasso'), |
|
105 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
106 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
107 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
108 | - 'publishPost' => __('Publish Post?','lasso'), |
|
109 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
110 | - 'deletePost' => __('Trash Post?','lasso'), |
|
111 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
112 | - 'warning' => __('Oh snap!','laso'), |
|
113 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
114 | - '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'), |
|
84 | + 'save' => __('Save', 'lasso'), |
|
85 | + 'saving' => __('Saving...', 'lasso'), |
|
86 | + 'saved' => __('Saved!', 'lasso'), |
|
87 | + 'adding' => __('Adding...', 'lasso'), |
|
88 | + 'added' => __('Added!', 'lasso'), |
|
89 | + 'loading' => __('Loading...', 'lasso'), |
|
90 | + 'loadMore' => __('Load More', 'lasso'), |
|
91 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
92 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
93 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
94 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
95 | + 'justWrite' => __('Just write...', 'lasso'), |
|
96 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
97 | + 'updateImage' => __('Update Image', 'lasso'), |
|
98 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
99 | + 'selectImage' => __('Select Image', 'lasso'), |
|
100 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
101 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
102 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
103 | + 'editImage' => __('Edit Image', 'lasso'), |
|
104 | + 'addImages' => __('Add Images', 'lasso'), |
|
105 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
106 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
107 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
108 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
109 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
110 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
111 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
112 | + 'warning' => __('Oh snap!', 'laso'), |
|
113 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
114 | + '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'), |
|
115 | 115 | 'missingConfirm' => __('Update Settings', 'lasso'), |
116 | - 'helperText' => __('one more letter','lasso'), |
|
116 | + 'helperText' => __('one more letter', 'lasso'), |
|
117 | 117 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
118 | 118 | ); |
119 | 119 | |
120 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
120 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
121 | 121 | |
122 | 122 | $gallery_class = new gallery(); |
123 | 123 | $gallery_nonce_action = $gallery_class->nonce_action; |
124 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
124 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
125 | 125 | |
126 | 126 | // rest api |
127 | 127 | $rest_nonce = ''; |
128 | - $rest_root =''; |
|
128 | + $rest_root = ''; |
|
129 | 129 | if (function_exists('rest_url')) { |
130 | - $rest_root = esc_url_raw( rest_url()); |
|
131 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
132 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
133 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
134 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
135 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
130 | + $rest_root = esc_url_raw(rest_url()); |
|
131 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
132 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
133 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
134 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
135 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
136 | 136 | |
137 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
137 | + if (class_exists('WP_REST_Controller')) { |
|
138 | 138 | // we are using REST API V2 |
139 | 139 | $using_restapiv2 = true; |
140 | 140 | } |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | // localized objects |
144 | 144 | $objects = array( |
145 | - 'ajaxurl' => esc_url( $api_url ), |
|
146 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
145 | + 'ajaxurl' => esc_url($api_url), |
|
146 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
147 | 147 | 'rest_root' => $rest_root, |
148 | 148 | 'rest_nonce' => $rest_nonce, |
149 | 149 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | 'featImgClass' => $featImgClass, |
152 | 152 | 'titleClass' => $titleClass, |
153 | 153 | 'strings' => $strings, |
154 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
155 | - 'post_status' => get_post_status( $postid ), |
|
154 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
155 | + 'post_status' => get_post_status($postid), |
|
156 | 156 | 'postid' => $postid, |
157 | 157 | 'permalink' => get_permalink(), |
158 | 158 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
159 | 159 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
160 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
160 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
161 | 161 | 'can_publish_posts' => current_user_can('publish_posts'), |
162 | 162 | 'can_publish_pages' => current_user_can('publish_pages'), |
163 | 163 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -192,24 +192,24 @@ discard block |
||
192 | 192 | 'postTags' => lasso_get_objects('tag'), |
193 | 193 | 'noResultsDiv' => lasso_editor_empty_results(), |
194 | 194 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
195 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
196 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
197 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
198 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
195 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
196 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
197 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
198 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
199 | 199 | 'revisionModal' => lasso_editor_revision_modal(), |
200 | 200 | 'isMobile' => wp_is_mobile(), |
201 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
201 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
202 | 202 | 'showColor' => $show_color, |
203 | 203 | 'showAlignment' => $show_align, |
204 | 204 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
205 | 205 | 'restapi2' => $using_restapiv2, |
206 | 206 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
207 | - 'newObjectContent' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ), |
|
207 | + 'newObjectContent' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')), |
|
208 | 208 | 'disableSavePost' => $save_to_post_disabled, |
209 | 209 | 'boldTag' => $bold_tag, |
210 | 210 | 'iTag' => $i_tag, |
211 | 211 | 'customFields' => $custom_fields, |
212 | - 'skipToEdit' =>( $delta < 30 ) // if it's a new post, skip to edit mode |
|
212 | + 'skipToEdit' =>($delta < 30) // if it's a new post, skip to edit mode |
|
213 | 213 | ); |
214 | 214 | |
215 | 215 | |
@@ -218,18 +218,18 @@ discard block |
||
218 | 218 | |
219 | 219 | if (!$using_restapiv2) { |
220 | 220 | // enqueue REST API V1 |
221 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
222 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
223 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
221 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
222 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
223 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
224 | 224 | } |
225 | 225 | |
226 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
226 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
227 | 227 | if ($show_color) { |
228 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
228 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
229 | 229 | } else { |
230 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
230 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
231 | 231 | } |
232 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
232 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
233 | 233 | |
234 | 234 | |
235 | 235 | } |
@@ -16,80 +16,80 @@ discard block |
||
16 | 16 | |
17 | 17 | $array = array( |
18 | 18 | 'quote' => array( |
19 | - 'name' => __('Quote','lasso'), |
|
19 | + 'name' => __('Quote', 'lasso'), |
|
20 | 20 | 'content' => lasso_quote_component(), |
21 | 21 | ), |
22 | 22 | 'image' => array( |
23 | - 'name' => __('Image','lasso'), |
|
23 | + 'name' => __('Image', 'lasso'), |
|
24 | 24 | 'content' => lasso_image_component(), |
25 | 25 | ), |
26 | 26 | 'parallax' => array( |
27 | - 'name' => __('Parallax','lasso'), |
|
27 | + 'name' => __('Parallax', 'lasso'), |
|
28 | 28 | 'content' => lasso_parallax_component(), |
29 | 29 | ), |
30 | 30 | 'audio' => array( |
31 | - 'name' => __('Audio','lasso'), |
|
31 | + 'name' => __('Audio', 'lasso'), |
|
32 | 32 | 'content' => lasso_audio_component(), |
33 | 33 | ), |
34 | 34 | 'content' => array( |
35 | - 'name' => __('Content','lasso'), |
|
35 | + 'name' => __('Content', 'lasso'), |
|
36 | 36 | 'content' => lasso_content_component(), |
37 | 37 | ), |
38 | 38 | 'character' => array( |
39 | - 'name' => __('Character','lasso'), |
|
39 | + 'name' => __('Character', 'lasso'), |
|
40 | 40 | 'content' => lasso_character_component(), |
41 | 41 | ), |
42 | 42 | 'collection' => array( |
43 | - 'name' => __('Collection','lasso'), |
|
43 | + 'name' => __('Collection', 'lasso'), |
|
44 | 44 | 'content' => lasso_collections_component(), |
45 | 45 | ), |
46 | 46 | 'document' => array( |
47 | - 'name' => __('Document','lasso'), |
|
47 | + 'name' => __('Document', 'lasso'), |
|
48 | 48 | 'content' => lasso_document_component(), |
49 | 49 | ), |
50 | 50 | 'gallery' => array( |
51 | - 'name' => __('Gallery','lasso'), |
|
51 | + 'name' => __('Gallery', 'lasso'), |
|
52 | 52 | 'content' => lasso_gallery_component(), |
53 | 53 | ), |
54 | 54 | 'chapter' => array( |
55 | - 'name' => __('Chapter','lasso'), |
|
55 | + 'name' => __('Chapter', 'lasso'), |
|
56 | 56 | 'content' => lasso_heading_component(), |
57 | 57 | ), |
58 | 58 | 'map' => array( |
59 | - 'name' => __('Map','lasso'), |
|
59 | + 'name' => __('Map', 'lasso'), |
|
60 | 60 | 'content' => lasso_map_component(), |
61 | 61 | ), |
62 | 62 | 'timeline_stop' => array( |
63 | - 'name' => __('Timeline','lasso'), |
|
63 | + 'name' => __('Timeline', 'lasso'), |
|
64 | 64 | 'content' => lasso_timeline_component(), |
65 | 65 | ), |
66 | 66 | 'video' => array( |
67 | - 'name' => __('Video','lasso'), |
|
67 | + 'name' => __('Video', 'lasso'), |
|
68 | 68 | 'content' => lasso_video_component(), |
69 | 69 | ), |
70 | 70 | 'wpimg' => array( |
71 | - 'name' => __('WordPress Image','lasso'), |
|
71 | + 'name' => __('WordPress Image', 'lasso'), |
|
72 | 72 | 'content' => lasso_wp_image(), |
73 | 73 | ), |
74 | 74 | 'wpquote' => array( |
75 | - 'name' => __('WordPress Quote','lasso'), |
|
75 | + 'name' => __('WordPress Quote', 'lasso'), |
|
76 | 76 | 'content' => lasso_wp_quote(), |
77 | 77 | ), |
78 | 78 | 'gallery_pop' => array( |
79 | - 'name' => __('Gallery Pop','lasso'), |
|
79 | + 'name' => __('Gallery Pop', 'lasso'), |
|
80 | 80 | 'content' => lasso_gallery_pop_component(), |
81 | 81 | ), |
82 | 82 | 'events' => array( |
83 | - 'name' => __('Events','lasso'), |
|
83 | + 'name' => __('Events', 'lasso'), |
|
84 | 84 | 'content' => lasso_event_component(), |
85 | 85 | ), |
86 | 86 | 'wpvideo' => array( |
87 | - 'name' => __('WordPress Image','lasso'), |
|
87 | + 'name' => __('WordPress Image', 'lasso'), |
|
88 | 88 | 'content' => lasso_wp_video(), |
89 | 89 | ), |
90 | 90 | ); |
91 | 91 | |
92 | - return apply_filters( 'lasso_components', $array ); |
|
92 | + return apply_filters('lasso_components', $array); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -115,132 +115,132 @@ discard block |
||
115 | 115 | */ |
116 | 116 | |
117 | 117 | // 1 |
118 | -if ( !function_exists( 'lasso_quote_component' ) ): |
|
118 | +if (!function_exists('lasso_quote_component')): |
|
119 | 119 | function lasso_quote_component() { |
120 | 120 | |
121 | - return do_shortcode( '[aesop_quote quote="The Universe is made of stories, not of atoms."]' ); |
|
121 | + return do_shortcode('[aesop_quote quote="The Universe is made of stories, not of atoms."]'); |
|
122 | 122 | } |
123 | 123 | endif; |
124 | 124 | |
125 | 125 | // 2 |
126 | -if ( !function_exists( 'lasso_image_component' ) ): |
|
126 | +if (!function_exists('lasso_image_component')): |
|
127 | 127 | function lasso_image_component() { |
128 | 128 | |
129 | - return do_shortcode( '[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]' ); |
|
129 | + return do_shortcode('[aesop_image img="'.LASSO_URL.'/public/assets/img/empty-img.png" align="center" imgwidth="800px"]'); |
|
130 | 130 | } |
131 | 131 | endif; |
132 | 132 | |
133 | 133 | // 3 |
134 | -if ( !function_exists( 'lasso_parallax_component' ) ): |
|
134 | +if (!function_exists('lasso_parallax_component')): |
|
135 | 135 | function lasso_parallax_component() { |
136 | 136 | |
137 | - return do_shortcode( '[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]' ); |
|
137 | + return do_shortcode('[aesop_parallax img="'.LASSO_URL.'/public/assets/img/empty-img.png"]'); |
|
138 | 138 | } |
139 | 139 | endif; |
140 | 140 | |
141 | 141 | // 4 |
142 | -if ( !function_exists( 'lasso_audio_component' ) ): |
|
142 | +if (!function_exists('lasso_audio_component')): |
|
143 | 143 | function lasso_audio_component() { |
144 | 144 | |
145 | - return do_shortcode( '[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]' ); |
|
145 | + return do_shortcode('[aesop_audio src="http://users.skynet.be/fa046054/home/P22/track06.mp3"]'); |
|
146 | 146 | |
147 | 147 | } |
148 | 148 | endif; |
149 | 149 | |
150 | 150 | // 5 |
151 | -if ( !function_exists( 'lasso_content_component' ) ): |
|
151 | +if (!function_exists('lasso_content_component')): |
|
152 | 152 | function lasso_content_component() { |
153 | 153 | |
154 | - return do_shortcode( '[aesop_content]Start typing here...[/aesop_content]' ); |
|
154 | + return do_shortcode('[aesop_content]Start typing here...[/aesop_content]'); |
|
155 | 155 | } |
156 | 156 | endif; |
157 | 157 | |
158 | 158 | // 6 |
159 | -if ( !function_exists( 'lasso_character_component' ) ): |
|
159 | +if (!function_exists('lasso_character_component')): |
|
160 | 160 | function lasso_character_component() { |
161 | 161 | |
162 | - return do_shortcode( '[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]' ); |
|
162 | + return do_shortcode('[aesop_character img="'.LASSO_URL.'/public/assets/img/empty-img.png" name="Joes Apartment" width="150px"]'); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | endif; |
166 | 166 | |
167 | 167 | // 7 |
168 | -if ( !function_exists( 'lasso_collections_component' ) ): |
|
168 | +if (!function_exists('lasso_collections_component')): |
|
169 | 169 | function lasso_collections_component() { |
170 | 170 | |
171 | - return do_shortcode( '[aesop_collection]' ); |
|
171 | + return do_shortcode('[aesop_collection]'); |
|
172 | 172 | } |
173 | 173 | endif; |
174 | 174 | |
175 | 175 | // 8 |
176 | -if ( !function_exists( 'lasso_document_component' ) ): |
|
176 | +if (!function_exists('lasso_document_component')): |
|
177 | 177 | function lasso_document_component() { |
178 | 178 | |
179 | - return do_shortcode( '[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]' ); |
|
179 | + return do_shortcode('[aesop_document src="'.LASSO_URL.'/public/assets/img/empty-img.png" ]'); |
|
180 | 180 | |
181 | 181 | } |
182 | 182 | endif; |
183 | 183 | |
184 | 184 | // 9 |
185 | -if ( !function_exists( 'lasso_gallery_component' ) ): |
|
185 | +if (!function_exists('lasso_gallery_component')): |
|
186 | 186 | function lasso_gallery_component() { |
187 | 187 | |
188 | - return do_shortcode( '[aesop_gallery]' ); |
|
188 | + return do_shortcode('[aesop_gallery]'); |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | endif; |
192 | 192 | |
193 | 193 | // 10 |
194 | -if ( !function_exists( 'lasso_heading_component' ) ): |
|
194 | +if (!function_exists('lasso_heading_component')): |
|
195 | 195 | function lasso_heading_component() { |
196 | 196 | |
197 | - return do_shortcode( '[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]' ); |
|
197 | + return do_shortcode('[aesop_chapter title="Chapter One" img="'.LASSO_URL.'/public/assets/img/empty-img.png" full="on"]'); |
|
198 | 198 | } |
199 | 199 | endif; |
200 | 200 | |
201 | 201 | // 11 |
202 | -if ( !function_exists( 'lasso_map_component' ) ): |
|
202 | +if (!function_exists('lasso_map_component')): |
|
203 | 203 | function lasso_map_component() { |
204 | 204 | |
205 | 205 | return '<form id="lasso--map-form" class="aesop-component aesop-map-component lasso--map-drag-holder" enctype="multipart/form-data"> |
206 | 206 | '.lasso_map_form_footer().' |
207 | - '.do_shortcode( '[aesop_map sticky="off"]' ).' |
|
207 | + '.do_shortcode('[aesop_map sticky="off"]').' |
|
208 | 208 | </form>'; |
209 | 209 | |
210 | 210 | } |
211 | 211 | endif; |
212 | 212 | |
213 | 213 | // 12 |
214 | -if ( !function_exists( 'lasso_timeline_component' ) ): |
|
214 | +if (!function_exists('lasso_timeline_component')): |
|
215 | 215 | function lasso_timeline_component() { |
216 | 216 | |
217 | - return do_shortcode( '[aesop_timeline_stop num="Title" title="2014"]' ); |
|
217 | + return do_shortcode('[aesop_timeline_stop num="Title" title="2014"]'); |
|
218 | 218 | |
219 | 219 | } |
220 | 220 | endif; |
221 | 221 | |
222 | 222 | // 13 |
223 | -if ( !function_exists( 'lasso_video_component' ) ): |
|
223 | +if (!function_exists('lasso_video_component')): |
|
224 | 224 | function lasso_video_component() { |
225 | 225 | |
226 | - return do_shortcode( '[aesop_video src="vimeo" id="59940289" width="100%" align="center"]' ); |
|
226 | + return do_shortcode('[aesop_video src="vimeo" id="59940289" width="100%" align="center"]'); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | endif; |
230 | 230 | |
231 | 231 | // 14 - since 0.9.1 |
232 | -if ( !function_exists('lasso_wp_image') ): |
|
232 | +if (!function_exists('lasso_wp_image')): |
|
233 | 233 | |
234 | - function lasso_wp_image(){ |
|
234 | + function lasso_wp_image() { |
|
235 | 235 | return '<div data-component-type="wpimg" class="lasso--wpimg__wrap lasso-component"><img class="wp-image-0" src="'.LASSO_URL.'/public/assets/img/empty-img.png"></div>'; |
236 | 236 | } |
237 | 237 | |
238 | 238 | endif; |
239 | 239 | |
240 | 240 | // 15 - since 0.9.2 |
241 | -if ( !function_exists('lasso_wp_quote') ): |
|
241 | +if (!function_exists('lasso_wp_quote')): |
|
242 | 242 | |
243 | - function lasso_wp_quote(){ |
|
243 | + function lasso_wp_quote() { |
|
244 | 244 | return '<blockquote data-component-type="wpquote" class="lasso--wpquote lasso-component"><p>The universe is made of stories.</p></blockquote>'; |
245 | 245 | } |
246 | 246 | |
@@ -248,15 +248,15 @@ discard block |
||
248 | 248 | |
249 | 249 | // 16 gallery pop added but not fully supported as of 0.9.9.11 |
250 | 250 | |
251 | -if ( !function_exists( 'lasso_gallery_pop_component' ) ): |
|
251 | +if (!function_exists('lasso_gallery_pop_component')): |
|
252 | 252 | function lasso_gallery_pop_component() { |
253 | - return do_shortcode( '[aesop_gallery_pop]' ); |
|
253 | + return do_shortcode('[aesop_gallery_pop]'); |
|
254 | 254 | } |
255 | 255 | endif; |
256 | 256 | |
257 | 257 | // 17 - work in progress |
258 | 258 | |
259 | -if ( !function_exists( 'lasso_event_component' ) ): |
|
259 | +if (!function_exists('lasso_event_component')): |
|
260 | 260 | function lasso_event_component() { |
261 | 261 | $id = editus_get_one_id('aesop_events'); |
262 | 262 | return '<div data-component-type="events" class="aesop-component lasso-component"><p>Aesop Event: After setting the event, save and reload the page.</p></div>'; |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | endif; |
265 | 265 | |
266 | 266 | // 18 - work in progress |
267 | -if ( !function_exists('lasso_wp_video') ): |
|
267 | +if (!function_exists('lasso_wp_video')): |
|
268 | 268 | |
269 | - function lasso_wp_video(){ |
|
269 | + function lasso_wp_video() { |
|
270 | 270 | return '<div data-component-type="wpvideo" class="lasso--wpvideo__wrap lasso-component"><video class="wp-video-0"></video>'; |
271 | 271 | } |
272 | 272 | |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | // helper function to retrieve one id for default option |
276 | 276 | function editus_get_one_id($type) |
277 | 277 | { |
278 | - $args = array( 'posts_per_page' => 1, 'post_type' => $type ); |
|
279 | - $posts = get_posts( $args ); |
|
280 | - if ( $posts ) { |
|
281 | - foreach ( $posts as $post ) { |
|
278 | + $args = array('posts_per_page' => 1, 'post_type' => $type); |
|
279 | + $posts = get_posts($args); |
|
280 | + if ($posts) { |
|
281 | + foreach ($posts as $post) { |
|
282 | 282 | return $post->ID; |
283 | 283 | } |
284 | 284 | } |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
63 | 63 | |
64 | 64 | // enable saving custom fields through REST API |
65 | 65 | self::enable_metasave('post'); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public static function get_instance() { |
91 | 91 | |
92 | 92 | // If the single instance hasn't been set, set it now. |
93 | - if ( null == self::$instance ) { |
|
93 | + if (null == self::$instance) { |
|
94 | 94 | self::$instance = new self; |
95 | 95 | } |
96 | 96 | |
@@ -107,18 +107,18 @@ discard block |
||
107 | 107 | * WPMU is disabled or plugin is |
108 | 108 | * activated on an individual blog. |
109 | 109 | */ |
110 | - public static function activate( $network_wide ) { |
|
110 | + public static function activate($network_wide) { |
|
111 | 111 | |
112 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
112 | + if (function_exists('is_multisite') && is_multisite()) { |
|
113 | 113 | |
114 | - if ( $network_wide ) { |
|
114 | + if ($network_wide) { |
|
115 | 115 | |
116 | 116 | // Get all blog ids |
117 | 117 | $blog_ids = self::get_blog_ids(); |
118 | 118 | |
119 | - foreach ( $blog_ids as $blog_id ) { |
|
119 | + foreach ($blog_ids as $blog_id) { |
|
120 | 120 | |
121 | - switch_to_blog( $blog_id ); |
|
121 | + switch_to_blog($blog_id); |
|
122 | 122 | self::single_activate(); |
123 | 123 | } |
124 | 124 | |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | * WPMU is disabled or plugin is |
145 | 145 | * deactivated on an individual blog. |
146 | 146 | */ |
147 | - public static function deactivate( $network_wide ) { |
|
147 | + public static function deactivate($network_wide) { |
|
148 | 148 | |
149 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
149 | + if (function_exists('is_multisite') && is_multisite()) { |
|
150 | 150 | |
151 | - if ( $network_wide ) { |
|
151 | + if ($network_wide) { |
|
152 | 152 | |
153 | 153 | // Get all blog ids |
154 | 154 | $blog_ids = self::get_blog_ids(); |
155 | 155 | |
156 | - foreach ( $blog_ids as $blog_id ) { |
|
156 | + foreach ($blog_ids as $blog_id) { |
|
157 | 157 | |
158 | - switch_to_blog( $blog_id ); |
|
158 | + switch_to_blog($blog_id); |
|
159 | 159 | self::single_deactivate(); |
160 | 160 | |
161 | 161 | } |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | * |
180 | 180 | * @param int $blog_id ID of the new blog. |
181 | 181 | */ |
182 | - public function activate_new_site( $blog_id ) { |
|
182 | + public function activate_new_site($blog_id) { |
|
183 | 183 | |
184 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
184 | + if (1 !== did_action('wpmu_new_blog')) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - switch_to_blog( $blog_id ); |
|
188 | + switch_to_blog($blog_id); |
|
189 | 189 | self::single_activate(); |
190 | 190 | restore_current_blog(); |
191 | 191 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | WHERE archived = '0' AND spam = '0' |
211 | 211 | AND deleted = '0'"; |
212 | 212 | |
213 | - return $wpdb->get_col( $sql ); |
|
213 | + return $wpdb->get_col($sql); |
|
214 | 214 | |
215 | 215 | } |
216 | 216 | |
@@ -221,18 +221,18 @@ discard block |
||
221 | 221 | */ |
222 | 222 | private static function single_activate() { |
223 | 223 | |
224 | - $curr_version = get_option( 'lasso_version' ); |
|
224 | + $curr_version = get_option('lasso_version'); |
|
225 | 225 | |
226 | 226 | // update upgraded from |
227 | - if ( $curr_version ) { |
|
228 | - update_option( 'lasso_updated_from', $curr_version ); |
|
227 | + if ($curr_version) { |
|
228 | + update_option('lasso_updated_from', $curr_version); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | // update lasso version option |
232 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
232 | + update_option('lasso_version', LASSO_VERSION); |
|
233 | 233 | |
234 | 234 | // set transietn for activation welcome |
235 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
235 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
236 | 236 | |
237 | 237 | |
238 | 238 | } |
@@ -254,15 +254,15 @@ discard block |
||
254 | 254 | public function load_plugin_textdomain() { |
255 | 255 | |
256 | 256 | $domain = $this->plugin_slug; |
257 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
257 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
258 | 258 | |
259 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
259 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | // new ajax function to lock post for editing |
263 | 263 | public function editus_lock_post() |
264 | 264 | { |
265 | - $post_id= $_POST["postid"]; |
|
265 | + $post_id = $_POST["postid"]; |
|
266 | 266 | $locked = wp_check_post_lock($post_id); |
267 | 267 | |
268 | 268 | if (!$locked) { |
@@ -270,18 +270,18 @@ discard block |
||
270 | 270 | echo "true"; |
271 | 271 | } else { |
272 | 272 | $user_info = get_userdata($locked); |
273 | - echo "Post opened by ".$user_info->first_name . " " . $user_info->last_name; |
|
273 | + echo "Post opened by ".$user_info->first_name." ".$user_info->last_name; |
|
274 | 274 | } |
275 | 275 | exit; |
276 | 276 | } |
277 | 277 | |
278 | 278 | public static function enable_metasave($type) |
279 | 279 | { |
280 | - register_rest_field( $type, 'metadata', array( |
|
281 | - 'get_callback' => function ( $data ) { |
|
282 | - return get_post_meta( $data['id']);//, '', '' ); |
|
280 | + register_rest_field($type, 'metadata', array( |
|
281 | + 'get_callback' => function($data) { |
|
282 | + return get_post_meta($data['id']); //, '', '' ); |
|
283 | 283 | }, |
284 | - 'update_callback' => function( $data, $post ) { |
|
284 | + 'update_callback' => function($data, $post) { |
|
285 | 285 | foreach ($data as $key => $value) { |
286 | 286 | update_post_meta($post->ID, $key, $value); |
287 | 287 | } |
@@ -293,10 +293,10 @@ discard block |
||
293 | 293 | public function editus_do_shortcode() |
294 | 294 | { |
295 | 295 | |
296 | - $code= $_POST["code"]; |
|
296 | + $code = $_POST["code"]; |
|
297 | 297 | $code = str_replace('\"', '"', $code); |
298 | - $out = lasso_wrap_shortcodes( $code); |
|
299 | - $out = do_shortcode($out); |
|
298 | + $out = lasso_wrap_shortcodes($code); |
|
299 | + $out = do_shortcode($out); |
|
300 | 300 | echo $out; |
301 | 301 | exit; |
302 | 302 | } |
@@ -305,53 +305,53 @@ discard block |
||
305 | 305 | { |
306 | 306 | |
307 | 307 | |
308 | - $code= $_POST["code"]; |
|
308 | + $code = $_POST["code"]; |
|
309 | 309 | $atts = array( |
310 | 310 | ); |
311 | 311 | foreach ($_POST as $key => $value) { |
312 | - if ($key !="code" && $key !="action") { |
|
312 | + if ($key != "code" && $key != "action") { |
|
313 | 313 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
314 | 314 | $atts[$key] = $value; |
315 | 315 | } |
316 | 316 | } |
317 | 317 | if ($code == "aesop_video") { |
318 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
318 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
319 | 319 | echo aesop_video_shortcode($atts); |
320 | 320 | } |
321 | 321 | else if ($code == "aesop_image") { |
322 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
322 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
323 | 323 | echo aesop_image_shortcode($atts); |
324 | 324 | } |
325 | 325 | else if ($code == "aesop_quote") { |
326 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
326 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
327 | 327 | echo aesop_quote_shortcode($atts); |
328 | 328 | } |
329 | 329 | else if ($code == "aesop_parallax") { |
330 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
330 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
331 | 331 | echo aesop_parallax_shortcode($atts); |
332 | 332 | } |
333 | 333 | else if ($code == "aesop_character") { |
334 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
334 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
335 | 335 | echo aesop_character_shortcode($atts); |
336 | 336 | } |
337 | 337 | else if ($code == "aesop_collection") { |
338 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
338 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
339 | 339 | echo aesop_collection_shortcode($atts); |
340 | 340 | } |
341 | 341 | else if ($code == "aesop_chapter") { |
342 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
342 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
343 | 343 | echo aesop_chapter_shortcode($atts); |
344 | 344 | } |
345 | 345 | else if ($code == "aesop_content") { |
346 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
346 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
347 | 347 | echo aesop_content_shortcode($atts, $atts['content_data']); |
348 | 348 | } |
349 | 349 | else if ($code == "aesop_gallery") { |
350 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
351 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
350 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
351 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
352 | 352 | } |
353 | 353 | else if ($code == "aesop_audio") { |
354 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
354 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
355 | 355 | echo aesop_audio_shortcode($atts); |
356 | 356 | } |
357 | 357 | else { |
@@ -12,32 +12,32 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
15 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
16 | 16 | function lasso_editor_controls() { |
17 | 17 | |
18 | 18 | global $post; |
19 | 19 | |
20 | - if ( lasso_user_can('edit_posts') ) { |
|
20 | + if (lasso_user_can('edit_posts')) { |
|
21 | 21 | |
22 | - $status = get_post_status( get_the_ID() ); |
|
22 | + $status = get_post_status(get_the_ID()); |
|
23 | 23 | |
24 | 24 | // let users add custom css classes |
25 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
25 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
26 | 26 | |
27 | 27 | $post_access_class = ''; |
28 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
29 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
30 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
28 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
29 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
30 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | // CSS class if adding new post objects is disabled |
34 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
34 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
35 | 35 | |
36 | 36 | // CSS class if adjust settings is disabled |
37 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
37 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
38 | 38 | |
39 | 39 | // CSS class if adding new post objects AND settings are disabled |
40 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
40 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
43 | 43 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -49,44 +49,44 @@ discard block |
||
49 | 49 | $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
50 | 50 | |
51 | 51 | |
52 | - ?><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();?>" > |
|
52 | + ?><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(); ?>" > |
|
53 | 53 | |
54 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
54 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
55 | 55 | |
56 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
56 | + <?php do_action('lasso_editor_controls_before'); |
|
57 | 57 | |
58 | - if ( $is_capable ) { ?> |
|
58 | + if ($is_capable) { ?> |
|
59 | 59 | |
60 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
60 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
61 | 61 | |
62 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
63 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
62 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
63 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
64 | 64 | <?php } |
65 | 65 | |
66 | 66 | } ?> |
67 | 67 | |
68 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
68 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
69 | 69 | |
70 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
71 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
70 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
71 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
72 | 72 | <?php } ?> |
73 | 73 | |
74 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('publish_posts') ) ) { ?> |
|
75 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
74 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('publish_posts'))) { ?> |
|
75 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
76 | 76 | <?php } ?> |
77 | 77 | |
78 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
78 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
79 | 79 | |
80 | 80 | </ul> |
81 | 81 | |
82 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
82 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
83 | 83 | |
84 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
84 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
85 | 85 | |
86 | - <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> |
|
86 | + <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> |
|
87 | 87 | |
88 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
89 | - <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> |
|
88 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
89 | + <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> |
|
90 | 90 | <?php } ?> |
91 | 91 | |
92 | 92 | </div> |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | |
110 | 110 | ob_start(); |
111 | 111 | |
112 | - if ( !lasso_user_can() ) |
|
112 | + if (!lasso_user_can()) |
|
113 | 113 | return; |
114 | 114 | |
115 | 115 | // let users add custom css classes |
116 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
116 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
117 | 117 | ?> |
118 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
118 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
119 | 119 | <div class="lasso--sidebar__inner"> |
120 | 120 | <div id="lasso--component__settings"></div> |
121 | 121 | </div> |
@@ -133,26 +133,26 @@ discard block |
||
133 | 133 | |
134 | 134 | ob_start(); |
135 | 135 | |
136 | - if ( !lasso_user_can() ) |
|
136 | + if (!lasso_user_can()) |
|
137 | 137 | return; |
138 | 138 | |
139 | 139 | $is_mobile = wp_is_mobile(); |
140 | 140 | |
141 | 141 | // check for lasso story engine and add a class doniting this |
142 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
142 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
143 | 143 | |
144 | 144 | // let users add custom css classes |
145 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
145 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
146 | 146 | |
147 | 147 | // are toolbar headings enabled |
148 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
149 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
148 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
149 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
150 | 150 | |
151 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
151 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
152 | 152 | |
153 | 153 | // mobile styles |
154 | 154 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
155 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
155 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
156 | 156 | |
157 | 157 | //show color |
158 | 158 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -160,102 +160,102 @@ discard block |
||
160 | 160 | //show alignment |
161 | 161 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
162 | 162 | |
163 | - $status = get_post_status( get_the_ID() ); |
|
163 | + $status = get_post_status(get_the_ID()); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | ?> |
167 | - <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 ?>> |
|
168 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
169 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
170 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
171 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
172 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
173 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
174 | - <?php if ( $toolbar_headings ): ?> |
|
175 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
176 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
167 | + <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 ?>> |
|
168 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
169 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
170 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
171 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
172 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
173 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
174 | + <?php if ($toolbar_headings): ?> |
|
175 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
176 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
177 | 177 | <?php endif; ?> |
178 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
179 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
180 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
181 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
178 | + <?php if ($toolbar_headings_h4): ?> |
|
179 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
180 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
181 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
182 | 182 | <?php endif; ?> |
183 | 183 | |
184 | - <?php if ( $show_color ): ?> |
|
185 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li> |
|
186 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
184 | + <?php if ($show_color): ?> |
|
185 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li> |
|
186 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
187 | 187 | <?php endif; ?> |
188 | 188 | |
189 | - <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>"> |
|
189 | + <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>"> |
|
190 | 190 | <ul id="lasso-toolbar--components__list" style="display:none;"> |
191 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
192 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
193 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
194 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
195 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
196 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
197 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
198 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
199 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
200 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
201 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
202 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
203 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
204 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
205 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
206 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
191 | + <?php if ('ase-active' == $ase_status): ?> |
|
192 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
193 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
194 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
195 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
196 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
197 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
198 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
199 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
200 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
201 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
202 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
203 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
204 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
205 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
206 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
207 | 207 | <?php }?> |
208 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
209 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
208 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
209 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
210 | 210 | <?php }?> |
211 | 211 | <?php else: ?> |
212 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
213 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
214 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
212 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
213 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
214 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
215 | 215 | <?php endif; ?> |
216 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
216 | + <?php do_action('lasso_toolbar_components'); ?> |
|
217 | 217 | </ul> |
218 | 218 | </li> |
219 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
219 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
220 | 220 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
221 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
222 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
221 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
222 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
223 | 223 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
224 | 224 | <label for="aesop-toolbar--link_newtab">Open in Another Tab</label> |
225 | 225 | </div> |
226 | 226 | </li> |
227 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
228 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>"> |
|
227 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
228 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>"> |
|
229 | 229 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
230 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
230 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
231 | 231 | <div id="lasso-toolbar--html__footer"> |
232 | 232 | <ul class="lasso-toolbar--html-snips"> |
233 | - <?php if ( !$toolbar_headings ): ?> |
|
234 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
235 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
233 | + <?php if (!$toolbar_headings): ?> |
|
234 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
235 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
236 | 236 | <?php endif; ?> |
237 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
238 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
237 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
238 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
239 | 239 | </ul> |
240 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
241 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
240 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
241 | + <a href="#" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
242 | 242 | </div> |
243 | 243 | </div> |
244 | 244 | </li> |
245 | - <?php if ( $show_align ): ?> |
|
246 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
247 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
248 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
245 | + <?php if ($show_align): ?> |
|
246 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
247 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
248 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
249 | 249 | <?php endif; ?> |
250 | 250 | </ul> |
251 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
251 | + <?php if (is_singular() && $is_mobile) { ?> |
|
252 | 252 | |
253 | - <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;"> |
|
253 | + <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;"> |
|
254 | 254 | |
255 | - <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> |
|
255 | + <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> |
|
256 | 256 | |
257 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
258 | - <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> |
|
257 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
258 | + <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> |
|
259 | 259 | <?php } ?> |
260 | 260 | |
261 | 261 | </div> |
@@ -273,22 +273,22 @@ discard block |
||
273 | 273 | */ |
274 | 274 | function lasso_editor_settings_toolbar() { |
275 | 275 | |
276 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
276 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
277 | 277 | |
278 | 278 | ob_start(); |
279 | 279 | |
280 | - if ( !lasso_user_can() ) |
|
280 | + if (!lasso_user_can()) |
|
281 | 281 | return; |
282 | 282 | |
283 | 283 | // let users add custom css classes |
284 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
284 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
285 | 285 | |
286 | 286 | ?> |
287 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
288 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
289 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
290 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
291 | - <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> |
|
287 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
288 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
289 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
290 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
291 | + <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> |
|
292 | 292 | </ul> |
293 | 293 | |
294 | 294 | <?php return ob_get_clean(); |
@@ -304,17 +304,17 @@ discard block |
||
304 | 304 | |
305 | 305 | ob_start(); |
306 | 306 | |
307 | - if ( !lasso_user_can() ) |
|
307 | + if (!lasso_user_can()) |
|
308 | 308 | return; |
309 | 309 | |
310 | 310 | // has post thumbnail |
311 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
311 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
312 | 312 | |
313 | 313 | ?> |
314 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
315 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
316 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
317 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
314 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
315 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
316 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
317 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
318 | 318 | </ul> |
319 | 319 | |
320 | 320 | <?php return ob_get_clean(); |
@@ -333,55 +333,55 @@ discard block |
||
333 | 333 | |
334 | 334 | ob_start(); |
335 | 335 | |
336 | - if ( !lasso_user_can() ) |
|
336 | + if (!lasso_user_can()) |
|
337 | 337 | return; |
338 | 338 | |
339 | 339 | global $post; |
340 | 340 | |
341 | 341 | $postid = get_the_ID(); |
342 | 342 | |
343 | - $status = get_post_status( $postid ); |
|
344 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
343 | + $status = get_post_status($postid); |
|
344 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
345 | 345 | |
346 | 346 | // let users add custom css classes |
347 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
347 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
348 | 348 | |
349 | 349 | // objects categories |
350 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
351 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
350 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
351 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
352 | 352 | |
353 | 353 | // modal tabs |
354 | - $tabs = lasso_modal_addons('tab'); |
|
355 | - $content = lasso_modal_addons('content'); |
|
354 | + $tabs = lasso_modal_addons('tab'); |
|
355 | + $content = lasso_modal_addons('content'); |
|
356 | 356 | |
357 | 357 | // are we singular |
358 | - $is_singular = is_singular(); |
|
358 | + $is_singular = is_singular(); |
|
359 | 359 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
360 | 360 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
361 | 361 | $theme_supports = current_theme_supports('post-thumbnails'); |
362 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
362 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
363 | 363 | |
364 | 364 | ?> |
365 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
365 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
366 | 366 | <div class="lasso--modal__inner"> |
367 | 367 | |
368 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
368 | + <?php if ($tabs) { echo $tabs; } ?> |
|
369 | 369 | |
370 | 370 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
371 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
371 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
372 | 372 | |
373 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
373 | + <?php if ($is_singular && $theme_supports) : ?> |
|
374 | 374 | <div class="lasso--postsettings__left"> |
375 | - <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> |
|
376 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
375 | + <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> |
|
376 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
377 | 377 | |
378 | 378 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
379 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
380 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
379 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
380 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
381 | 381 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
382 | 382 | </div> |
383 | 383 | |
384 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
384 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
385 | 385 | |
386 | 386 | </div> |
387 | 387 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -391,12 +391,12 @@ discard block |
||
391 | 391 | |
392 | 392 | <div class="lasso--postsettings__right"> |
393 | 393 | |
394 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
394 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
395 | 395 | <div class="lasso--postsettings__option story-status-option"> |
396 | - <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> |
|
397 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
398 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
399 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
396 | + <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> |
|
397 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
398 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
399 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
400 | 400 | </ul> |
401 | 401 | <div class="lasso--slider_wrap"> |
402 | 402 | <div id="lasso--slider"></div> |
@@ -404,10 +404,10 @@ discard block |
||
404 | 404 | </div> |
405 | 405 | <?php endif; ?> |
406 | 406 | |
407 | - <?php if ( 'publish' == $status ): ?> |
|
407 | + <?php if ('publish' == $status): ?> |
|
408 | 408 | <div class="lasso--postsettings__option story-slug-option"> |
409 | - <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> |
|
410 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
409 | + <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> |
|
410 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
411 | 411 | </div> |
412 | 412 | <?php endif; ?> |
413 | 413 | |
@@ -416,13 +416,13 @@ discard block |
||
416 | 416 | <div class="lasso--postsettings__middle"> |
417 | 417 | |
418 | 418 | <div class="lasso--postsettings__option story-categories-option"> |
419 | - <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> |
|
420 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
419 | + <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> |
|
420 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
421 | 421 | </div> |
422 | 422 | |
423 | 423 | <div class="lasso--postsettings__option story-tags-option"> |
424 | - <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> |
|
425 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
424 | + <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> |
|
425 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
426 | 426 | </div> |
427 | 427 | |
428 | 428 | </div> |
@@ -443,23 +443,23 @@ discard block |
||
443 | 443 | ?> |
444 | 444 | <!--/div--> |
445 | 445 | |
446 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
446 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
447 | 447 | |
448 | 448 | <div class="lasso--postsettings__footer" > |
449 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
449 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
450 | 450 | <input type="hidden" name="status" value=""> |
451 | 451 | <input type="hidden" name="categories" value=""> |
452 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
452 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
453 | 453 | <input type="hidden" name="action" value="process_update-object_post"> |
454 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
455 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
456 | - <input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
454 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
455 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
456 | + <input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
457 | 457 | </div> |
458 | 458 | |
459 | 459 | </form> |
460 | 460 | </div> |
461 | 461 | |
462 | - <?php if( $tabs ) { echo $content; } ?> |
|
462 | + <?php if ($tabs) { echo $content; } ?> |
|
463 | 463 | |
464 | 464 | </div> |
465 | 465 | |
@@ -480,45 +480,45 @@ discard block |
||
480 | 480 | |
481 | 481 | ob_start(); |
482 | 482 | |
483 | - if ( !lasso_user_can('edit_posts') ) |
|
483 | + if (!lasso_user_can('edit_posts')) |
|
484 | 484 | return; |
485 | 485 | |
486 | - $status = get_post_status( get_the_ID() ); |
|
486 | + $status = get_post_status(get_the_ID()); |
|
487 | 487 | |
488 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
488 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
489 | 489 | |
490 | 490 | // let users add custom css classes |
491 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
491 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
492 | 492 | |
493 | 493 | // return the post type |
494 | - $type = get_post_type( get_the_ID() ); |
|
494 | + $type = get_post_type(get_the_ID()); |
|
495 | 495 | |
496 | 496 | $mobile_style = ""; |
497 | 497 | if (wp_is_mobile()) { |
498 | 498 | $mobile_style = 'style="top:140px !important;"'; |
499 | 499 | } |
500 | 500 | ?> |
501 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
501 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
502 | 502 | <div class="lasso--modal__inner lasso--hasnewform"> |
503 | 503 | |
504 | 504 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
505 | 505 | |
506 | 506 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
507 | - <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> |
|
508 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>"> |
|
507 | + <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> |
|
508 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>"> |
|
509 | 509 | <div class="lasso--select-wrap" style="width:90px"> |
510 | 510 | <select id="lasso--select-type" name="story_type"> |
511 | 511 | |
512 | 512 | <?php |
513 | 513 | $types = lasso_post_types(); |
514 | 514 | |
515 | - if ( !empty( $types ) ) { |
|
515 | + if (!empty($types)) { |
|
516 | 516 | |
517 | - foreach( $types as $type ) { |
|
517 | + foreach ($types as $type) { |
|
518 | 518 | |
519 | - $type = preg_replace( '/s\b/','', $type ); |
|
519 | + $type = preg_replace('/s\b/', '', $type); |
|
520 | 520 | |
521 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) ); |
|
521 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type))); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | } |
@@ -528,12 +528,12 @@ discard block |
||
528 | 528 | </div> |
529 | 529 | </div> |
530 | 530 | |
531 | - <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>"> |
|
532 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
531 | + <div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>"> |
|
532 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
533 | 533 | <input type="hidden" name="action" value="process_new-object_post"> |
534 | 534 | <input type="hidden" name="object" value="post"> |
535 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
536 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
535 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
536 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
537 | 537 | </div> |
538 | 538 | |
539 | 539 | </form> |
@@ -561,18 +561,18 @@ discard block |
||
561 | 561 | ob_start(); |
562 | 562 | |
563 | 563 | // post status |
564 | - $status = get_post_status( get_the_ID() ); |
|
564 | + $status = get_post_status(get_the_ID()); |
|
565 | 565 | |
566 | 566 | // let users add custom css classes |
567 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
567 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
568 | 568 | |
569 | 569 | ?> |
570 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
570 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
571 | 571 | <div class="lasso--modal__inner"> |
572 | 572 | |
573 | 573 | <div class="lasso--post-filtering not-visible"> |
574 | 574 | <div class="lasso--search__results"> |
575 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
575 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
576 | 576 | </div> |
577 | 577 | <div class="lasso--search"> |
578 | 578 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -586,18 +586,18 @@ discard block |
||
586 | 586 | $post_types = lasso_post_types_names(); |
587 | 587 | $rest_bases = lasso_post_types_rest_base(); |
588 | 588 | |
589 | - if ( ! empty( $post_types ) ) { |
|
589 | + if (!empty($post_types)) { |
|
590 | 590 | $first = 'active'; |
591 | - foreach( $post_types as $name => $label ) { |
|
591 | + foreach ($post_types as $name => $label) { |
|
592 | 592 | if (array_key_exists($name, $rest_bases)) { |
593 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
593 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
594 | 594 | } |
595 | 595 | $first = ''; |
596 | 596 | } |
597 | 597 | |
598 | 598 | } |
599 | 599 | |
600 | - do_action('lasso_modal_post_objects');?> |
|
600 | + do_action('lasso_modal_post_objects'); ?> |
|
601 | 601 | |
602 | 602 | </ul> |
603 | 603 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -615,18 +615,18 @@ discard block |
||
615 | 615 | |
616 | 616 | ob_start(); |
617 | 617 | |
618 | - if ( !lasso_user_can() ) |
|
618 | + if (!lasso_user_can()) |
|
619 | 619 | return; |
620 | 620 | |
621 | 621 | // let users add custom css classes |
622 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
622 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
623 | 623 | |
624 | 624 | ?> |
625 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
626 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
627 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
628 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
629 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
625 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
626 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
627 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
628 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
629 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
630 | 630 | </ul> |
631 | 631 | |
632 | 632 | <?php return ob_get_clean(); |
@@ -636,18 +636,18 @@ discard block |
||
636 | 636 | |
637 | 637 | ob_start(); |
638 | 638 | |
639 | - if ( !lasso_user_can() ) |
|
639 | + if (!lasso_user_can()) |
|
640 | 640 | return; |
641 | 641 | |
642 | 642 | // let users add custom css classes |
643 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
643 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
644 | 644 | |
645 | 645 | ?> |
646 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
647 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
648 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
649 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
650 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
646 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
647 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
648 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
649 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
650 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
651 | 651 | </ul> |
652 | 652 | |
653 | 653 | <?php return ob_get_clean(); |
@@ -660,16 +660,16 @@ discard block |
||
660 | 660 | */ |
661 | 661 | function lasso_map_form_footer() { |
662 | 662 | |
663 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
663 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
664 | 664 | |
665 | 665 | ob_start(); |
666 | 666 | |
667 | 667 | ?> |
668 | 668 | <div class="lasso--map-form__footer"> |
669 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
670 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
669 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
670 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
671 | 671 | <input type="hidden" name="action" value="process_map_save"> |
672 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
672 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
673 | 673 | </div> |
674 | 674 | |
675 | 675 | <?php return ob_get_clean(); |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | |
688 | 688 | ?> |
689 | 689 | <div id="lasso--pagerefresh" class="visible"> |
690 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
690 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
691 | 691 | </div> |
692 | 692 | |
693 | 693 | <?php return ob_get_clean(); |
@@ -701,43 +701,43 @@ discard block |
||
701 | 701 | */ |
702 | 702 | function lasso_editor_options_blob() { |
703 | 703 | |
704 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
705 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
704 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
705 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
706 | 706 | |
707 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
707 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
708 | 708 | |
709 | 709 | $blob = array(); |
710 | 710 | |
711 | - if ( empty( $codes ) ) |
|
711 | + if (empty($codes)) |
|
712 | 712 | return; |
713 | 713 | |
714 | - foreach ( $codes as $slug => $shortcode ) { |
|
714 | + foreach ($codes as $slug => $shortcode) { |
|
715 | 715 | $return = ''; |
716 | 716 | // Shortcode has atts |
717 | 717 | |
718 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
718 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
719 | 719 | |
720 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
720 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
721 | 721 | |
722 | 722 | |
723 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
723 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
724 | 724 | |
725 | 725 | $return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
726 | 726 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">'; |
727 | - $return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
727 | + $return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
728 | 728 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
729 | 729 | // Select |
730 | 730 | |
731 | - if ( isset( $attr_info['values'] ) ) { |
|
731 | + if (isset($attr_info['values'])) { |
|
732 | 732 | |
733 | - $return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
733 | + $return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
734 | 734 | |
735 | - $i=0; |
|
735 | + $i = 0; |
|
736 | 736 | |
737 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
737 | + foreach ($attr_info['values'] as $attr_value) { |
|
738 | 738 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
739 | 739 | |
740 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
740 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
741 | 741 | |
742 | 742 | $i++; |
743 | 743 | } |
@@ -746,24 +746,24 @@ discard block |
||
746 | 746 | |
747 | 747 | } else { |
748 | 748 | |
749 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
749 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
750 | 750 | |
751 | 751 | // image upload |
752 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
752 | + if ('media_upload' == $attr_info['type']) { |
|
753 | 753 | |
754 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
754 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
755 | 755 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
756 | 756 | |
757 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
757 | + } elseif ('color' == $attr_info['type']) { |
|
758 | 758 | |
759 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
759 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'; |
|
760 | 760 | |
761 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
761 | + } elseif ('text_area' == $attr_info['type']) { |
|
762 | 762 | |
763 | - $return .= '<textarea name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
763 | + $return .= '<textarea name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
764 | 764 | |
765 | 765 | } else { |
766 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
766 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr lasso-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
767 | 767 | } |
768 | 768 | } |
769 | 769 | $return .= '</p>'; |
@@ -774,9 +774,9 @@ discard block |
||
774 | 774 | /////////////////////////// |
775 | 775 | // START GALLERY AND MAP FRONT END STUFFS |
776 | 776 | /////////////////////////// |
777 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
777 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
778 | 778 | |
779 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
779 | + if ('gallery' == $shortcode['front_type']) { |
|
780 | 780 | |
781 | 781 | $return .= lasso_gallery_editor_module(); |
782 | 782 | |
@@ -787,13 +787,13 @@ discard block |
||
787 | 787 | /////////////////////////// |
788 | 788 | |
789 | 789 | // Single shortcode (not closed) |
790 | - if ( 'single' == $shortcode['type'] ) { |
|
790 | + if ('single' == $shortcode['type']) { |
|
791 | 791 | |
792 | 792 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
793 | 793 | |
794 | 794 | } else { |
795 | 795 | |
796 | - $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>'; |
|
796 | + $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>'; |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
827 | 827 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
828 | 828 | <i class="lasso-icon lasso-icon-move"></i> |
829 | - <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> |
|
829 | + <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> |
|
830 | 830 | <div class="lasso--slider_wrap"> |
831 | 831 | <div id="lasso--slider"></div> |
832 | 832 | </div> |
@@ -10,30 +10,30 @@ discard block |
||
10 | 10 | |
11 | 11 | function __construct() { |
12 | 12 | |
13 | - add_action( 'admin_init', array( $this, 'redirect' ) ); |
|
14 | - add_action( 'admin_menu', array( $this, 'lasso_welcome' ) ); |
|
15 | - add_action( 'network_admin_menu', array( $this, 'lasso_welcome' ) ); // CHANGED Added hook. |
|
13 | + add_action('admin_init', array($this, 'redirect')); |
|
14 | + add_action('admin_menu', array($this, 'lasso_welcome')); |
|
15 | + add_action('network_admin_menu', array($this, 'lasso_welcome')); // CHANGED Added hook. |
|
16 | 16 | |
17 | - add_action( 'tgmpa_register', array( $this,'required_plugins' )); |
|
17 | + add_action('tgmpa_register', array($this, 'required_plugins')); |
|
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | 21 | function redirect() { |
22 | 22 | |
23 | 23 | // Bail if no activation redirect |
24 | - if ( !get_transient( '_lasso_welcome_redirect' ) ) { |
|
24 | + if (!get_transient('_lasso_welcome_redirect')) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Delete the redirect transient |
29 | - delete_transient( '_lasso_welcome_redirect' ); |
|
29 | + delete_transient('_lasso_welcome_redirect'); |
|
30 | 30 | |
31 | 31 | // Bail if activating from network, or bulk |
32 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
32 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) ); |
|
36 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php')))); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | function lasso_welcome() { |
46 | 46 | |
47 | 47 | // CHANGED Removed condition. |
48 | - add_menu_page( __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png' ); |
|
49 | - add_submenu_page( 'lasso-editor', __( 'Welcome', 'lasso' ), __( 'Status', 'lasso' ), 'manage_options', 'lasso-editor', array( $this, 'welcome' ) ); |
|
48 | + add_menu_page(__('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png'); |
|
49 | + add_submenu_page('lasso-editor', __('Welcome', 'lasso'), __('Status', 'lasso'), 'manage_options', 'lasso-editor', array($this, 'welcome')); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | ?> |
61 | 61 | <div class="wrap lasso--welcome"> |
62 | 62 | |
63 | - <?php self::header();?> |
|
63 | + <?php self::header(); ?> |
|
64 | 64 | |
65 | 65 | <ul class="lasso--welcome__steps"> |
66 | 66 | |
67 | 67 | <?php // CHANGED Added the is_network_admin condition. ?> |
68 | - <?php if ( is_network_admin() ) : ?> |
|
68 | + <?php if (is_network_admin()) : ?> |
|
69 | 69 | |
70 | 70 | <li> |
71 | - <p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p> |
|
71 | + <p><?php _e('We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso'); ?></p> |
|
72 | 72 | </li> |
73 | 73 | |
74 | 74 | <?php else : |
75 | 75 | |
76 | 76 | $checks = self::lasso_preflight_check(); |
77 | 77 | |
78 | - if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
|
78 | + if ($checks && !defined('LASSO_AGENCY_MODE')): |
|
79 | 79 | |
80 | - foreach ( (array) $checks as $key => $check ) { |
|
80 | + foreach ((array) $checks as $key => $check) { |
|
81 | 81 | |
82 | 82 | echo $check; |
83 | 83 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | // pre-flight is go for flight |
88 | 88 | ?> |
89 | 89 | <li class="success"> |
90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
91 | - <?php if ( lasso_get_supported_theme_class() ) { ?> |
|
92 | - <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
|
90 | + <h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3> |
|
91 | + <?php if (lasso_get_supported_theme_class()) { ?> |
|
92 | + <p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p> |
|
93 | 93 | <?php } ?> |
94 | - <p><?php _e( 'Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso' );?></p> |
|
94 | + <p><?php _e('Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso'); ?></p> |
|
95 | 95 | </li> |
96 | 96 | <?php |
97 | 97 | endif; |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | |
114 | 114 | <div class="lasso--welcome__top"> |
115 | 115 | |
116 | - <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>"> |
|
117 | - <h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1> |
|
118 | - <p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p> |
|
116 | + <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>"> |
|
117 | + <h1><?php _e('Welcome to Editus', 'lasso'); ?></h1> |
|
118 | + <p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p> |
|
119 | 119 | |
120 | - <?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?> |
|
120 | + <?php if (!defined('LASSO_AGENCY_MODE')): ?> |
|
121 | 121 | |
122 | 122 | <ul class="lasso--welcome__social"> |
123 | - <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li> |
|
124 | - <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li> |
|
125 | - <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li> |
|
123 | + <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li> |
|
124 | + <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li> |
|
125 | + <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li> |
|
126 | 126 | </ul> |
127 | 127 | |
128 | 128 | <?php endif; ?> |
@@ -139,61 +139,61 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function lasso_preflight_check() { |
141 | 141 | |
142 | - $notices = array(); |
|
142 | + $notices = array(); |
|
143 | 143 | |
144 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
144 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
145 | 145 | |
146 | - $theme_name = wp_get_theme()->get('Name'); |
|
147 | - $theme_class = lasso_get_supported_theme_class(); |
|
146 | + $theme_name = wp_get_theme()->get('Name'); |
|
147 | + $theme_class = lasso_get_supported_theme_class(); |
|
148 | 148 | |
149 | - $license = get_option( 'lasso_license_key' ); |
|
150 | - $status = get_option( 'lasso_license_status' ); |
|
149 | + $license = get_option('lasso_license_key'); |
|
150 | + $status = get_option('lasso_license_status'); |
|
151 | 151 | |
152 | 152 | // if the required CSS class has not been saved and we're not a supported theme |
153 | - if ( empty( $article_object ) && false == $theme_class ) { |
|
153 | + if (empty($article_object) && false == $theme_class) { |
|
154 | 154 | |
155 | 155 | // we dont automatically support this theme so show them otherwise |
156 | 156 | $notices[] = sprintf('<li class="error"> |
157 | - <h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3> |
|
158 | - <p>'.__( 'Before using Editus,', 'lasso' ).' <a href="%s">'.__( 'enter and save', 'lasso' ).'</a> '.__( 'the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso' ).' <a href="mailto:[email protected]">'.__( 'email us.', 'lasso' ).'</a> '.__( 'with a link to a public URL with the theme and we\'ll find it for you.', 'lasso' ).'</p> |
|
159 | - </li>', admin_url( 'admin.php?page=lasso-editor-settings' ) ); |
|
157 | + <h3>'.__('Article CSS Class Needed!', 'lasso').'</h3> |
|
158 | + <p>'.__('Before using Editus,', 'lasso').' <a href="%s">'.__('enter and save', 'lasso').'</a> '.__('the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso').' <a href="mailto:[email protected]">'.__('email us.', 'lasso').'</a> '.__('with a link to a public URL with the theme and we\'ll find it for you.', 'lasso').'</p> |
|
159 | + </li>', admin_url('admin.php?page=lasso-editor-settings')); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | // WP REST API not active |
163 | - if ( !function_exists( 'json_get_url_prefix' ) && !function_exists( 'rest_url' )) { |
|
163 | + if (!function_exists('json_get_url_prefix') && !function_exists('rest_url')) { |
|
164 | 164 | $notices[] = '<li class="info"><h3>WP REST API not Activated!</h3> |
165 | - <p>'.__( 'Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso' ).'</p> |
|
165 | + <p>'.__('Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso').'</p> |
|
166 | 166 | </li>'; |
167 | 167 | } |
168 | 168 | |
169 | 169 | // aesop story engine isnt active |
170 | - if ( !class_exists( 'Aesop_Core' ) ) { |
|
171 | - $notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
172 | - <p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank |
|
173 | - ">'.__( 'Aesop Story Engine', 'lasso' ).'</a> '.__( 'isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso' ).'</p> |
|
174 | - </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') ); |
|
170 | + if (!class_exists('Aesop_Core')) { |
|
171 | + $notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
172 | + <p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank |
|
173 | + ">'.__('Aesop Story Engine', 'lasso').'</a> '.__('isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso').'</p> |
|
174 | + </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine')); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | // we dont really get along with wp side comments because of the section ids that get applied dynamically. since we save our html, it'll get saved along with the post as HTML |
178 | - if ( class_exists( 'WP_Side_Comments' ) ) { |
|
179 | - $notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3> |
|
180 | - <p>'.__( 'Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso' ).'</p> |
|
178 | + if (class_exists('WP_Side_Comments')) { |
|
179 | + $notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3> |
|
180 | + <p>'.__('Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso').'</p> |
|
181 | 181 | </li>'; |
182 | 182 | } |
183 | 183 | |
184 | 184 | // if the license key isnt activated |
185 | - if ( empty( $license ) ) { |
|
186 | - $notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3> |
|
187 | - <p>'.__( 'Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso' ).'</p> |
|
185 | + if (empty($license)) { |
|
186 | + $notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3> |
|
187 | + <p>'.__('Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso').'</p> |
|
188 | 188 | </li>'; |
189 | 189 | } |
190 | - if ( !empty( $license ) && 'invalid' == $status ) { |
|
191 | - $notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3> |
|
192 | - <p>'.__( 'The license key that you entered is ', 'lasso' ).'<strong>'.__( 'invalid', 'lasso' ).'</strong>'.__( '. It may have been entered incorreclty, or may have expired.', 'lasso' ).'</p> |
|
190 | + if (!empty($license) && 'invalid' == $status) { |
|
191 | + $notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3> |
|
192 | + <p>'.__('The license key that you entered is ', 'lasso').'<strong>'.__('invalid', 'lasso').'</strong>'.__('. It may have been entered incorreclty, or may have expired.', 'lasso').'</p> |
|
193 | 193 | </li>'; |
194 | 194 | } |
195 | 195 | |
196 | - return apply_filters( 'lasso_preflight_notices', $notices ); |
|
196 | + return apply_filters('lasso_preflight_notices', $notices); |
|
197 | 197 | |
198 | 198 | } |
199 | 199 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $plugins = array( |
208 | 208 | |
209 | 209 | array( |
210 | - 'name' => __('Aesop Story Engine','lasso'), |
|
210 | + 'name' => __('Aesop Story Engine', 'lasso'), |
|
211 | 211 | 'slug' => 'aesop-story-engine', |
212 | 212 | 'required' => false, |
213 | 213 | ), |
@@ -215,38 +215,38 @@ discard block |
||
215 | 215 | ); |
216 | 216 | |
217 | 217 | $config = array( |
218 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
218 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
219 | 219 | 'menu' => 'lasso-install-plugins', // Menu slug. |
220 | - 'has_notices' => true, // Show admin notices or not. |
|
221 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
222 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
223 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
224 | - 'message' => '', // Message to output right before the plugins table. |
|
220 | + 'has_notices' => true, // Show admin notices or not. |
|
221 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
222 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
223 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
224 | + 'message' => '', // Message to output right before the plugins table. |
|
225 | 225 | 'strings' => array( |
226 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
227 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
228 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
229 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
230 | - 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
231 | - 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
232 | - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
233 | - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
234 | - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
235 | - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
236 | - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
237 | - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
238 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
239 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
240 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
241 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
242 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
226 | + 'page_title' => __('Install Required Plugins', 'lasso'), |
|
227 | + 'menu_title' => __('Install Plugins', 'lasso'), |
|
228 | + 'installing' => __('Installing Plugin: %s', 'lasso'), // %s = plugin name. |
|
229 | + 'oops' => __('Something went wrong with the plugin API.', 'lasso'), |
|
230 | + 'notice_can_install_required' => _n_noop('This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
231 | + 'notice_can_install_recommended' => _n_noop('This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
232 | + 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), // %1$s = plugin name(s). |
|
233 | + 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
234 | + 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
235 | + 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), // %1$s = plugin name(s). |
|
236 | + 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.'), // %1$s = plugin name(s). |
|
237 | + 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), // %1$s = plugin name(s). |
|
238 | + 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), |
|
239 | + 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins'), |
|
240 | + 'return' => __('Return to Required Plugins Installer', 'lasso'), |
|
241 | + 'plugin_activated' => __('Plugin activated successfully.', 'lasso'), |
|
242 | + 'complete' => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link. |
|
243 | 243 | 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
244 | 244 | ) |
245 | 245 | ); |
246 | 246 | |
247 | - $plugins = apply_filters( 'lasso_required_plugins', $plugins ); |
|
247 | + $plugins = apply_filters('lasso_required_plugins', $plugins); |
|
248 | 248 | |
249 | - tgmpa( $plugins, $config ); |
|
249 | + tgmpa($plugins, $config); |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | } |
@@ -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', '0.9.16.4' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '0.9.16.4'); |
|
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>Lasso 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 |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | -if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) { |
|
10 | - add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 ); |
|
9 | +if (lasso_user_can('edit_posts') && !is_admin()) { |
|
10 | + add_filter('the_content', 'lasso_wrap_shortcodes', 9); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -20,33 +20,33 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return string |
22 | 22 | */ |
23 | -function lasso_wrap_shortcodes( $content ) { |
|
23 | +function lasso_wrap_shortcodes($content) { |
|
24 | 24 | global $shortcode_tags; |
25 | 25 | |
26 | - if ( false === strpos( $content, '[' ) ) { |
|
26 | + if (false === strpos($content, '[')) { |
|
27 | 27 | return $content; |
28 | 28 | } |
29 | 29 | |
30 | - if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) { |
|
30 | + if (empty($shortcode_tags) || !is_array($shortcode_tags)) { |
|
31 | 31 | return $content; |
32 | 32 | } |
33 | 33 | |
34 | - $tagnames = array_keys( $shortcode_tags ); |
|
35 | - $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); |
|
34 | + $tagnames = array_keys($shortcode_tags); |
|
35 | + $tagregexp = join('|', array_map('preg_quote', $tagnames)); |
|
36 | 36 | $pattern = "/\\[($tagregexp)/s"; |
37 | 37 | |
38 | - if ( 0 === preg_match( $pattern, $content ) ) { |
|
38 | + if (0 === preg_match($pattern, $content)) { |
|
39 | 39 | // Avoids parsing HTML when there are no shortcodes or embeds anyway. |
40 | 40 | return $content; |
41 | 41 | } |
42 | 42 | |
43 | - $content = do_shortcodes_in_html_tags( $content, true ,$tagnames); |
|
43 | + $content = do_shortcodes_in_html_tags($content, true, $tagnames); |
|
44 | 44 | |
45 | 45 | $pattern = get_shortcode_regex(); |
46 | - $content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content ); |
|
46 | + $content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content); |
|
47 | 47 | |
48 | 48 | // Always restore square braces so we don't break things like <!--[if IE ]> |
49 | - $content = unescape_invalid_shortcodes( $content ); |
|
49 | + $content = unescape_invalid_shortcodes($content); |
|
50 | 50 | |
51 | 51 | return $content; |
52 | 52 | } |
@@ -60,33 +60,33 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return string |
62 | 62 | */ |
63 | -function lasso_wrap_shortcode_tag( $m ) { |
|
63 | +function lasso_wrap_shortcode_tag($m) { |
|
64 | 64 | // allow [[foo]] syntax for escaping a tag |
65 | - if ( $m[1] == '[' && $m[6] == ']' ) { |
|
66 | - return substr( $m[0], 1, - 1 ); |
|
65 | + if ($m[1] == '[' && $m[6] == ']') { |
|
66 | + return substr($m[0], 1, - 1); |
|
67 | 67 | } |
68 | - $exception_arr1 = array('aesop_gallery_pop','aesop_character_carousel'); |
|
69 | - $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler','av_textblock','av_toggle_container','av_toggle'); |
|
70 | - $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions',$exception_arr2); |
|
68 | + $exception_arr1 = array('aesop_gallery_pop', 'aesop_character_carousel'); |
|
69 | + $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler', 'av_textblock', 'av_toggle_container', 'av_toggle'); |
|
70 | + $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions', $exception_arr2); |
|
71 | 71 | |
72 | - if ( strpos( $m[2],'aesop_' ) === 0 ) { |
|
72 | + if (strpos($m[2], 'aesop_') === 0) { |
|
73 | 73 | // check against the exceptions |
74 | - if (strpos_arr($m[2],$exception_arr1)===false) { |
|
74 | + if (strpos_arr($m[2], $exception_arr1) === false) { |
|
75 | 75 | return $m[0]; |
76 | 76 | } |
77 | 77 | } |
78 | - if (strpos_arr($m[2],$exception_arr2)!==false) { |
|
78 | + if (strpos_arr($m[2], $exception_arr2) !== false) { |
|
79 | 79 | return $m[0]; |
80 | 80 | } |
81 | 81 | |
82 | - return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
82 | + return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /* a helper function */ |
86 | 86 | function strpos_arr($haystack, $needle) { |
87 | - if(!is_array($needle)) $needle = array($needle); |
|
88 | - foreach($needle as $what) { |
|
89 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
87 | + if (!is_array($needle)) $needle = array($needle); |
|
88 | + foreach ($needle as $what) { |
|
89 | + if (($pos = strpos($haystack, $what)) !== false) return $pos; |
|
90 | 90 | } |
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -12,22 +12,22 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - if ( isset( $options[$option] ) ) { |
|
30 | + if (isset($options[$option])) { |
|
31 | 31 | return $options[$option]; |
32 | 32 | } |
33 | 33 | |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function lasso_editor_galleries_exist() { |
44 | 44 | |
45 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
45 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
46 | 46 | |
47 | - if ( $q->have_posts() ) |
|
47 | + if ($q->have_posts()) |
|
48 | 48 | return true; |
49 | 49 | else |
50 | 50 | return false; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | function lasso_get_supported_theme_class() { |
60 | 60 | |
61 | 61 | $name = wp_get_theme()->get('Name'); |
62 | - $slug = lasso_clean_string( $name ); |
|
62 | + $slug = lasso_clean_string($name); |
|
63 | 63 | |
64 | - switch ( $slug ) { |
|
64 | + switch ($slug) { |
|
65 | 65 | case 'aesop-story-theme': // aesop |
66 | 66 | $out = '.aesop-entry-content'; |
67 | 67 | break; |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | |
111 | 111 | } |
112 | 112 | |
113 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
113 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
114 | 114 | //return !empty( $out ) ? $out : false; |
115 | 115 | } |
116 | 116 | |
117 | 117 | function lasso_get_supported_theme_title_class() { |
118 | 118 | |
119 | 119 | $name = wp_get_theme()->get('Name'); |
120 | - $slug = lasso_clean_string( $name ); |
|
120 | + $slug = lasso_clean_string($name); |
|
121 | 121 | |
122 | - switch ( $slug ) { |
|
122 | + switch ($slug) { |
|
123 | 123 | |
124 | 124 | case 'aesop-story-theme': // aesop |
125 | 125 | $out = '.aesop-entry-title'; |
@@ -147,16 +147,16 @@ discard block |
||
147 | 147 | break; |
148 | 148 | } |
149 | 149 | |
150 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
150 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | //since 0.9.9.6 |
154 | 154 | function lasso_get_supported_theme_featured_image_class() { |
155 | 155 | |
156 | 156 | $name = wp_get_theme()->get('Name'); |
157 | - $slug = lasso_clean_string( $name ); |
|
157 | + $slug = lasso_clean_string($name); |
|
158 | 158 | |
159 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
159 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @since 0.8.7 |
168 | 168 | * @return string of comma separated classes |
169 | 169 | */ |
170 | -function lasso_supported_no_save(){ |
|
170 | +function lasso_supported_no_save() { |
|
171 | 171 | |
172 | 172 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container, .jp-relatedposts, .fb-comments'); |
173 | 173 | } |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @return array|mixed|object|string|void |
183 | 183 | */ |
184 | -function lasso_sanitize_data( $data ) { |
|
185 | - return \lasso\sanatize::do_sanitize( $data ); |
|
184 | +function lasso_sanitize_data($data) { |
|
185 | + return \lasso\sanatize::do_sanitize($data); |
|
186 | 186 | |
187 | 187 | } |
188 | 188 | |
@@ -192,18 +192,18 @@ discard block |
||
192 | 192 | * @since 0.9.3 |
193 | 193 | * @return string of comma delimited category slugs |
194 | 194 | */ |
195 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
195 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
196 | 196 | |
197 | - if ( empty( $postid ) ) |
|
197 | + if (empty($postid)) |
|
198 | 198 | $postid = get_the_ID(); |
199 | 199 | |
200 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
200 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
201 | 201 | |
202 | - if ( empty( $objects) ) |
|
202 | + if (empty($objects)) |
|
203 | 203 | return; |
204 | 204 | |
205 | 205 | $out = ''; |
206 | - foreach( $objects as $object ) { |
|
206 | + foreach ($objects as $object) { |
|
207 | 207 | //$out .= $object->slug.', '; |
208 | 208 | $out .= $object->name.','; |
209 | 209 | } |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | * @since 0.9.3 |
219 | 219 | * @return array all categoiries |
220 | 220 | */ |
221 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
221 | +function lasso_get_objects($taxonomy = 'category') { |
|
222 | 222 | |
223 | 223 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 224 | |
225 | - if ( empty( $objects) ) |
|
225 | + if (empty($objects)) |
|
226 | 226 | return; |
227 | 227 | |
228 | 228 | $out = ""; |
229 | - foreach( $objects as $object ) { |
|
229 | + foreach ($objects as $object) { |
|
230 | 230 | $out .= $object->name.','; |
231 | 231 | } |
232 | 232 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | * @since 0.9.4 |
242 | 242 | */ |
243 | 243 | function lasso_post_types_names() { |
244 | - $post_types = get_post_types( array( |
|
244 | + $post_types = get_post_types(array( |
|
245 | 245 | 'public' => true, |
246 | - ), 'objects' ); |
|
247 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
248 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + ), 'objects'); |
|
247 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
248 | + unset($post_types['attachment']); |
|
249 | 249 | |
250 | 250 | /** |
251 | 251 | * Set which post types are allowed |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
256 | 256 | */ |
257 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
258 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
257 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
258 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
259 | 259 | if (!current_user_can('edit_pages')) { |
260 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
260 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
261 | 261 | } |
262 | - foreach( $post_types as $name => $label ) { |
|
263 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
264 | - unset( $post_types[ $name ] ); |
|
262 | + foreach ($post_types as $name => $label) { |
|
263 | + if (!in_array($name, $allowed_post_types)) { |
|
264 | + unset($post_types[$name]); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | return $post_types; |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | |
270 | 270 | |
271 | 271 | function lasso_post_types() { |
272 | - $post_types = get_post_types( array( |
|
272 | + $post_types = get_post_types(array( |
|
273 | 273 | 'public' => true, |
274 | - ), 'names' ); |
|
275 | - unset( $post_types[ 'attachment' ] ); |
|
274 | + ), 'names'); |
|
275 | + unset($post_types['attachment']); |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * Set which post types are allowed |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
283 | 283 | */ |
284 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
285 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
286 | - foreach( $post_types as $name => $label ) { |
|
287 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
288 | - unset( $post_types[ $name ] ); |
|
284 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
285 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
286 | + foreach ($post_types as $name => $label) { |
|
287 | + if (!in_array($name, $allowed_post_types)) { |
|
288 | + unset($post_types[$name]); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | return $post_types; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | global $wp_post_types; |
296 | 296 | $post_types = lasso_post_types(); |
297 | 297 | $rest_base = array(); |
298 | - foreach ( $post_types as $post_type) { |
|
298 | + foreach ($post_types as $post_type) { |
|
299 | 299 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
300 | 300 | } |
301 | 301 | |
@@ -313,22 +313,22 @@ discard block |
||
313 | 313 | * @uses lasso_modal_addons() |
314 | 314 | * @since 0.9.4 |
315 | 315 | */ |
316 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
316 | +function lasso_modal_addons_content($tab = '', $type) { |
|
317 | 317 | |
318 | - $name = lasso_clean_string( $tab['name'] ); |
|
318 | + $name = lasso_clean_string($tab['name']); |
|
319 | 319 | |
320 | - if ( 'tab' == $type ) { |
|
320 | + if ('tab' == $type) { |
|
321 | 321 | |
322 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
322 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
323 | 323 | |
324 | - } else if ( 'content' == $type ){ |
|
324 | + } else if ('content' == $type) { |
|
325 | 325 | |
326 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
327 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
326 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
327 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
328 | 328 | |
329 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
329 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
330 | 330 | %s%s |
331 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
331 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
332 | 332 | |
333 | 333 | } |
334 | 334 | |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | * |
344 | 344 | * @return void|string |
345 | 345 | */ |
346 | -function lasso_clean_string( $string = '' ) { |
|
346 | +function lasso_clean_string($string = '') { |
|
347 | 347 | |
348 | - if ( empty( $string ) ) |
|
348 | + if (empty($string)) |
|
349 | 349 | return; |
350 | 350 | |
351 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
351 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -361,13 +361,13 @@ discard block |
||
361 | 361 | * |
362 | 362 | * @return void|string |
363 | 363 | */ |
364 | -function lasso_unclean_string( $string = '' ) { |
|
364 | +function lasso_unclean_string($string = '') { |
|
365 | 365 | |
366 | - if ( empty( $string ) ) { |
|
366 | + if (empty($string)) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
370 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
370 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | |
@@ -382,39 +382,39 @@ discard block |
||
382 | 382 | * @param unknown $postid int the id of the post object to check against |
383 | 383 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
384 | 384 | */ |
385 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
386 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
385 | +if (!function_exists('lasso_user_can')): |
|
386 | + function lasso_user_can($action = '', $postid = 0) { |
|
387 | 387 | $result = false; |
388 | - if ( empty( $action ) ) |
|
388 | + if (empty($action)) |
|
389 | 389 | $action = 'edit_posts'; |
390 | 390 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
391 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | 392 | $postid = get_the_ID(); |
393 | 393 | |
394 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
394 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
395 | 395 | // check against post types: |
396 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
396 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
397 | 397 | |
398 | 398 | if (!current_user_can('edit_pages')) { |
399 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
399 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | if (!empty($allowed_post_types) && !empty($postid)) { |
403 | - $type = get_post_type( $postid ); |
|
404 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | + $type = get_post_type($postid); |
|
404 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
405 | 405 | |
406 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
407 | - $result = true; |
|
406 | + if (in_array($type, $allowed_post_types)) { |
|
407 | + $result = true; |
|
408 | 408 | } |
409 | 409 | } else { |
410 | 410 | //we are not checking against a post, return true |
411 | - $result = true; |
|
411 | + $result = true; |
|
412 | 412 | } |
413 | 413 | } else { |
414 | 414 | $result = false; |
415 | 415 | } |
416 | 416 | |
417 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
417 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
418 | 418 | } |
419 | 419 | endif; |
420 | 420 | |
@@ -423,25 +423,25 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @since 0.9.5 |
425 | 425 | */ |
426 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
426 | +if (!function_exists('lasso_editor_empty_results')): |
|
427 | 427 | |
428 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
428 | + function lasso_editor_empty_results($type = 'posts') { |
|
429 | 429 | |
430 | - if ( 'posts' == $type ) { |
|
430 | + if ('posts' == $type) { |
|
431 | 431 | |
432 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
432 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
433 | 433 | $icon = 'lasso-icon-file-text2'; |
434 | 434 | $button = false; |
435 | 435 | |
436 | - } elseif ( 'revision' == $type ) { |
|
436 | + } elseif ('revision' == $type) { |
|
437 | 437 | |
438 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
438 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
439 | 439 | $icon = 'lasso-icon-history'; |
440 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
440 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
441 | 441 | |
442 | 442 | } |
443 | 443 | |
444 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
444 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | endif; |