Completed
Push — master ( d1e536...37e872 )
by
unknown
02:11
created
includes/process/update_object.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 *  @since    0.9.3
119 119
 	 *
120 120
 	 *  @param    int    	$postid       	The current postid
121
-     *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
121
+	 *  @param    string|bool     $value    The term slug, or a comma separated list of slugs. Or false to remove all terms set for post.
122 122
 	 *  @param    string     $taxonomy    	The name of the taxonomy to which the term belongs.
123 123
 	 *
124 124
 	 *  @return bool True if update was successful, false if not.
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 			}
132 132
 			
133 133
 			if ($taxonomy =='category') {
134
-                // convert from names to category ids
134
+				// convert from names to category ids
135 135
 				$cats = array();
136 136
 				if (is_array($value)) {
137 137
 					foreach ($value as $cat) {
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 use lasso\internal_api\api_action;
11 11
 
12
-class update_object implements api_action{
12
+class update_object implements api_action {
13 13
 
14 14
 	/**
15 15
 	 * The nonce action for this request.
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return bool Always returns true.
31 31
 	 */
32
-	public function post( $data ) {
32
+	public function post($data) {
33 33
 
34
-		$status = isset( $data['status'] ) ? $data['status'] : false;
35
-		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
36
-		$slug   = isset( $data['story_slug'] ) ? $data['story_slug'] : false;
34
+		$status = isset($data['status']) ? $data['status'] : false;
35
+		$postid = isset($data['postid']) ? $data['postid'] : false;
36
+		$slug   = isset($data['story_slug']) ? $data['story_slug'] : false;
37 37
 
38 38
 
39 39
 
@@ -43,20 +43,20 @@  discard block
 block discarded – undo
43 43
 			'post_status' 	=> $status
44 44
 		);
45 45
 
46
-		wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) );
46
+		wp_update_post(apply_filters('lasso_object_status_update_args', $args));
47 47
 
48 48
 
49 49
 		// update categories
50
-		$cats  = isset( $data['story_cats'] ) ? $data['story_cats'] : false;
51
-		self::set_post_terms( $postid, $cats, 'category' );
50
+		$cats = isset($data['story_cats']) ? $data['story_cats'] : false;
51
+		self::set_post_terms($postid, $cats, 'category');
52 52
 
53 53
 
54 54
 		// update tags
55
-		$tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false;
56
-		self::set_post_terms( $postid, $tags, 'post_tag' );
55
+		$tags = isset($data['story_tags']) ? $data['story_tags'] : false;
56
+		self::set_post_terms($postid, $tags, 'post_tag');
57 57
 
58 58
 
59
-		do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() );
59
+		do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID());
60 60
 
61 61
 		return true;
62 62
 
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return array Array of keys to pull from $_POST per action and their sanitization callback
72 72
 	 */
73
-	public static function params(){
74
-		$params[ 'process_update_object_post' ] = array(
73
+	public static function params() {
74
+		$params['process_update_object_post'] = array(
75 75
 			'postid' => 'absint',
76 76
 			'status' => 'strip_tags',
77 77
 			'story_slug' => array(
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @return array Array of additional functions to use to authorize action.
102 102
 	 */
103 103
 	public static function auth_callbacks() {
104
-		$params[ 'process_update_object_post' ] = array(
104
+		$params['process_update_object_post'] = array(
105 105
 			'lasso_user_can'
106 106
 		);
107 107
 
@@ -123,14 +123,14 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 *  @return bool True if update was successful, false if not.
125 125
 	 */
126
-	public function set_post_terms( $postid, $value, $taxonomy ) {
127
-		if( $value ) {
126
+	public function set_post_terms($postid, $value, $taxonomy) {
127
+		if ($value) {
128 128
 			// first check if multiple, make array if so.
129
-			if ( self::has_multiple_objects( $value ) ) {	
130
-				$value = explode( ',', $value );
129
+			if (self::has_multiple_objects($value)) {	
130
+				$value = explode(',', $value);
131 131
 			}
132 132
 			
133
-			if ($taxonomy =='category') {
133
+			if ($taxonomy == 'category') {
134 134
                 // convert from names to category ids
135 135
 				$cats = array();
136 136
 				if (is_array($value)) {
@@ -143,17 +143,17 @@  discard block
 block discarded – undo
143 143
 				}
144 144
 			}
145 145
 	
146
-			$result = wp_set_object_terms( $postid, $value, $taxonomy );
146
+			$result = wp_set_object_terms($postid, $value, $taxonomy);
147 147
 		}
148
-		else  {
148
+		else {
149 149
 			//remove all terms from post
150
-			$result = wp_set_object_terms( $postid, null, $taxonomy );
150
+			$result = wp_set_object_terms($postid, null, $taxonomy);
151 151
 
152 152
 		}
153 153
 
154
-		if ( ! is_wp_error( $result ) ) {
154
+		if (!is_wp_error($result)) {
155 155
 			return true;
156
-		}else{
156
+		} else {
157 157
 			return false;
158 158
 		}
159 159
 
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
 	 *  @return   bool               True if there are multiple terms; otherwise, false.
169 169
 	 *	@since   0.9.3
170 170
 	 */
171
-	public function has_multiple_objects( $value ) {
171
+	public function has_multiple_objects($value) {
172 172
 
173
-		return 0 < strpos( $value, ',' );
173
+		return 0 < strpos($value, ',');
174 174
 
175 175
 	}
176 176
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,8 +144,7 @@  discard block
 block discarded – undo
144 144
 			}
145 145
 	
146 146
 			$result = wp_set_object_terms( $postid, $value, $taxonomy );
147
-		}
148
-		else  {
147
+		} else  {
149 148
 			//remove all terms from post
150 149
 			$result = wp_set_object_terms( $postid, null, $taxonomy );
151 150
 
@@ -153,7 +152,7 @@  discard block
 block discarded – undo
153 152
 
154 153
 		if ( ! is_wp_error( $result ) ) {
155 154
 			return true;
156
-		}else{
155
+		} else{
157 156
 			return false;
158 157
 		}
159 158
 
Please login to merge, or discard this patch.
public/includes/editor-modules.php 1 patch
Spacing   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,25 +133,25 @@  discard block
 block discarded – undo
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' );
148
+	$toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor');
149 149
 
150
-	$toolbar_class  = $toolbar_headings ? 'toolbar-extended' : false;
150
+	$toolbar_class = $toolbar_headings ? 'toolbar-extended' : false;
151 151
 	
152 152
 	// mobile styles
153 153
     $mobile_class = $is_mobile ? 'lasso-mobile' : false;
154
-	$mobile_style =$is_mobile ? 'style="bottom:0px;"' : null;
154
+	$mobile_style = $is_mobile ? 'style="bottom:0px;"' : null;
155 155
 	
156 156
 	//show color
157 157
 	$show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor');
@@ -159,94 +159,94 @@  discard block
 block discarded – undo
159 159
 	//show alignment
160 160
 	$show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor');
161 161
 	
162
-	$status = get_post_status( get_the_ID() );
162
+	$status = get_post_status(get_the_ID());
163 163
 
164 164
 
165 165
 	?>
166
-	<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 ?>>
167
-		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>>
168
-			<?php do_action( 'lasso_toolbar_components_before' );?>
169
-		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li>
170
-		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li>
171
-		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li>
172
-		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li>
173
-		    <?php if ( $toolbar_headings ): ?>
174
-		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li>
175
-		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li>
166
+	<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 ?>>
167
+		<ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>>
168
+			<?php do_action('lasso_toolbar_components_before'); ?>
169
+		    <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li>
170
+		    <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li>
171
+		    <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li>
172
+		    <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li>
173
+		    <?php if ($toolbar_headings): ?>
174
+		    <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li>
175
+		    <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li>
176 176
 			<?php endif; ?>
177 177
 			
178
-			<?php if ( $show_color ): ?>
179
-		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Text Color', 'lasso' );?>"></li>
180
-		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li>
178
+			<?php if ($show_color): ?>
179
+		    <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Text Color', 'lasso'); ?>"></li>
180
+		    <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li>
181 181
 			<?php endif; ?>
182 182
 					
183
-		    <li id="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>">
183
+		    <li id="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>">
184 184
 			    <ul id="lasso-toolbar--components__list" style="display:none;">
185
-			    	<?php if ( 'ase-active' == $ase_status ): ?>
186
-						<li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li>
187
-						<li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li>
188
-						<li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>"  class="lasso-toolbar--component__quote"></li>
189
-						<li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>"  class="lasso-toolbar--component__content"></li>
190
-						<li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>"  class="lasso-toolbar--component__chapter"></li>
191
-						<li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>"  class="lasso-toolbar--component__parallax"></li>
192
-						<li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>"  class="lasso-toolbar--component__audio"></li>
193
-						<li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>"  class="lasso-toolbar--component__video"></li>
194
-						<li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>"  class="lasso-toolbar--component__map"></li>
195
-						<li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>"  class="lasso-toolbar--component__timeline"></li>
196
-						<li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>"  class="lasso-toolbar--component__document"></li>
197
-						<li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>"  class="lasso-toolbar--component__collection"></li>
198
-						<li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>"  class="lasso-toolbar--component__gallery"></li>
199
-						<?php if ( class_exists ('Aesop_GalleryPop') ) { ?>
200
-						     <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>"  class="lasso-toolbar--component__gallerypop"></li>
185
+			    	<?php if ('ase-active' == $ase_status): ?>
186
+						<li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li>
187
+						<li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li>
188
+						<li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>"  class="lasso-toolbar--component__quote"></li>
189
+						<li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>"  class="lasso-toolbar--component__content"></li>
190
+						<li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>"  class="lasso-toolbar--component__chapter"></li>
191
+						<li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>"  class="lasso-toolbar--component__parallax"></li>
192
+						<li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>"  class="lasso-toolbar--component__audio"></li>
193
+						<li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>"  class="lasso-toolbar--component__video"></li>
194
+						<li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>"  class="lasso-toolbar--component__map"></li>
195
+						<li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>"  class="lasso-toolbar--component__timeline"></li>
196
+						<li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>"  class="lasso-toolbar--component__document"></li>
197
+						<li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>"  class="lasso-toolbar--component__collection"></li>
198
+						<li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>"  class="lasso-toolbar--component__gallery"></li>
199
+						<?php if (class_exists('Aesop_GalleryPop')) { ?>
200
+						     <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>"  class="lasso-toolbar--component__gallerypop"></li>
201 201
 						<?php }?>
202 202
 					<?php else: ?>
203
-						<li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li>
204
-						<li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li>
205
-						<!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li-->
203
+						<li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li>
204
+						<li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li>
205
+						<!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li-->
206 206
 					<?php endif; ?>
207
-					<?php do_action( 'lasso_toolbar_components' );?>
207
+					<?php do_action('lasso_toolbar_components'); ?>
208 208
 			    </ul>
209 209
 			</li>
210
-			<li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>">
210
+			<li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>">
211 211
 		    	<div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> >
212
-		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div>
213
-		    		<a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
212
+		    		<div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div>
213
+		    		<a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a>
214 214
 					<input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/>
215 215
                     <label for="aesop-toolbar--link_newtab">Open in Another Tab</label>
216 216
 		    	</div>
217 217
 		    </li>
218
-		    <?php do_action( 'lasso_toolbar_components_after' );?>
219
-		    <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML', 'lasso' );?>">
218
+		    <?php do_action('lasso_toolbar_components_after'); ?>
219
+		    <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML', 'lasso'); ?>">
220 220
 		    	<div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>>
221
-		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div>
221
+		    		<div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div>
222 222
 		    		<div id="lasso-toolbar--html__footer">
223 223
 		    			<ul class="lasso-toolbar--html-snips">
224
-		    				<?php if ( !$toolbar_headings ): ?>
225
-		    				<li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>">
226
-		    				<li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>">
224
+		    				<?php if (!$toolbar_headings): ?>
225
+		    				<li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>">
226
+		    				<li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>">
227 227
 		    				<?php endif; ?>
228
-		    				<li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>">
229
-		    				<li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>">
228
+		    				<li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>">
229
+		    				<li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>">
230 230
 		    			</ul>
231
-		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a>
232
-		    			<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>
231
+		    			<a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a>
232
+		    			<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>
233 233
 		    		</div>
234 234
 		    	</div>
235 235
 		    </li>
236
-			<?php if ( $show_align ): ?>
237
-		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li>
238
-		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li>
239
-			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li>
236
+			<?php if ($show_align): ?>
237
+		    <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li>
238
+		    <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li>
239
+			<li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li>
240 240
 			<?php endif; ?>
241 241
 		</ul>
242
-		<?php if ( is_singular() && $is_mobile ) { ?>
242
+		<?php if (is_singular() && $is_mobile) { ?>
243 243
 
244
-				<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;">
244
+				<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;">
245 245
 
246
-					<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>
246
+					<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>
247 247
 
248
-					<?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') )  ) { ?>
249
-						<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>
248
+					<?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?>
249
+						<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>
250 250
 					<?php } ?>
251 251
 
252 252
 				</div>
@@ -264,22 +264,22 @@  discard block
 block discarded – undo
264 264
  */
265 265
 function lasso_editor_settings_toolbar() {
266 266
 
267
-	$delete_nonce = wp_create_nonce( 'lasso-delete-nonce' );
267
+	$delete_nonce = wp_create_nonce('lasso-delete-nonce');
268 268
 
269 269
 	ob_start();
270 270
 
271
-	if ( !lasso_user_can() )
271
+	if (!lasso_user_can())
272 272
 		return;
273 273
 
274 274
 	// let users add custom css classes
275
-	$custom_classes = apply_filters( 'lasso_component_classes', '' );
275
+	$custom_classes = apply_filters('lasso_component_classes', '');
276 276
 
277 277
 	?>
278
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
279
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
280
-		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
281
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
282
-		<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>
278
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
279
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
280
+		<li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
281
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
282
+		<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>
283 283
 	</ul>
284 284
 
285 285
 	<?php return ob_get_clean();
@@ -295,17 +295,17 @@  discard block
 block discarded – undo
295 295
 
296 296
 	ob_start();
297 297
 
298
-	if ( !lasso_user_can() )
298
+	if (!lasso_user_can())
299 299
 		return;
300 300
 
301 301
 	// has post thumbnail
302
-	$has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false;
302
+	$has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false;
303 303
 
304 304
 	?>
305
-	<ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>>
306
-		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li>
307
-		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
308
-		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li>
305
+	<ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>>
306
+		<li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li>
307
+		<li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li>
308
+		<li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li>
309 309
 	</ul>
310 310
 
311 311
 	<?php return ob_get_clean();
@@ -324,55 +324,55 @@  discard block
 block discarded – undo
324 324
 
325 325
 	ob_start();
326 326
 
327
-	if ( !lasso_user_can() )
327
+	if (!lasso_user_can())
328 328
 		return;
329 329
 
330 330
 	global $post;
331 331
 
332 332
 	$postid = get_the_ID();
333 333
 
334
-	$status = get_post_status( $postid );
335
-	$nonce = wp_create_nonce( 'lasso-update-post-settings' );
334
+	$status = get_post_status($postid);
335
+	$nonce = wp_create_nonce('lasso-update-post-settings');
336 336
 
337 337
 	// let users add custom css classes
338
-	$custom_classes = apply_filters( 'lasso_modal_settings_classes', '' );
338
+	$custom_classes = apply_filters('lasso_modal_settings_classes', '');
339 339
 
340 340
 	// objects categories
341
-	$categories 		= lasso_get_post_objects( $postid, 'category' );
342
-	$tags 				= lasso_get_post_objects( $postid, 'tag' );
341
+	$categories = lasso_get_post_objects($postid, 'category');
342
+	$tags = lasso_get_post_objects($postid, 'tag');
343 343
 
344 344
 	// modal tabs
345
-	$tabs  				= lasso_modal_addons('tab');
346
-	$content 			= lasso_modal_addons('content');
345
+	$tabs = lasso_modal_addons('tab');
346
+	$content = lasso_modal_addons('content');
347 347
 
348 348
 	// are we singular
349
-	$is_singular 		= is_singular();
349
+	$is_singular = is_singular();
350 350
 	$is_singular_class 	= $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col';
351 351
 	$has_thumb_class    = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail';
352 352
 	$theme_supports     = current_theme_supports('post-thumbnails');
353
-	$default_image 		= LASSO_URL.'/admin/assets/img/empty-img.png';
353
+	$default_image = LASSO_URL.'/admin/assets/img/empty-img.png';
354 354
 
355 355
 ?>
356
-	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>">
356
+	<div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>">
357 357
 		<div class="lasso--modal__inner">
358 358
 
359
-			<?php if( $tabs ) { echo $tabs; } ?>
359
+			<?php if ($tabs) { echo $tabs; } ?>
360 360
 
361 361
 			<div class="lasso--modal__content modal__content--core visible" data-addon-content="core">
362
-				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" >
362
+				<form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" >
363 363
 
364
-					<?php if ( $is_singular && $theme_supports ) : ?>
364
+					<?php if ($is_singular && $theme_supports) : ?>
365 365
 					<div class="lasso--postsettings__left">
366
-						<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>
367
-						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>">
366
+						<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>
367
+						<div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>">
368 368
 
369 369
 							<div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls">
370
-								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i>
371
-								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i>
370
+								<i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i>
371
+								<i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i>
372 372
 								<i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i>
373 373
 							</div>
374 374
 
375
-							<?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?>
375
+							<?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?>
376 376
 
377 377
 						</div>
378 378
 						<div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div>
@@ -382,12 +382,12 @@  discard block
 block discarded – undo
382 382
 
383 383
 					<div class="lasso--postsettings__right">
384 384
 
385
-						<?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?>
385
+						<?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?>
386 386
 						<div class="lasso--postsettings__option story-status-option">
387
-							<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>
388
-							<ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>">
389
-								<li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li>
390
-								<li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li>
387
+							<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>
388
+							<ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>">
389
+								<li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li>
390
+								<li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li>
391 391
 							</ul>
392 392
 							<div class="lasso--slider_wrap">
393 393
 								<div id="lasso--slider"></div>
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
 						</div>
396 396
 						<?php endif; ?>
397 397
 
398
-						<?php if ( 'publish' == $status ): ?>
398
+						<?php if ('publish' == $status): ?>
399 399
 						<div class="lasso--postsettings__option story-slug-option">
400
-							<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>
401
-							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>">
400
+							<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>
401
+							<input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>">
402 402
 						</div>
403 403
 						<?php endif; ?>
404 404
 
@@ -407,34 +407,34 @@  discard block
 block discarded – undo
407 407
 					<div class="lasso--postsettings__middle">
408 408
 
409 409
 						<div class="lasso--postsettings__option story-categories-option">
410
-							<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>
411
-							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>">
410
+							<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>
411
+							<input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>">
412 412
 						</div>
413 413
 
414 414
 						<div class="lasso--postsettings__option story-tags-option">
415
-							<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>
416
-							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>">
415
+							<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>
416
+							<input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>">
417 417
 						</div>
418 418
 
419 419
 					</div>
420 420
 
421
-					<?php do_action( 'lasso_modal_post_form' ); // action ?>
421
+					<?php do_action('lasso_modal_post_form'); // action ?>
422 422
 
423 423
 					<div class="lasso--postsettings__footer" >
424
-						<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
424
+						<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
425 425
 						<input type="hidden" name="status" value="">
426 426
 						<input type="hidden" name="categories" value="">
427
-						<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
427
+						<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
428 428
 						<input type="hidden" name="action" value="process_update-object_post">
429
-						<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
430
-						<?php do_action( 'lasso_modal_post_form_footer' ); // action ?>
431
-						<input type="submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>">
429
+						<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
430
+						<?php do_action('lasso_modal_post_form_footer'); // action ?>
431
+						<input type="submit" value="<?php esc_attr_e('Save', 'lasso'); ?>">
432 432
 					</div>
433 433
 
434 434
 				</form>
435 435
 			</div>
436 436
 
437
-			<?php if( $tabs ) { echo $content; } ?>
437
+			<?php if ($tabs) { echo $content; } ?>
438 438
 
439 439
 		</div>
440 440
 
@@ -455,44 +455,44 @@  discard block
 block discarded – undo
455 455
 
456 456
 	ob_start();
457 457
 
458
-	if ( !lasso_user_can('edit_posts') )
458
+	if (!lasso_user_can('edit_posts'))
459 459
 		return;
460 460
 
461
-	$status = get_post_status( get_the_ID() );
461
+	$status = get_post_status(get_the_ID());
462 462
 
463
-	$nonce = wp_create_nonce( 'lasso-editor-new-post' );
463
+	$nonce = wp_create_nonce('lasso-editor-new-post');
464 464
 
465 465
 	// let users add custom css classes
466
-	$custom_classes = apply_filters( 'lasso_modal_post_classes', '' );
466
+	$custom_classes = apply_filters('lasso_modal_post_classes', '');
467 467
 
468 468
 	// return the post type
469
-	$type = get_post_type( get_the_ID() );
469
+	$type = get_post_type(get_the_ID());
470 470
 
471 471
 	if (wp_is_mobile()) {
472 472
 		$mobile_style = 'style="top:140px !important;"';
473 473
 	}
474 474
 	?>
475
-	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>">
475
+	<div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>">
476 476
 		<div class="lasso--modal__inner">
477 477
 
478 478
 			<form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form">
479 479
 
480 480
 				<div class="lasso--postsettings__option story-slug-option lasso--last-option">
481
-					<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>
482
-					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Grump Wizards Make Toxic Brew', 'lasso' );?>">
481
+					<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>
482
+					<input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Grump Wizards Make Toxic Brew', 'lasso'); ?>">
483 483
 						<div class="lasso--select-wrap" style="width:90px">
484 484
 						<select id="lasso--select-type" name="story_type">
485 485
 
486 486
 							<?php
487 487
 								$types = lasso_post_types();
488 488
 
489
-								if ( !empty( $types ) ) {
489
+								if (!empty($types)) {
490 490
 
491
-									foreach( $types as $type ) {
491
+									foreach ($types as $type) {
492 492
 
493
-										$type = preg_replace( '/s\b/','', $type );
493
+										$type = preg_replace('/s\b/', '', $type);
494 494
 
495
-										printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $type ) ) );
495
+										printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($type)));
496 496
 									}
497 497
 
498 498
 								}
@@ -502,12 +502,12 @@  discard block
 block discarded – undo
502 502
 					</div>
503 503
 				</div>
504 504
 
505
-				<div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;';} ?>">
506
-					<a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a>
505
+				<div class="lasso--postsettings__footer" style="<?php if (!wp_is_mobile()) {echo 'display:none;'; } ?>">
506
+					<a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a>
507 507
 					<input type="hidden" name="action" value="process_new-object_post">
508 508
 					<input type="hidden" name="object" value="post">
509
-					<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
510
-					<input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>">
509
+					<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
510
+					<input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>">
511 511
 				</div>
512 512
 
513 513
 			</form>
@@ -535,18 +535,18 @@  discard block
 block discarded – undo
535 535
 	ob_start();
536 536
 
537 537
 	// post status
538
-	$status = get_post_status( get_the_ID() );
538
+	$status = get_post_status(get_the_ID());
539 539
 
540 540
 	// let users add custom css classes
541
-	$custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' );
541
+	$custom_classes = apply_filters('lasso_modal_all_post_classes', '');
542 542
 
543 543
 	?>
544
-	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%">
544
+	<div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%">
545 545
 		<div class="lasso--modal__inner">
546 546
 
547 547
 			<div class="lasso--post-filtering not-visible">
548 548
 				<div class="lasso--search__results">
549
-					<span id="lasso--results-found"></span><?php _e('results found','lasso');?>
549
+					<span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?>
550 550
 				</div>
551 551
 				<div class="lasso--search">
552 552
 					<i id="lasso--search__toggle" class="dashicons dashicons-search"></i>
@@ -559,18 +559,18 @@  discard block
 block discarded – undo
559 559
 
560 560
 				$post_types = lasso_post_types_names();
561 561
 
562
-				if ( ! empty( $post_types ) ) {
562
+				if (!empty($post_types)) {
563 563
 					$first = 'active';
564
-					foreach( $post_types as $name => $label ) {
564
+					foreach ($post_types as $name => $label) {
565 565
 						//printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $name ), esc_attr( $label ) );
566 566
 						//print_r($post_types);
567
-						printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $name ), esc_attr( $label ) );
567
+						printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($name), esc_attr($label));
568 568
 						$first = '';
569 569
 					}
570 570
 
571 571
 				}
572 572
 
573
-				do_action('lasso_modal_post_objects');?>
573
+				do_action('lasso_modal_post_objects'); ?>
574 574
 
575 575
 			</ul>
576 576
 			<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
@@ -588,18 +588,18 @@  discard block
 block discarded – undo
588 588
 
589 589
 	ob_start();
590 590
 
591
-	if ( !lasso_user_can() )
591
+	if (!lasso_user_can())
592 592
 		return;
593 593
 
594 594
 	// let users add custom css classes
595
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
595
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
596 596
 
597 597
 	?>
598
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
599
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
600
-		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
601
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
602
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
598
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
599
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
600
+		<li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
601
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
602
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
603 603
 	</ul>
604 604
 
605 605
 	<?php return ob_get_clean();
@@ -609,18 +609,18 @@  discard block
 block discarded – undo
609 609
 
610 610
 	ob_start();
611 611
 
612
-	if ( !lasso_user_can() )
612
+	if (!lasso_user_can())
613 613
 		return;
614 614
 
615 615
 	// let users add custom css classes
616
-	$custom_classes = apply_filters( 'lasso_wpimg_classes', '' );
616
+	$custom_classes = apply_filters('lasso_wpimg_classes', '');
617 617
 
618 618
 	?>
619
-	<ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false">
620
-		<li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li>
621
-		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li>
622
-		<li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li>
623
-		<li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li>
619
+	<ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false">
620
+		<li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li>
621
+		<li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li>
622
+		<li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li>
623
+		<li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li>
624 624
 	</ul>
625 625
 
626 626
 	<?php return ob_get_clean();
@@ -633,16 +633,16 @@  discard block
 block discarded – undo
633 633
  */
634 634
 function lasso_map_form_footer() {
635 635
 
636
-	$nonce = wp_create_nonce( 'lasso-process-map' );
636
+	$nonce = wp_create_nonce('lasso-process-map');
637 637
 
638 638
 	ob_start();
639 639
 
640 640
 	?>
641 641
 	<div class="lasso--map-form__footer">
642
-		<input type="hidden" name="postid" value="<?php echo get_the_ID();?>">
643
-		<input type="hidden" name="nonce" value="<?php echo $nonce;?>">
642
+		<input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>">
643
+		<input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
644 644
 		<input type="hidden" name="action" value="process_map_save">
645
-		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>">
645
+		<input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>">
646 646
 	</div>
647 647
 
648 648
 	<?php return ob_get_clean();
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
 	?>
662 662
 	<div id="lasso--pagerefresh" class="visible">
663
-		<?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?>
663
+		<?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?>
664 664
 	</div>
665 665
 
666 666
 	<?php return ob_get_clean();
@@ -674,43 +674,43 @@  discard block
 block discarded – undo
674 674
  */
675 675
 function lasso_editor_options_blob() {
676 676
 
677
-	$codes   = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' );
678
-	$galleries  = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
677
+	$codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', '');
678
+	$galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery';
679 679
 
680
-	$nonce = wp_create_nonce( 'lasso_gallery' );
680
+	$nonce = wp_create_nonce('lasso_gallery');
681 681
 
682 682
 	$blob = array();
683 683
 
684
-	if ( empty( $codes ) )
684
+	if (empty($codes))
685 685
 		return;
686 686
 
687
-	foreach ( $codes as $slug => $shortcode ) {
687
+	foreach ($codes as $slug => $shortcode) {
688 688
 		$return = '';
689 689
 		// Shortcode has atts
690 690
 
691
-		if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) {
691
+		if (count($shortcode['atts']) && $shortcode['atts']) {
692 692
 
693
-			foreach ( $shortcode['atts'] as $attr_name => $attr_info ) {
693
+			foreach ($shortcode['atts'] as $attr_name => $attr_info) {
694 694
 
695 695
 
696
-				$prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null;
696
+				$prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null;
697 697
 
698 698
 				$return .= '<form id="lasso--component-settings-form" class="'.$galleries.'" method="post">';
699 699
 				$return .= '<p data-option="'.$attr_name.'" class="lasso-option lasso-'.$slug.'-'.$attr_name.'">';
700
-				$return .= '<label for="lasso-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>';
700
+				$return .= '<label for="lasso-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>';
701 701
 				$return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>';
702 702
 				// Select
703 703
 
704
-				if ( isset( $attr_info['values'] ) ) {
704
+				if (isset($attr_info['values'])) {
705 705
 
706
-					$return .= '<select name="' . $attr_name . '" id="lasso-generator-attr-' . $attr_name . '" class="lasso-generator-attr">';
706
+					$return .= '<select name="'.$attr_name.'" id="lasso-generator-attr-'.$attr_name.'" class="lasso-generator-attr">';
707 707
 
708
-					$i=0;
708
+					$i = 0;
709 709
 
710
-					foreach ( $attr_info['values'] as $attr_value ) {
710
+					foreach ($attr_info['values'] as $attr_value) {
711 711
 						$attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : '';
712 712
 
713
-						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>';
713
+						$return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>';
714 714
 
715 715
 						$i++;
716 716
 					}
@@ -719,24 +719,24 @@  discard block
 block discarded – undo
719 719
 
720 720
 				} else {
721 721
 
722
-					$attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text';
722
+					$attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text';
723 723
 
724 724
 					// image upload
725
-					if ( 'media_upload' == $attr_info['type'] ) {
725
+					if ('media_upload' == $attr_info['type']) {
726 726
 
727
-						$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.'" />';
727
+						$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.'" />';
728 728
 						$return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>';
729 729
 
730
-					} elseif ( 'color' == $attr_info['type'] ) {
730
+					} elseif ('color' == $attr_info['type']) {
731 731
 
732
-						$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.'" />';
732
+						$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.'" />';
733 733
 
734
-					} elseif ( 'text_area' == $attr_info['type'] ) {
734
+					} elseif ('text_area' == $attr_info['type']) {
735 735
 
736
-						$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.'';
736
+						$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.'';
737 737
 
738 738
 					} else {
739
-						$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.'';
739
+						$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.'';
740 740
 					}
741 741
 				}
742 742
 				$return .= '</p>';
@@ -747,9 +747,9 @@  discard block
 block discarded – undo
747 747
 		///////////////////////////
748 748
 		// START GALLERY AND MAP FRONT END STUFFS
749 749
 		///////////////////////////
750
-		if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) {
750
+		if (isset($shortcode['front']) && true == $shortcode['front']) {
751 751
 
752
-			if ( 'gallery' == $shortcode['front_type'] ) {
752
+			if ('gallery' == $shortcode['front_type']) {
753 753
 
754 754
 				$return .= lasso_gallery_editor_module();
755 755
 
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
 		///////////////////////////
761 761
 
762 762
 		// Single shortcode (not closed)
763
-		if ( 'single' == $shortcode['type'] ) {
763
+		if ('single' == $shortcode['type']) {
764 764
 
765 765
 			$return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />';
766 766
 
767 767
 		} else {
768 768
 
769
-			$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>';
769
+			$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>';
770 770
 		}
771 771
 
772 772
 		$return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 				<div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div>
800 800
 				<div id="lasso--hide" style="display:none;" class="lasso--post-form">
801 801
 					<i class="lasso-icon lasso-icon-move"></i>
802
-					<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>
802
+					<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>
803 803
 					<div class="lasso--slider_wrap">
804 804
 						<div id="lasso--slider"></div>
805 805
 					</div>
Please login to merge, or discard this patch.
public/includes/helpers.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
  * @return the option value
13 13
  * @since 1.0
14 14
  */
15
-function lasso_editor_get_option( $option, $section, $default = '' ) {
15
+function lasso_editor_get_option($option, $section, $default = '') {
16 16
 
17
-	if ( empty( $option ) )
17
+	if (empty($option))
18 18
 		return;
19 19
 
20
-	if ( function_exists( 'is_multisite' ) && is_multisite() ) {
20
+	if (function_exists('is_multisite') && is_multisite()) {
21 21
 
22
-		$options = get_site_option( $section );
22
+		$options = get_site_option($section);
23 23
 
24 24
 	} else {
25 25
 
26
-		$options = get_option( $section );
26
+		$options = get_option($section);
27 27
 	}
28 28
 
29
-	if ( isset( $options[$option] ) ) {
29
+	if (isset($options[$option])) {
30 30
 		return $options[$option];
31 31
 	}
32 32
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
  */
41 41
 function lasso_editor_galleries_exist() {
42 42
 
43
-	$q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) );
43
+	$q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish'));
44 44
 
45
-	if ( $q->have_posts() )
45
+	if ($q->have_posts())
46 46
 		return true;
47 47
 	else
48 48
 		return false;
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 function lasso_get_supported_theme_class() {
58 58
 
59 59
 	$name  	= wp_get_theme()->get('Name');
60
-	$slug  	= lasso_clean_string( $name );
60
+	$slug  	= lasso_clean_string($name);
61 61
 
62
-	switch ( $slug ) {
62
+	switch ($slug) {
63 63
 		case 'aesop-story-theme': // aesop
64 64
 			$out = '.aesop-entry-content';
65 65
 			break;
@@ -108,16 +108,16 @@  discard block
 block discarded – undo
108 108
 
109 109
 	}
110 110
 
111
-	return apply_filters('lasso_content_class', !empty( $out ) ? $out : false);
111
+	return apply_filters('lasso_content_class', !empty($out) ? $out : false);
112 112
 	//return !empty( $out ) ? $out : false;
113 113
 }
114 114
 
115 115
 function lasso_get_supported_theme_title_class() {
116 116
 
117 117
 	$name  	= wp_get_theme()->get('Name');
118
-	$slug  	= lasso_clean_string( $name );
118
+	$slug  	= lasso_clean_string($name);
119 119
 
120
-	switch ( $slug ) {
120
+	switch ($slug) {
121 121
 
122 122
 		case 'aesop-story-theme': // aesop
123 123
 			$out = '.aesop-entry-title';
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
 			break;
146 146
 	}
147 147
 
148
-	return apply_filters('lasso_title_class', !empty( $out ) ? $out : false);
148
+	return apply_filters('lasso_title_class', !empty($out) ? $out : false);
149 149
 }
150 150
 
151 151
 //since 0.9.9.6
152 152
 function lasso_get_supported_theme_featured_image_class() {
153 153
 
154 154
 	$name  	= wp_get_theme()->get('Name');
155
-	$slug  	= lasso_clean_string( $name );
155
+	$slug  	= lasso_clean_string($name);
156 156
 
157
-	return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false);
157
+	return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false);
158 158
 }
159 159
 
160 160
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 *	@since 0.8.7
166 166
 *	@return string of comma separated classes
167 167
 */
168
-function lasso_supported_no_save(){
168
+function lasso_supported_no_save() {
169 169
 
170 170
 	return apply_filters('lasso_dont_save', '.lasso--ignore, .sharedaddy, .us_wrapper, .twitter-tweet, .meta, .edit-link, .ssba, .jp-relatedposts, .fb-comments');
171 171
 }
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
  *
180 180
  * @return array|mixed|object|string|void
181 181
  */
182
-function lasso_sanitize_data( $data ) {
183
-	return \lasso\sanatize::do_sanitize( $data );
182
+function lasso_sanitize_data($data) {
183
+	return \lasso\sanatize::do_sanitize($data);
184 184
 
185 185
 }
186 186
 
@@ -190,18 +190,18 @@  discard block
 block discarded – undo
190 190
  *	@since 0.9.3
191 191
  *	@return string of comma delimited category slugs
192 192
 */
193
-function lasso_get_post_objects( $postid = '', $taxonomy = 'category') {
193
+function lasso_get_post_objects($postid = '', $taxonomy = 'category') {
194 194
 
195
-	if ( empty( $postid ) )
195
+	if (empty($postid))
196 196
 		$postid = get_the_ID();
197 197
 
198
-	$objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid );
198
+	$objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid);
199 199
 
200
-	if ( empty( $objects) )
200
+	if (empty($objects))
201 201
 		return;
202 202
 
203 203
 	$out = '';
204
-	foreach( $objects as $object ) {
204
+	foreach ($objects as $object) {
205 205
 		//$out .= $object->slug.', ';
206 206
 		$out .= $object->name.', ';
207 207
 	}
@@ -216,15 +216,15 @@  discard block
 block discarded – undo
216 216
  *	@since 0.9.3
217 217
  *	@return array all categoiries
218 218
 */
219
-function lasso_get_objects( $taxonomy = 'category' ) {
219
+function lasso_get_objects($taxonomy = 'category') {
220 220
 
221 221
 	$objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0));
222 222
 
223
-	if ( empty( $objects) )
223
+	if (empty($objects))
224 224
 		return;
225 225
 
226 226
 	$out = array();
227
-	foreach( $objects as $object ) {
227
+	foreach ($objects as $object) {
228 228
 		$out[] = $object->slug;
229 229
 	}
230 230
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
  * @since 0.9.4
240 240
  */
241 241
 function lasso_post_types_names() {
242
-	$post_types = get_post_types( array(
242
+	$post_types = get_post_types(array(
243 243
 		'public' => true,
244
-	), 'objects' );
245
-	$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
246
-    unset( $post_types[ 'attachment' ] );
244
+	), 'objects');
245
+	$post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label'));
246
+    unset($post_types['attachment']);
247 247
 
248 248
 	/**
249 249
 	 * Set which post types are allowed
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
254 254
 	 */
255
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
256
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
257
-	foreach( $post_types as $name => $label ) {
258
-		if ( ! in_array( $name, $allowed_post_types ) ) {
259
-			unset( $post_types[ $name ] );
255
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
256
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
257
+	foreach ($post_types as $name => $label) {
258
+		if (!in_array($name, $allowed_post_types)) {
259
+			unset($post_types[$name]);
260 260
 		}
261 261
 	}
262 262
 	return $post_types;
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
 
265 265
 
266 266
 function lasso_post_types() {
267
-	$post_types = get_post_types( array(
267
+	$post_types = get_post_types(array(
268 268
 		'public' => true,
269
-	), 'names' );
269
+	), 'names');
270 270
 	//$post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) );
271
-    unset( $post_types[ 'attachment' ] );
271
+    unset($post_types['attachment']);
272 272
 
273 273
 	/**
274 274
 	 * Set which post types are allowed
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
 	 *
278 278
 	 * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered.
279 279
 	 */
280
-	$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') );
281
-	$allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
282
-	foreach( $post_types as $name => $label ) {
283
-		if ( ! in_array( $name, $allowed_post_types ) ) {
284
-			unset( $post_types[ $name ] );
280
+	$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post'));
281
+	$allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
282
+	foreach ($post_types as $name => $label) {
283
+		if (!in_array($name, $allowed_post_types)) {
284
+			unset($post_types[$name]);
285 285
 		}
286 286
 	}
287 287
 	return $post_types;
@@ -300,22 +300,22 @@  discard block
 block discarded – undo
300 300
 *	@uses lasso_modal_addons()
301 301
 *	@since 0.9.4
302 302
 */
303
-function lasso_modal_addons_content( $tab = '', $type ){
303
+function lasso_modal_addons_content($tab = '', $type) {
304 304
 
305
-	$name = lasso_clean_string( $tab['name'] );
305
+	$name = lasso_clean_string($tab['name']);
306 306
 
307
-	if ( 'tab' == $type ) {
307
+	if ('tab' == $type) {
308 308
 
309
-		$out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] );
309
+		$out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']);
310 310
 
311
-	} else if ( 'content' == $type ){
311
+	} else if ('content' == $type) {
312 312
 
313
-		$content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false;
314
-		$options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false;
313
+		$content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false;
314
+		$options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false;
315 315
 
316
-		$out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s">
316
+		$out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s">
317 317
 			%s%s
318
-			</div>', $name, $content, lasso_option_form( $name, $options ) );
318
+			</div>', $name, $content, lasso_option_form($name, $options));
319 319
 
320 320
 	}
321 321
 
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
 *
331 331
 * @return void|string
332 332
 */
333
-function lasso_clean_string( $string = '' ) {
333
+function lasso_clean_string($string = '') {
334 334
 
335
-	if ( empty( $string ) )
335
+	if (empty($string))
336 336
 		return;
337 337
 
338
-	return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) );
338
+	return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string)));
339 339
 }
340 340
 
341 341
 /**
@@ -348,13 +348,13 @@  discard block
 block discarded – undo
348 348
  *
349 349
  * @return void|string
350 350
  */
351
-function lasso_unclean_string( $string = '' ) {
351
+function lasso_unclean_string($string = '') {
352 352
 
353
-	if ( empty( $string ) ) {
353
+	if (empty($string)) {
354 354
 		return;
355 355
 	}
356 356
 
357
-	return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) );
357
+	return sanitize_text_field(strtolower(str_replace('-', '_', $string)));
358 358
 }
359 359
 
360 360
 
@@ -369,37 +369,37 @@  discard block
 block discarded – undo
369 369
  * @param unknown $postid int the id of the post object to check against
370 370
  * @since 0.9.9.7 added filter 'lasso_user_can_filter'
371 371
  */
372
-if ( !function_exists( 'lasso_user_can' ) ):
373
-	function lasso_user_can( $action = '', $postid = 0 ) {
372
+if (!function_exists('lasso_user_can')):
373
+	function lasso_user_can($action = '', $postid = 0) {
374 374
         $result = false;
375
-		if ( empty( $action ) )
375
+		if (empty($action))
376 376
 			$action = 'edit_posts';
377 377
 
378
-		if ( empty( $postid ) )
378
+		if (empty($postid))
379 379
 			$postid = get_the_ID();
380 380
 
381
-		if ( is_user_logged_in() && current_user_can( $action, $postid ) ) {
381
+		if (is_user_logged_in() && current_user_can($action, $postid)) {
382 382
 			// check against post types:
383
-			$allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') );
383
+			$allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page'));
384 384
 			
385 385
 			
386 386
 			
387 387
             if (!empty($allowed_post_types) && !empty($postid)) {
388
-				$type = get_post_type( $postid );
389
-                $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types );
388
+				$type = get_post_type($postid);
389
+                $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types);
390 390
 				
391
-                if ( in_array( $type, $allowed_post_types ) ) {
392
-				   $result =  true;
391
+                if (in_array($type, $allowed_post_types)) {
392
+				   $result = true;
393 393
 			    }
394 394
             } else {
395 395
                 //we are not checking against a post, return true
396
-				$result =  true;
396
+				$result = true;
397 397
         	}
398 398
 		} else {
399 399
 			$result = false;
400 400
 		}
401 401
 		
402
-		return apply_filters( 'lasso_user_can_filter', $result,  $action, $postid);
402
+		return apply_filters('lasso_user_can_filter', $result, $action, $postid);
403 403
 	}
404 404
 endif;
405 405
 
@@ -408,25 +408,25 @@  discard block
 block discarded – undo
408 408
 *
409 409
 *	@since 0.9.5
410 410
 */
411
-if ( !function_exists('lasso_editor_empty_results') ):
411
+if (!function_exists('lasso_editor_empty_results')):
412 412
 
413
-	function lasso_editor_empty_results( $type = 'posts' ){
413
+	function lasso_editor_empty_results($type = 'posts') {
414 414
 
415
-		if ( 'posts' == $type ) {
415
+		if ('posts' == $type) {
416 416
 
417
-			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') );
417
+			$string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso'));
418 418
 			$icon = 'lasso-icon-file-text2';
419 419
 			$button = false;
420 420
 
421
-		} elseif ( 'revision' == $type ) {
421
+		} elseif ('revision' == $type) {
422 422
 
423
-			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') );
423
+			$string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso'));
424 424
 			$icon = 'lasso-icon-history';
425
-			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') );
425
+			$button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso'));
426 426
 
427 427
 		}
428 428
 
429
-		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 );
429
+		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);
430 430
 	}
431 431
 
432 432
 endif;
Please login to merge, or discard this patch.