Completed
Push — master ( 433c60...be99ef )
by
unknown
07:34
created
lasso.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
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.18.3' );
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.18.3');
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
public/includes/assets.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 			wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true);
24 24
 
25
-            //don't load autocomplete if it's a stockholm theme
25
+			//don't load autocomplete if it's a stockholm theme
26 26
 			$themename  	= wp_get_theme()->get('Name');
27 27
 			if ($themename !='Stockholm' ) {
28 28
 				wp_enqueue_script('jquery-ui-autocomplete');
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			$postid 			= get_the_ID();
86 86
 			
87 87
 			$post_date = get_the_time('U', $postid);
88
-            $delta = time() - $post_date;
88
+			$delta = time() - $post_date;
89 89
 
90 90
 			$strings = array(
91 91
 				'save' 				=> __('Save','lasso'),
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
133 133
 			
134 134
 			
135
-            if ($allow_change_date) {
136
-			    $permalink = get_site_url().'/?p='.$postid;
137
-            } else {
138
-                $permalink = get_permalink($postid);
139
-            }
135
+			if ($allow_change_date) {
136
+				$permalink = get_site_url().'/?p='.$postid;
137
+			} else {
138
+				$permalink = get_permalink($postid);
139
+			}
140 140
 			
141 141
 			// rest api
142 142
 			$rest_nonce = '';
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			
234 234
 			
235 235
 			if (!$using_restapiv2) {
236
-               // enqueue REST API V1
236
+			   // enqueue REST API V1
237 237
 			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
238 238
 			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
239 239
 			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			if ($show_color) {
250 250
 				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
251 251
 			} else {
252
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
252
+				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
253 253
 			}
254 254
 			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
255 255
 
Please login to merge, or discard this patch.
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
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
 
25 25
             //don't load autocomplete if it's a stockholm theme
26
-			$themename  	= wp_get_theme()->get('Name');
27
-			if ($themename !='Stockholm' ) {
26
+			$themename = wp_get_theme()->get('Name');
27
+			if ($themename != 'Stockholm') {
28 28
 				wp_enqueue_script('jquery-ui-autocomplete');
29 29
 			}
30 30
 			wp_enqueue_script('jquery-ui-draggable');
@@ -37,27 +37,27 @@  discard block
 block discarded – undo
37 37
 			// url for json api
38 38
 			$home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false;
39 39
 
40
-			$article_object 	= lasso_editor_get_option('article_class','lasso_editor');
40
+			$article_object 	= lasso_editor_get_option('article_class', 'lasso_editor');
41 41
 
42
-			$article_object 	= empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
42
+			$article_object 	= empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object;
43 43
 
44
-			$featImgClass 		= lasso_editor_get_option('featimg_class','lasso_editor');
45
-			if (empty( $featImgClass )) {
44
+			$featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor');
45
+			if (empty($featImgClass)) {
46 46
 				$featImgClass = lasso_get_supported_theme_featured_image_class();
47 47
 			}
48
-			$titleClass 		= lasso_editor_get_option('title_class','lasso_editor');
49
-			if (empty( $titleClass )) {
48
+			$titleClass = lasso_editor_get_option('title_class', 'lasso_editor');
49
+			if (empty($titleClass)) {
50 50
 				$titleClass = lasso_get_supported_theme_title_class();
51 51
 			}
52
-			$toolbar_headings  	= lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
-			$toolbar_headings_h4  	= lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
52
+			$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
53
+			$toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor');
54 54
 			$objectsNoSave  	= lasso_editor_get_option('dont_save', 'lasso_editor');
55
-			$objectsNonEditable  	= lasso_editor_get_option('non_editable', 'lasso_editor');
55
+			$objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor');
56 56
 			$disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor');
57
-			$save_to_post_disabled  = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' );
57
+			$save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor');
58 58
 			
59
-			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b');
60
-			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i');
59
+			$bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b');
60
+			$i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i');
61 61
 
62 62
 			
63 63
 			//text alignement
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
 			
72 72
 			if ($show_color) {
73 73
 				//color picker
74
-				wp_enqueue_style( 'wp-color-picker' );
75
-				wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
74
+				wp_enqueue_style('wp-color-picker');
75
+				wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
76 76
 			}
77 77
 			
78 78
 			// custom fields
79 79
 			
80
-			$custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1');
80
+			$custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1');
81 81
 
82 82
 
83 83
 
@@ -88,48 +88,48 @@  discard block
 block discarded – undo
88 88
             $delta = time() - $post_date;
89 89
 
90 90
 			$strings = array(
91
-				'save' 				=> __('Save','lasso'),
92
-				'saving' 			=> __('Saving...','lasso'),
93
-				'saved'				=> __('Saved!','lasso'),
94
-				'adding' 			=> __('Adding...','lasso'),
95
-				'added'				=> __('Added!','lasso'),
96
-				'loading' 			=> __('Loading...','lasso'),
97
-				'loadMore'			=> __('Load More','lasso'),
98
-				'close'			=> __('Close','lasso'),
99
-				'noPostsFound'		=> __('No more posts found','lasso'),
100
-				'fetchFail'	    	=> __('Fetching failed.','lasso'),
101
-				'galleryCreated' 	=> __('Gallery Created!','lasso'),
102
-				'galleryUpdated' 	=> __('Gallery Updated!','lasso'),
103
-				'justWrite'			=> __('Just write...','lasso'),
104
-				'chooseImage'		=> __('Choose an image','lasso'),
105
-				'updateImage'		=> __('Update Image','lasso'),
106
-				'insertImage'		=> __('Insert Image','lasso'),
107
-				'selectImage'		=> __('Select Image','lasso'),
108
-				'removeFeatImg'     => __('Remove featured image?','lasso'),
109
-				'updateSelectedImg' => __('Update Selected Image','lasso'),
110
-				'chooseImages'		=> __('Choose images','lasso'),
111
-				'editImage'			=> __('Edit Image','lasso'),
112
-				'addImages'			=> __('Add Images','lasso'),
113
-				'addNewGallery'		=> __('Add New Gallery','lasso'),
114
-				'selectGallery'		=> __('Select Lasso Gallery Image','lasso'),
115
-				'useSelectedImages' => __('Use Selected Images','lasso'),
116
-				'publishPost'		=> __('Publish Post?','lasso'),
117
-				'publishYes'		=> __('Yes, publish it!','lasso'),
118
-				'deletePost'		=> __('Trash Post?','lasso'),
119
-				'deleteYes'			=> __('Yes, trash it!','lasso'),
120
-				'warning'			=> __('Oh snap!','laso'),
121
-				'cancelText'		=> __('O.K. got it!','lasso'),
122
-				'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'),
91
+				'save' 				=> __('Save', 'lasso'),
92
+				'saving' 			=> __('Saving...', 'lasso'),
93
+				'saved'				=> __('Saved!', 'lasso'),
94
+				'adding' 			=> __('Adding...', 'lasso'),
95
+				'added'				=> __('Added!', 'lasso'),
96
+				'loading' 			=> __('Loading...', 'lasso'),
97
+				'loadMore'			=> __('Load More', 'lasso'),
98
+				'close'			=> __('Close', 'lasso'),
99
+				'noPostsFound'		=> __('No more posts found', 'lasso'),
100
+				'fetchFail'	    	=> __('Fetching failed.', 'lasso'),
101
+				'galleryCreated' 	=> __('Gallery Created!', 'lasso'),
102
+				'galleryUpdated' 	=> __('Gallery Updated!', 'lasso'),
103
+				'justWrite'			=> __('Just write...', 'lasso'),
104
+				'chooseImage'		=> __('Choose an image', 'lasso'),
105
+				'updateImage'		=> __('Update Image', 'lasso'),
106
+				'insertImage'		=> __('Insert Image', 'lasso'),
107
+				'selectImage'		=> __('Select Image', 'lasso'),
108
+				'removeFeatImg'     => __('Remove featured image?', 'lasso'),
109
+				'updateSelectedImg' => __('Update Selected Image', 'lasso'),
110
+				'chooseImages'		=> __('Choose images', 'lasso'),
111
+				'editImage'			=> __('Edit Image', 'lasso'),
112
+				'addImages'			=> __('Add Images', 'lasso'),
113
+				'addNewGallery'		=> __('Add New Gallery', 'lasso'),
114
+				'selectGallery'		=> __('Select Lasso Gallery Image', 'lasso'),
115
+				'useSelectedImages' => __('Use Selected Images', 'lasso'),
116
+				'publishPost'		=> __('Publish Post?', 'lasso'),
117
+				'publishYes'		=> __('Yes, publish it!', 'lasso'),
118
+				'deletePost'		=> __('Trash Post?', 'lasso'),
119
+				'deleteYes'			=> __('Yes, trash it!', 'lasso'),
120
+				'warning'			=> __('Oh snap!', 'laso'),
121
+				'cancelText'		=> __('O.K. got it!', 'lasso'),
122
+				'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'),
123 123
 				'missingConfirm'	=> __('Update Settings', 'lasso'),
124
-				'helperText'		=> __('one more letter','lasso'),
124
+				'helperText'		=> __('one more letter', 'lasso'),
125 125
 				'editingBackup'  	=> __('You are currently editing a backup copy of this post.'),
126 126
 			);
127 127
 
128
-			$api_url = trailingslashit( home_url() ) . 'lasso-internal-api';
128
+			$api_url = trailingslashit(home_url()).'lasso-internal-api';
129 129
 
130 130
 			$gallery_class = new gallery();
131 131
 			$gallery_nonce_action = $gallery_class->nonce_action;
132
-			$gallery_nonce = wp_create_nonce( $gallery_nonce_action );
132
+			$gallery_nonce = wp_create_nonce($gallery_nonce_action);
133 133
 			
134 134
 			
135 135
             if ($allow_change_date) {
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 			  
145 145
 			if (function_exists('rest_url')) {
146 146
 				//$rest_root = esc_url_raw( rest_url());
147
-				$rest_nonce = wp_create_nonce( 'wp_rest' );
148
-				$settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce );
149
-				wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
150
-				wp_localize_script( 'wp-api', 'wpApiSettings', $settings );
151
-				wp_localize_script( 'wp-api', 'WP_API_Settings', $settings );
147
+				$rest_nonce = wp_create_nonce('wp_rest');
148
+				$settings = array('root' => $rest_root, 'nonce' => $rest_nonce);
149
+				wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
150
+				wp_localize_script('wp-api', 'wpApiSettings', $settings);
151
+				wp_localize_script('wp-api', 'WP_API_Settings', $settings);
152 152
 				
153
-				if ( class_exists( 'WP_REST_Controller' )) {
153
+				if (class_exists('WP_REST_Controller')) {
154 154
 					// we are using REST API V2
155 155
 					$using_restapiv2 = true;
156 156
 				}
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
 			// localized objects
160 160
 			$objects = array(
161
-				'ajaxurl' 			=> esc_url( $api_url ),
162
-				'ajaxurl2' 			=> esc_url( admin_url( 'admin-ajax.php' )),
161
+				'ajaxurl' 			=> esc_url($api_url),
162
+				'ajaxurl2' 			=> esc_url(admin_url('admin-ajax.php')),
163 163
 				'rest_root'         => $rest_root,
164 164
 				'rest_nonce'        => $rest_nonce,
165 165
 				'editor' 			=> 'lasso--content', // ID of editable content (without #) DONT CHANGE
@@ -167,13 +167,13 @@  discard block
 block discarded – undo
167 167
 				'featImgClass'		=> $featImgClass,
168 168
 				'titleClass'		=> $titleClass,
169 169
 				'strings'			=> $strings,
170
-				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ),
171
-				'post_status'		=> get_post_status( $postid ),
170
+				'settingsLink'		=> function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'),
171
+				'post_status'		=> get_post_status($postid),
172 172
 				'postid'			=> $postid,
173 173
 				'permalink'			=> $permalink,
174 174
 				'edit_others_pages'	=> current_user_can('edit_others_pages') ? true : false,
175 175
 				'edit_others_posts'	=> current_user_can('edit_others_posts') ? true : false,
176
-				'userCanEdit'		=> current_user_can('edit_post', $postid ),
176
+				'userCanEdit'		=> current_user_can('edit_post', $postid),
177 177
 				'can_publish_posts'	=> current_user_can('publish_posts'),
178 178
 				'can_publish_pages'	=> current_user_can('publish_pages'),
179 179
 				'author'			=> is_user_logged_in() ? get_current_user_ID() : false,
@@ -208,24 +208,24 @@  discard block
 block discarded – undo
208 208
 				'postTags'    		=> lasso_get_objects('tag'),
209 209
 				'noResultsDiv'		=> lasso_editor_empty_results(),
210 210
 				'noRevisionsDiv'	=> lasso_editor_empty_results('revision'),
211
-				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false,
212
-				'mapLocations'		=> get_post_meta( $postid, 'ase_map_component_locations' ),
213
-				'mapStart'			=> get_post_meta( $postid, 'ase_map_component_start_point', true ),
214
-				'mapZoom'			=> get_post_meta( $postid, 'ase_map_component_zoom', true ),
211
+				'mapTileProvider'   => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false,
212
+				'mapLocations'		=> get_post_meta($postid, 'ase_map_component_locations'),
213
+				'mapStart'			=> get_post_meta($postid, 'ase_map_component_start_point', true),
214
+				'mapZoom'			=> get_post_meta($postid, 'ase_map_component_zoom', true),
215 215
 				'revisionModal' 	=> lasso_editor_revision_modal(),
216 216
 				'isMobile'          => wp_is_mobile(),
217
-				'enableAutoSave'    => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ),
217
+				'enableAutoSave'    => lasso_editor_get_option('enable_autosave', 'lasso_editor'),
218 218
 				'showColor'         => $show_color,
219 219
 				'showAlignment'     => $show_align,
220 220
 				'showIgnoredItems'  => lasso_editor_get_option('show_ignored_items', 'lasso_editor'),
221 221
 				'restapi2'          => $using_restapiv2,
222 222
 				'saveusingrest'     => $using_restapiv2 && !$disableRESTSave,
223
-				'newObjectContent'  => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ),
223
+				'newObjectContent'  => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')),
224 224
 				'disableSavePost'   => $save_to_post_disabled,
225 225
 				'boldTag'           => $bold_tag,
226 226
 				'iTag'           	=> $i_tag,
227 227
 				'customFields'      => $custom_fields,
228
-				'skipToEdit'        =>( $delta < 10 ) // if it's a new post, skip to edit mode
228
+				'skipToEdit'        =>($delta < 10) // if it's a new post, skip to edit mode
229 229
 			);
230 230
 
231 231
 
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
 			
235 235
 			if (!$using_restapiv2) {
236 236
                // enqueue REST API V1
237
-			   wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true );
238
-			   $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) );
239
-			   wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings );
237
+			   wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true);
238
+			   $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json'));
239
+			   wp_localize_script('wp-api-js', 'WP_API_Settings', $settings);
240 240
 			}
241 241
 			
242 242
 			if ($allow_change_date) {
@@ -245,13 +245,13 @@  discard block
 block discarded – undo
245 245
 				wp_enqueue_style('jquery-ui');
246 246
 			}
247 247
 
248
-			$postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min';
248
+			$postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min';
249 249
 			if ($show_color) {
250
-				wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true);
250
+				wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true);
251 251
 			} else {
252
-			    wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
252
+			    wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true);
253 253
 			}
254
-			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) );
254
+			wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects));
255 255
 
256 256
 
257 257
 		}
Please login to merge, or discard this patch.