@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * Get an array of addon data for the settings modal |
44 | 44 | * @since 0.9.4 |
45 | 45 | */ |
46 | -function lasso_get_modal_tabs(){ |
|
46 | +function lasso_get_modal_tabs() { |
|
47 | 47 | |
48 | 48 | $tabs = array(); |
49 | 49 | |
@@ -60,34 +60,34 @@ discard block |
||
60 | 60 | * @uses lasso_modal_addons_content() |
61 | 61 | * @since 0.9.4 |
62 | 62 | */ |
63 | -function lasso_modal_addons( $type = 'tab' ){ |
|
63 | +function lasso_modal_addons($type = 'tab') { |
|
64 | 64 | |
65 | 65 | $tabs = lasso_get_modal_tabs(); |
66 | 66 | $out = ''; |
67 | 67 | |
68 | - if ( $tabs ): |
|
68 | + if ($tabs): |
|
69 | 69 | |
70 | - if ( 'tab' == $type ) { |
|
70 | + if ('tab' == $type) { |
|
71 | 71 | |
72 | 72 | $out = '<ul class="lasso--modal__tabs">'; |
73 | 73 | |
74 | 74 | $out .= '<li class="active-tab" data-addon-name="core">Editus</li>'; |
75 | 75 | |
76 | - foreach ( $tabs as $tab ) { |
|
76 | + foreach ($tabs as $tab) { |
|
77 | 77 | |
78 | - if ( isset( $tab ) ) { |
|
78 | + if (isset($tab)) { |
|
79 | 79 | |
80 | - $out .= lasso_modal_addons_content( $tab, $type ); |
|
80 | + $out .= lasso_modal_addons_content($tab, $type); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | $out .= '</ul>'; |
85 | 85 | |
86 | - } elseif ( 'content' == $type ) { |
|
87 | - foreach ( $tabs as $tab ) { |
|
86 | + } elseif ('content' == $type) { |
|
87 | + foreach ($tabs as $tab) { |
|
88 | 88 | |
89 | - if ( isset( $tab ) ) { |
|
90 | - $out .= lasso_modal_addons_content( $tab , $type ); |
|
89 | + if (isset($tab)) { |
|
90 | + $out .= lasso_modal_addons_content($tab, $type); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | endif; |
97 | 97 | |
98 | - return !empty( $out ) ? $out : false; |
|
98 | + return !empty($out) ? $out : false; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -115,26 +115,26 @@ discard block |
||
115 | 115 | * @since 0.9.5 |
116 | 116 | * @subpackage lasso_modal_addons_content |
117 | 117 | */ |
118 | -function lasso_option_form( $name = '', $options = array() ){ |
|
118 | +function lasso_option_form($name = '', $options = array()) { |
|
119 | 119 | |
120 | 120 | ob_start(); |
121 | 121 | |
122 | - if ( empty( $name ) || empty( $options ) || !is_array( $options ) ) |
|
122 | + if (empty($name) || empty($options) || !is_array($options)) |
|
123 | 123 | return; |
124 | 124 | |
125 | 125 | $nonce = wp_create_nonce('lasso-process-post-meta'); |
126 | - $key = sprintf('_lasso_%s_settings', $name ); |
|
126 | + $key = sprintf('_lasso_%s_settings', $name); |
|
127 | 127 | |
128 | - $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">' ); |
|
128 | + $out = sprintf('<form id="lasso--custom-field-form" class="lasso--post-form">'); |
|
129 | 129 | |
130 | - $out .= lasso_option_fields( $name, $options ); |
|
131 | - $out .='<div class="form--bottom">'; |
|
132 | - $out .='<input type="submit" value="'.__( 'Save', 'lasso' ).'">'; |
|
133 | - $out .='<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | - $out .='<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | - $out .='<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | - $out .='<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | - $out .='</div>'; |
|
130 | + $out .= lasso_option_fields($name, $options); |
|
131 | + $out .= '<div class="form--bottom">'; |
|
132 | + $out .= '<input type="submit" value="'.__('Save', 'lasso').'">'; |
|
133 | + $out .= '<input type="hidden" name="tab_name" value="'.$key.'">'; |
|
134 | + $out .= '<input type="hidden" name="post_id" value="'.get_the_ID().'">'; |
|
135 | + $out .= '<input type="hidden" name="nonce" value="'.$nonce.'">'; |
|
136 | + $out .= '<input type="hidden" name="action" value="process_meta_update">'; |
|
137 | + $out .= '</div>'; |
|
138 | 138 | |
139 | 139 | $out .= '</form>'; |
140 | 140 | |
@@ -192,20 +192,20 @@ discard block |
||
192 | 192 | * @since 0.9.5 |
193 | 193 | * @subpackage lasso_modal_addons_content |
194 | 194 | */ |
195 | -function lasso_option_fields( $name = '', $options = array() ){ |
|
195 | +function lasso_option_fields($name = '', $options = array()) { |
|
196 | 196 | |
197 | - $out = ''; |
|
197 | + $out = ''; |
|
198 | 198 | $before = '<div class="lasso--postsettings__option">'; |
199 | 199 | $after = '</div>'; |
200 | 200 | |
201 | - if ( empty( $name ) || empty( $options ) ) |
|
201 | + if (empty($name) || empty($options)) |
|
202 | 202 | return; |
203 | 203 | |
204 | - foreach ( (array) $options as $option ) { |
|
204 | + foreach ((array) $options as $option) { |
|
205 | 205 | |
206 | - $type = isset( $option['type'] ) ? $option['type'] : 'text'; |
|
206 | + $type = isset($option['type']) ? $option['type'] : 'text'; |
|
207 | 207 | |
208 | - $out .= sprintf('%s%s%s', $before, lasso_option_engine_option( $name, $option,$type ), $after ); |
|
208 | + $out .= sprintf('%s%s%s', $before, lasso_option_engine_option($name, $option, $type), $after); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | |
@@ -223,44 +223,44 @@ discard block |
||
223 | 223 | * @param $type string text, textarea, checkbox, color |
224 | 224 | * @since 5.0 |
225 | 225 | */ |
226 | -function lasso_option_engine_option( $name = '', $option = '', $type = '') { |
|
226 | +function lasso_option_engine_option($name = '', $option = '', $type = '') { |
|
227 | 227 | |
228 | - if ( empty( $type ) || empty( $option ) ) |
|
228 | + if (empty($type) || empty($option)) |
|
229 | 229 | return; |
230 | 230 | |
231 | - $id = isset( $option['id'] ) ? $option['id'] : false; |
|
231 | + $id = isset($option['id']) ? $option['id'] : false; |
|
232 | 232 | //$id = $id ? lasso_clean_string( $id ) : false; |
233 | 233 | |
234 | - $desc = isset( $option['desc'] ) ? $option['desc'] : false; |
|
234 | + $desc = isset($option['desc']) ? $option['desc'] : false; |
|
235 | 235 | |
236 | - $value = get_post_meta( get_the_id(), $option[ 'id' ], true ); |
|
236 | + $value = get_post_meta(get_the_id(), $option['id'], true); |
|
237 | 237 | |
238 | - switch ( $type ) { |
|
238 | + switch ($type) { |
|
239 | 239 | case 'text': |
240 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">',$id, esc_html( $desc ), $id, $id, $value ); |
|
240 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s">', $id, esc_html($desc), $id, $id, $value); |
|
241 | 241 | break; |
242 | 242 | case 'textarea': |
243 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>',$id, esc_html( $desc ), $id, $id, $value ); |
|
243 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><textarea id="lasso--post-option-%s" name="%s">%s</textarea>', $id, esc_html($desc), $id, $id, $value); |
|
244 | 244 | break; |
245 | 245 | case 'imgurl': |
246 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>',$id, esc_html( $desc ), $value, $id, $id, $value ); |
|
246 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><img src="%s" style="height:80px;"><input id="lasso--post-option-%s" class="editus-custom-field-text" name="%s" type="text" value="%s" style="display:none;"><div title="Replace Image" class="editus-customtab-image-control" style="float:left;"><i class="lasso-icon-image" style="font-size:20px;padding:5px;"></i></div><div title="Remove Image" class="editus-customtab-image-remove" style="float:left;"><i class="lasso-icon-bin2" style="font-size:20px;padding:5px;"></i></div>', $id, esc_html($desc), $value, $id, $id, $value); |
|
247 | 247 | break; |
248 | 248 | case 'checkbox': |
249 | - $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s',$id, $id, $id ,esc_html( $desc ) ); |
|
249 | + $out = sprintf('<label for="lasso--post-option-%s" class="checkbox-control checkbox"><input id="lasso--post-option-%s" type="checkbox" name="%s" class="checkbox"><span class="control-indicator"></span>%s', $id, $id, $id, esc_html($desc)); |
|
250 | 250 | break; |
251 | 251 | case 'dropdown': |
252 | - $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">',$id, esc_html( $desc ), $id, $id); |
|
252 | + $out = sprintf('<label for="lasso--post-option-%s">%s</label><select id="lasso--post-option-%s" name="%s">', $id, esc_html($desc), $id, $id); |
|
253 | 253 | $options = explode(";", $option['options']); |
254 | 254 | foreach ($options as &$opt) { |
255 | 255 | $opts = explode(":", $opt); |
256 | 256 | if ($opts[0] == $value) { |
257 | - $out .= sprintf('<option value = "%s" selected>%s</option>',$opts[0], $opts[1]); |
|
257 | + $out .= sprintf('<option value = "%s" selected>%s</option>', $opts[0], $opts[1]); |
|
258 | 258 | } else { |
259 | - $out .= sprintf('<option value = "%s">%s</option>',$opts[0], $opts[1]); |
|
259 | + $out .= sprintf('<option value = "%s">%s</option>', $opts[0], $opts[1]); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - $out .='</select>'; |
|
263 | + $out .= '</select>'; |
|
264 | 264 | break; |
265 | 265 | } |
266 | 266 |
@@ -10,30 +10,30 @@ discard block |
||
10 | 10 | |
11 | 11 | function __construct() { |
12 | 12 | |
13 | - add_action( 'admin_init', array( $this, 'redirect' ) ); |
|
14 | - add_action( 'admin_menu', array( $this, 'lasso_welcome' ) ); |
|
15 | - add_action( 'network_admin_menu', array( $this, 'lasso_welcome' ) ); // CHANGED Added hook. |
|
13 | + add_action('admin_init', array($this, 'redirect')); |
|
14 | + add_action('admin_menu', array($this, 'lasso_welcome')); |
|
15 | + add_action('network_admin_menu', array($this, 'lasso_welcome')); // CHANGED Added hook. |
|
16 | 16 | |
17 | - add_action( 'tgmpa_register', array( $this,'required_plugins' )); |
|
17 | + add_action('tgmpa_register', array($this, 'required_plugins')); |
|
18 | 18 | |
19 | 19 | } |
20 | 20 | |
21 | 21 | function redirect() { |
22 | 22 | |
23 | 23 | // Bail if no activation redirect |
24 | - if ( !get_transient( '_lasso_welcome_redirect' ) ) { |
|
24 | + if (!get_transient('_lasso_welcome_redirect')) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Delete the redirect transient |
29 | - delete_transient( '_lasso_welcome_redirect' ); |
|
29 | + delete_transient('_lasso_welcome_redirect'); |
|
30 | 30 | |
31 | 31 | // Bail if activating from network, or bulk |
32 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
32 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) ); |
|
36 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php')))); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | function lasso_welcome() { |
46 | 46 | |
47 | 47 | // CHANGED Removed condition. |
48 | - add_menu_page( __( 'Editus', 'lasso' ), __( 'Editus', 'lasso' ), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png' ); |
|
49 | - add_submenu_page( 'lasso-editor', __( 'Welcome', 'lasso' ), __( 'Status', 'lasso' ), 'manage_options', 'lasso-editor', array( $this, 'welcome' ) ); |
|
48 | + add_menu_page(__('Editus', 'lasso'), __('Editus', 'lasso'), 'manage_options', 'lasso-editor', '', LASSO_URL.'/admin/assets/img/menu-icon.png'); |
|
49 | + add_submenu_page('lasso-editor', __('Welcome', 'lasso'), __('Status', 'lasso'), 'manage_options', 'lasso-editor', array($this, 'welcome')); |
|
50 | 50 | |
51 | 51 | } |
52 | 52 | |
@@ -60,24 +60,24 @@ discard block |
||
60 | 60 | ?> |
61 | 61 | <div class="wrap lasso--welcome"> |
62 | 62 | |
63 | - <?php self::header();?> |
|
63 | + <?php self::header(); ?> |
|
64 | 64 | |
65 | 65 | <ul class="lasso--welcome__steps"> |
66 | 66 | |
67 | 67 | <?php // CHANGED Added the is_network_admin condition. ?> |
68 | - <?php if ( is_network_admin() ) : ?> |
|
68 | + <?php if (is_network_admin()) : ?> |
|
69 | 69 | |
70 | 70 | <li> |
71 | - <p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p> |
|
71 | + <p><?php _e('We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso'); ?></p> |
|
72 | 72 | </li> |
73 | 73 | |
74 | 74 | <?php else : |
75 | 75 | |
76 | 76 | $checks = self::lasso_preflight_check(); |
77 | 77 | |
78 | - if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
|
78 | + if ($checks && !defined('LASSO_AGENCY_MODE')): |
|
79 | 79 | |
80 | - foreach ( (array) $checks as $key => $check ) { |
|
80 | + foreach ((array) $checks as $key => $check) { |
|
81 | 81 | |
82 | 82 | echo $check; |
83 | 83 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | // pre-flight is go for flight |
88 | 88 | ?> |
89 | 89 | <li class="success"> |
90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
91 | - <?php if ( lasso_get_supported_theme_class() ) { ?> |
|
92 | - <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
|
90 | + <h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3> |
|
91 | + <?php if (lasso_get_supported_theme_class()) { ?> |
|
92 | + <p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p> |
|
93 | 93 | <?php } ?> |
94 | - <p><?php _e( 'Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso' );?></p> |
|
94 | + <p><?php _e('Editus will place a small menu on the bottom of your site. While on a single post or page, click the "pen" icon to go into edit mode. Press escape to get out of edit mode.', 'lasso'); ?></p> |
|
95 | 95 | </li> |
96 | 96 | <?php |
97 | 97 | endif; |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | |
114 | 114 | <div class="lasso--welcome__top"> |
115 | 115 | |
116 | - <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>"> |
|
117 | - <h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1> |
|
118 | - <p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p> |
|
116 | + <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>"> |
|
117 | + <h1><?php _e('Welcome to Editus', 'lasso'); ?></h1> |
|
118 | + <p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p> |
|
119 | 119 | |
120 | - <?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?> |
|
120 | + <?php if (!defined('LASSO_AGENCY_MODE')): ?> |
|
121 | 121 | |
122 | 122 | <ul class="lasso--welcome__social"> |
123 | - <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li> |
|
124 | - <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li> |
|
125 | - <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li> |
|
123 | + <li><a href="https://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li> |
|
124 | + <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li> |
|
125 | + <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li> |
|
126 | 126 | </ul> |
127 | 127 | |
128 | 128 | <?php endif; ?> |
@@ -139,68 +139,68 @@ discard block |
||
139 | 139 | */ |
140 | 140 | function lasso_preflight_check() { |
141 | 141 | |
142 | - $notices = array(); |
|
142 | + $notices = array(); |
|
143 | 143 | |
144 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
144 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
145 | 145 | |
146 | - $theme_name = wp_get_theme()->get('Name'); |
|
147 | - $theme_class = lasso_get_supported_theme_class(); |
|
146 | + $theme_name = wp_get_theme()->get('Name'); |
|
147 | + $theme_class = lasso_get_supported_theme_class(); |
|
148 | 148 | |
149 | - $license = get_option( 'lasso_license_key' ); |
|
150 | - $status = get_option( 'lasso_license_status' ); |
|
149 | + $license = get_option('lasso_license_key'); |
|
150 | + $status = get_option('lasso_license_status'); |
|
151 | 151 | |
152 | 152 | // Gutenberg Not Supported |
153 | - if( function_exists( 'is_gutenberg_page' ) || function_exists( 'use_block_editor_for_post') ) { |
|
153 | + if (function_exists('is_gutenberg_page') || function_exists('use_block_editor_for_post')) { |
|
154 | 154 | $notices[] = '<li class="info"><h3>Gutenberg Not Supported.</h3> |
155 | - <p>'.__( 'Currently Editus does not support Gutenberg. It will be disabled on Gutenberg enabled posts.', 'lasso' ).'</p> |
|
155 | + <p>'.__('Currently Editus does not support Gutenberg. It will be disabled on Gutenberg enabled posts.', 'lasso').'</p> |
|
156 | 156 | </li>'; |
157 | 157 | } |
158 | 158 | |
159 | 159 | // if the required CSS class has not been saved and we're not a supported theme |
160 | - if ( empty( $article_object ) && false == $theme_class ) { |
|
160 | + if (empty($article_object) && false == $theme_class) { |
|
161 | 161 | |
162 | 162 | // we dont automatically support this theme so show them otherwise |
163 | 163 | $notices[] = sprintf('<li class="error"> |
164 | - <h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3> |
|
165 | - <p>'.__( 'Before using Editus,', 'lasso' ).' <a href="%s">'.__( 'enter and save', 'lasso' ).'</a> '.__( 'the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso' ).' <a href="mailto:[email protected]">'.__( 'email us.', 'lasso' ).'</a> '.__( 'with a link to a public URL with the theme and we\'ll find it for you.', 'lasso' ).'</p> |
|
166 | - </li>', admin_url( 'admin.php?page=lasso-editor-settings' ) ); |
|
164 | + <h3>'.__('Article CSS Class Needed!', 'lasso').'</h3> |
|
165 | + <p>'.__('Before using Editus,', 'lasso').' <a href="%s">'.__('enter and save', 'lasso').'</a> '.__('the CSS class of the container that holds your post and page content. You can <a href="https://dl.dropboxusercontent.com/u/5594632/lasso-media/doc-movies/using-inspector-lasso.gif" target="_blank">use a tool like inspector</a> in Chrome or Firefox to find this CSS class, or ', 'lasso').' <a href="mailto:[email protected]">'.__('email us.', 'lasso').'</a> '.__('with a link to a public URL with the theme and we\'ll find it for you.', 'lasso').'</p> |
|
166 | + </li>', admin_url('admin.php?page=lasso-editor-settings')); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | // WP REST API not active |
170 | - if ( !function_exists( 'json_get_url_prefix' ) && !function_exists( 'rest_url' )) { |
|
170 | + if (!function_exists('json_get_url_prefix') && !function_exists('rest_url')) { |
|
171 | 171 | $notices[] = '<li class="info"><h3>WP REST API not Activated!</h3> |
172 | - <p>'.__( 'Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso' ).'</p> |
|
172 | + <p>'.__('Just a heads up that the WP REST API isn\'t activated. This is required to list the posts and pages on the front-end.', 'lasso').'</p> |
|
173 | 173 | </li>'; |
174 | 174 | } |
175 | 175 | |
176 | 176 | // aesop story engine isnt active |
177 | - if ( !class_exists( 'Aesop_Core' ) ) { |
|
178 | - $notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
179 | - <p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank |
|
180 | - ">'.__( 'Aesop Story Engine', 'lasso' ).'</a> '.__( 'isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso' ).'</p> |
|
181 | - </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') ); |
|
177 | + if (!class_exists('Aesop_Core')) { |
|
178 | + $notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
179 | + <p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank |
|
180 | + ">'.__('Aesop Story Engine', 'lasso').'</a> '.__('isn\'t activated. It\'s not required to use Editus, but you won\'t get the cool drag and drop components without it activated. It\'s free!', 'lasso').'</p> |
|
181 | + </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine')); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | // we dont really get along with wp side comments because of the section ids that get applied dynamically. since we save our html, it'll get saved along with the post as HTML |
185 | - if ( class_exists( 'WP_Side_Comments' ) ) { |
|
186 | - $notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3> |
|
187 | - <p>'.__( 'Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso' ).'</p> |
|
185 | + if (class_exists('WP_Side_Comments')) { |
|
186 | + $notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3> |
|
187 | + <p>'.__('Since Editus saves the HTML of a post, this may cause undesired issues. We\'re working to resolve incompatibilities faster than a jack rabbit in a hot greasy griddle in the middle of August.', 'lasso').'</p> |
|
188 | 188 | </li>'; |
189 | 189 | } |
190 | 190 | |
191 | 191 | // if the license key isnt activated |
192 | - if ( empty( $license ) ) { |
|
193 | - $notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3> |
|
194 | - <p>'.__( 'Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso' ).'</p> |
|
192 | + if (empty($license)) { |
|
193 | + $notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3> |
|
194 | + <p>'.__('Just a heads up, your license key isn\'t activated. Enter your license key into the License tab on the left in order to receive plugin update notifications.', 'lasso').'</p> |
|
195 | 195 | </li>'; |
196 | 196 | } |
197 | - if ( !empty( $license ) && 'invalid' == $status ) { |
|
198 | - $notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3> |
|
199 | - <p>'.__( 'The license key that you entered is ', 'lasso' ).'<strong>'.__( 'invalid', 'lasso' ).'</strong>'.__( '. It may have been entered incorreclty, or may have expired.', 'lasso' ).'</p> |
|
197 | + if (!empty($license) && 'invalid' == $status) { |
|
198 | + $notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3> |
|
199 | + <p>'.__('The license key that you entered is ', 'lasso').'<strong>'.__('invalid', 'lasso').'</strong>'.__('. It may have been entered incorreclty, or may have expired.', 'lasso').'</p> |
|
200 | 200 | </li>'; |
201 | 201 | } |
202 | 202 | |
203 | - return apply_filters( 'lasso_preflight_notices', $notices ); |
|
203 | + return apply_filters('lasso_preflight_notices', $notices); |
|
204 | 204 | |
205 | 205 | } |
206 | 206 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $plugins = array( |
215 | 215 | |
216 | 216 | array( |
217 | - 'name' => __('Aesop Story Engine','lasso'), |
|
217 | + 'name' => __('Aesop Story Engine', 'lasso'), |
|
218 | 218 | 'slug' => 'aesop-story-engine', |
219 | 219 | 'required' => false, |
220 | 220 | ), |
@@ -222,38 +222,38 @@ discard block |
||
222 | 222 | ); |
223 | 223 | |
224 | 224 | $config = array( |
225 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
225 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
226 | 226 | 'menu' => 'lasso-install-plugins', // Menu slug. |
227 | - 'has_notices' => true, // Show admin notices or not. |
|
228 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
229 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
230 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
231 | - 'message' => '', // Message to output right before the plugins table. |
|
227 | + 'has_notices' => true, // Show admin notices or not. |
|
228 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
229 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
230 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
231 | + 'message' => '', // Message to output right before the plugins table. |
|
232 | 232 | 'strings' => array( |
233 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
234 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
235 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
236 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
237 | - 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
238 | - 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
239 | - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
240 | - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
241 | - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
242 | - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
243 | - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
244 | - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
245 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
246 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
247 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
248 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
249 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
233 | + 'page_title' => __('Install Required Plugins', 'lasso'), |
|
234 | + 'menu_title' => __('Install Plugins', 'lasso'), |
|
235 | + 'installing' => __('Installing Plugin: %s', 'lasso'), // %s = plugin name. |
|
236 | + 'oops' => __('Something went wrong with the plugin API.', 'lasso'), |
|
237 | + 'notice_can_install_required' => _n_noop('This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
238 | + 'notice_can_install_recommended' => _n_noop('This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.'), // %1$s = plugin name(s). |
|
239 | + 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.'), // %1$s = plugin name(s). |
|
240 | + 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
241 | + 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.'), // %1$s = plugin name(s). |
|
242 | + 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.'), // %1$s = plugin name(s). |
|
243 | + 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.'), // %1$s = plugin name(s). |
|
244 | + 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.'), // %1$s = plugin name(s). |
|
245 | + 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), |
|
246 | + 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins'), |
|
247 | + 'return' => __('Return to Required Plugins Installer', 'lasso'), |
|
248 | + 'plugin_activated' => __('Plugin activated successfully.', 'lasso'), |
|
249 | + 'complete' => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link. |
|
250 | 250 | 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
251 | 251 | ) |
252 | 252 | ); |
253 | 253 | |
254 | - $plugins = apply_filters( 'lasso_required_plugins', $plugins ); |
|
254 | + $plugins = apply_filters('lasso_required_plugins', $plugins); |
|
255 | 255 | |
256 | - tgmpa( $plugins, $config ); |
|
256 | + tgmpa($plugins, $config); |
|
257 | 257 | |
258 | 258 | } |
259 | 259 | } |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,21 +40,21 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | 44 | |
45 | - file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data,true)); |
|
45 | + file_put_contents(WP_PLUGIN_DIR."/file1.txt", print_r($data, true)); |
|
46 | 46 | |
47 | - if ( ! empty( $allowed_fields ) ) { |
|
48 | - foreach( $allowed_fields as $field ) { |
|
49 | - if ( isset( $data[ $field ] ) ) { |
|
47 | + if (!empty($allowed_fields)) { |
|
48 | + foreach ($allowed_fields as $field) { |
|
49 | + if (isset($data[$field])) { |
|
50 | 50 | //this original line changed dash to underscore |
51 | 51 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
52 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
52 | + update_post_meta($post_id, $field, $data[$field]); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | - do_action( 'editus_after_meta_update', $post_id, $data ); |
|
57 | + do_action('editus_after_meta_update', $post_id, $data); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | return true; |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return array Array of keys to pull from $data per action and their sanitization callback |
70 | 70 | */ |
71 | - public static function params(){ |
|
72 | - $params[ 'process_meta_update' ] = array( |
|
71 | + public static function params() { |
|
72 | + $params['process_meta_update'] = array( |
|
73 | 73 | 'post_id' => 'absint', |
74 | 74 | 'tab_name' => 'trim' |
75 | 75 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @return array Array of additional functions to use to authorize action. |
87 | 87 | */ |
88 | 88 | public static function auth_callbacks() { |
89 | - $params[ 'process_meta_update' ] = array( |
|
89 | + $params['process_meta_update'] = array( |
|
90 | 90 | 'lasso_user_can' |
91 | 91 | ); |
92 | 92 |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function save( $data ) { |
|
31 | + public function save($data) { |
|
32 | 32 | |
33 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
34 | - $locations = isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false; |
|
35 | - $start_point = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false; |
|
36 | - $zoom = isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false; |
|
33 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
34 | + $locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false; |
|
35 | + $start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false; |
|
36 | + $zoom = isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false; |
|
37 | 37 | |
38 | - if ( is_array( $locations ) ) { |
|
39 | - delete_post_meta( $postid, 'ase_map_component_locations' ); |
|
38 | + if (is_array($locations)) { |
|
39 | + delete_post_meta($postid, 'ase_map_component_locations'); |
|
40 | 40 | |
41 | 41 | // update locations if set |
42 | - foreach ( $locations as $location ) { |
|
43 | - $point = json_decode( urldecode( $location ), true ); |
|
44 | - add_post_meta( $postid, 'ase_map_component_locations', $point ); |
|
42 | + foreach ($locations as $location) { |
|
43 | + $point = json_decode(urldecode($location), true); |
|
44 | + add_post_meta($postid, 'ase_map_component_locations', $point); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // udpate start point |
48 | - $point = json_decode( $start_point, true ); |
|
49 | - update_post_meta( $postid, 'ase_map_component_start_point', $point ); |
|
48 | + $point = json_decode($start_point, true); |
|
49 | + update_post_meta($postid, 'ase_map_component_start_point', $point); |
|
50 | 50 | |
51 | 51 | // update zoom |
52 | - update_post_meta( $postid, 'ase_map_component_zoom', $zoom ); |
|
52 | + update_post_meta($postid, 'ase_map_component_zoom', $zoom); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return true; |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
65 | 65 | */ |
66 | - public static function params(){ |
|
67 | - $params[ 'process_map_save' ] = array( |
|
66 | + public static function params() { |
|
67 | + $params['process_map_save'] = array( |
|
68 | 68 | 'postid' => 'absint', |
69 | 69 | 'ase-map-component-locations' => 'lasso_sanitize_data', |
70 | 70 | 'ase-map-component-start-point' => array( |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return array Array of additional functions to use to authorize action. |
89 | 89 | */ |
90 | 90 | public static function auth_callbacks() { |
91 | - $params[ 'process_map_save' ] = array( |
|
91 | + $params['process_map_save'] = array( |
|
92 | 92 | 'lasso_user_can' |
93 | 93 | ); |
94 | 94 |
@@ -11,39 +11,39 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @since 1.0 |
13 | 13 | */ |
14 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
14 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
15 | 15 | function lasso_editor_controls() { |
16 | 16 | |
17 | 17 | global $post; |
18 | 18 | |
19 | - if ( lasso_user_can('edit_posts') ) { |
|
19 | + if (lasso_user_can('edit_posts')) { |
|
20 | 20 | |
21 | - $status = get_post_status( get_the_ID() ); |
|
22 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
23 | - $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff'); |
|
24 | - $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000'); |
|
25 | - $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055'); |
|
26 | - $text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff'); |
|
21 | + $status = get_post_status(get_the_ID()); |
|
22 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
23 | + $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff'); |
|
24 | + $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000'); |
|
25 | + $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055'); |
|
26 | + $text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff'); |
|
27 | 27 | $hover_color1 = lasso_editor_adjustBrightness($button_color1, 50); |
28 | 28 | $hover_color2 = lasso_editor_adjustBrightness($button_color2, 50); |
29 | 29 | |
30 | 30 | // let users add custom css classes |
31 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
31 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
32 | 32 | |
33 | 33 | $post_access_class = ''; |
34 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
35 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
36 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
34 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
35 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
36 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // CSS class if adding new post objects is disabled |
40 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
40 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
41 | 41 | |
42 | 42 | // CSS class if adjust settings is disabled |
43 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
43 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
44 | 44 | |
45 | 45 | // CSS class if adding new post objects AND settings are disabled |
46 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
46 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
47 | 47 | |
48 | 48 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
49 | 49 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ?> |
58 | 58 | <style> |
59 | 59 | #lasso-html--table:before { |
60 | - content: "<?php esc_attr_e( 'Table', 'lasso' );?>"; |
|
60 | + content: "<?php esc_attr_e('Table', 'lasso'); ?>"; |
|
61 | 61 | } |
62 | 62 | </style> |
63 | 63 | |
@@ -68,31 +68,31 @@ discard block |
||
68 | 68 | <style> |
69 | 69 | |
70 | 70 | .lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish { |
71 | - background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
72 | - background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
73 | - background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
74 | - color: <?php echo $text_color;?>; |
|
71 | + background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
72 | + background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
73 | + background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
74 | + color: <?php echo $text_color; ?>; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | .lasso--controls__right a:before, #lasso-toolbar--html__footer_desc { |
78 | - color: <?php echo $text_color;?> !important; |
|
78 | + color: <?php echo $text_color; ?> !important; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | 82 | |
83 | 83 | ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover { |
84 | - background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
85 | - background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
86 | - background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
84 | + background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
85 | + background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
86 | + background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | .lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap, |
90 | 90 | #lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap { |
91 | - background: <?php echo $dialog_color;?>; |
|
92 | - color: <?php echo $text_color;?>; |
|
91 | + background: <?php echo $dialog_color; ?>; |
|
92 | + color: <?php echo $text_color; ?>; |
|
93 | 93 | } |
94 | 94 | .sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label { |
95 | - color: <?php echo $text_color;?> !important; |
|
95 | + color: <?php echo $text_color; ?> !important; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | <?php if (!$is_mobile) { ?> |
@@ -122,48 +122,48 @@ discard block |
||
122 | 122 | <?php |
123 | 123 | } |
124 | 124 | ?> |
125 | - <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" > |
|
125 | + <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" > |
|
126 | 126 | |
127 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
127 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
128 | 128 | |
129 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
129 | + <?php do_action('lasso_editor_controls_before'); |
|
130 | 130 | |
131 | - if ( $is_capable ) { ?> |
|
131 | + if ($is_capable) { ?> |
|
132 | 132 | |
133 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
133 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
134 | 134 | |
135 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
136 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
135 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
136 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
137 | 137 | <?php } |
138 | 138 | |
139 | 139 | } ?> |
140 | 140 | |
141 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
141 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
142 | 142 | |
143 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
144 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
143 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
144 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
145 | 145 | <?php } ?> |
146 | 146 | |
147 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?> |
|
148 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
147 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?> |
|
148 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
149 | 149 | <?php } ?> |
150 | 150 | |
151 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
151 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
152 | 152 | |
153 | 153 | </ul> |
154 | 154 | |
155 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
155 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
156 | 156 | |
157 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
157 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
158 | 158 | |
159 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
160 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
159 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
160 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
161 | 161 | |
162 | 162 | |
163 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
163 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
164 | 164 | |
165 | - <?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?> |
|
166 | - <a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
165 | + <?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?> |
|
166 | + <a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
167 | 167 | <?php } ?> |
168 | 168 | |
169 | 169 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | </div> |
175 | 175 | |
176 | 176 | |
177 | - <?php do_action( 'lasso_editor_controls_after_outside' );?> |
|
177 | + <?php do_action('lasso_editor_controls_after_outside'); ?> |
|
178 | 178 | |
179 | 179 | <?php } |
180 | 180 | } |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | |
193 | 193 | |
194 | 194 | // let users add custom css classes |
195 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
195 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
196 | 196 | ?> |
197 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
197 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
198 | 198 | <div class="lasso--sidebar__inner"> |
199 | 199 | <div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div> |
200 | 200 | </div> |
@@ -216,21 +216,21 @@ discard block |
||
216 | 216 | $is_mobile = wp_is_mobile(); |
217 | 217 | |
218 | 218 | // check for lasso story engine and add a class doniting this |
219 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
219 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
220 | 220 | |
221 | 221 | // let users add custom css classes |
222 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
222 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
223 | 223 | |
224 | 224 | // are toolbar headings enabled |
225 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
226 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
227 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
225 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
226 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
227 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
228 | 228 | |
229 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
229 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
230 | 230 | |
231 | 231 | // mobile styles |
232 | 232 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
233 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
233 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
234 | 234 | |
235 | 235 | //show color |
236 | 236 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -238,126 +238,126 @@ discard block |
||
238 | 238 | //show alignment |
239 | 239 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
240 | 240 | |
241 | - $status = get_post_status( get_the_ID() ); |
|
241 | + $status = get_post_status(get_the_ID()); |
|
242 | 242 | |
243 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
243 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
244 | 244 | |
245 | 245 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
246 | 246 | |
247 | 247 | |
248 | 248 | ?> |
249 | - <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
|
250 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
251 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
252 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
253 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
254 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
255 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
256 | - <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
249 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
250 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
251 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
252 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
253 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
254 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
255 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
256 | + <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
257 | 257 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
258 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
259 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
260 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
261 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
262 | - <li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li> |
|
263 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
264 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
265 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
266 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
267 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
268 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
269 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
270 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
271 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
272 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
273 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
258 | + <?php if ('ase-active' == $ase_status): ?> |
|
259 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
260 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
261 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
262 | + <li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li> |
|
263 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
264 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
265 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
266 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
267 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
268 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
269 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
270 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
271 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
272 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
273 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
274 | 274 | <?php }?> |
275 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
276 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
275 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
276 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
277 | 277 | <?php }?> |
278 | 278 | <?php else: ?> |
279 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
280 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
281 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
279 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
280 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
281 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
282 | 282 | <?php endif; ?> |
283 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
283 | + <?php do_action('lasso_toolbar_components'); ?> |
|
284 | 284 | </ul> |
285 | 285 | </li> |
286 | - <?php if ( $toolbar_headings ): ?> |
|
287 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
288 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
286 | + <?php if ($toolbar_headings): ?> |
|
287 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
288 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
289 | 289 | <?php endif; ?> |
290 | 290 | |
291 | 291 | |
292 | 292 | |
293 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
294 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
295 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
296 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
293 | + <?php if ($toolbar_headings_h4): ?> |
|
294 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
295 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
296 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
297 | 297 | <?php endif; ?> |
298 | 298 | |
299 | - <?php if ( $show_color ): ?> |
|
300 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
301 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
299 | + <?php if ($show_color): ?> |
|
300 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
301 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
302 | 302 | <?php endif; ?> |
303 | 303 | |
304 | - <?php if ( $toolbar_list ): ?> |
|
305 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
306 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
304 | + <?php if ($toolbar_list): ?> |
|
305 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
306 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
307 | 307 | <?php endif; ?> |
308 | 308 | |
309 | 309 | |
310 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
310 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
311 | 311 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
312 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
313 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
312 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
313 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
314 | 314 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
315 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
315 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
316 | 316 | </div> |
317 | 317 | </li> |
318 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
319 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
318 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
319 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
320 | 320 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
321 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
321 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
322 | 322 | <div id="lasso-toolbar--html__footer"> |
323 | 323 | <div id="lasso-toolbar--html__footer_desc" > |
324 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
325 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
326 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
324 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
325 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
326 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
327 | 327 | </div> |
328 | 328 | <ul class="lasso-toolbar--html-snips"> |
329 | 329 | |
330 | - <?php if ( !$toolbar_headings ): ?> |
|
331 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
332 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
330 | + <?php if (!$toolbar_headings): ?> |
|
331 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
332 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
333 | 333 | <?php endif; ?> |
334 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
335 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
334 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
335 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
336 | 336 | |
337 | - <li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>"> |
|
337 | + <li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>"> |
|
338 | 338 | </ul> |
339 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
340 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
339 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
340 | + <a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
341 | 341 | </div> |
342 | 342 | </div> |
343 | 343 | </li> |
344 | - <?php if ( $show_align ): ?> |
|
345 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
346 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
347 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
344 | + <?php if ($show_align): ?> |
|
345 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
346 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
347 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
348 | 348 | <?php endif; ?> |
349 | 349 | </ul> |
350 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
350 | + <?php if (is_singular() && $is_mobile) { ?> |
|
351 | 351 | |
352 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
352 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
353 | 353 | |
354 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
355 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
354 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
355 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
356 | 356 | |
357 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
357 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
358 | 358 | |
359 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
360 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
359 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
360 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
361 | 361 | <?php } ?> |
362 | 362 | |
363 | 363 | </div> |
@@ -375,20 +375,20 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function lasso_editor_settings_toolbar() { |
377 | 377 | |
378 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
378 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
379 | 379 | |
380 | 380 | ob_start(); |
381 | 381 | |
382 | 382 | |
383 | 383 | // let users add custom css classes |
384 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
384 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
385 | 385 | |
386 | 386 | ?> |
387 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
388 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
389 | - <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
390 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
391 | - <li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
387 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
388 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
389 | + <li id="lasso-component--settings__trigger" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
390 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
391 | + <li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
392 | 392 | </ul> |
393 | 393 | |
394 | 394 | <?php return ob_get_clean(); |
@@ -406,13 +406,13 @@ discard block |
||
406 | 406 | |
407 | 407 | |
408 | 408 | // has post thumbnail |
409 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
409 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
410 | 410 | |
411 | 411 | ?> |
412 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
413 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
414 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
415 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
412 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
413 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
414 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
415 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
416 | 416 | </ul> |
417 | 417 | |
418 | 418 | <?php return ob_get_clean(); |
@@ -436,55 +436,55 @@ discard block |
||
436 | 436 | |
437 | 437 | $postid = get_the_ID(); |
438 | 438 | |
439 | - $status = get_post_status( $postid ); |
|
440 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
439 | + $status = get_post_status($postid); |
|
440 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
441 | 441 | |
442 | 442 | // let users add custom css classes |
443 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
443 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
444 | 444 | |
445 | 445 | // objects categories |
446 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
447 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
446 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
447 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
448 | 448 | |
449 | 449 | // modal tabs |
450 | - $tabs = lasso_modal_addons('tab'); |
|
451 | - $content = lasso_modal_addons('content'); |
|
450 | + $tabs = lasso_modal_addons('tab'); |
|
451 | + $content = lasso_modal_addons('content'); |
|
452 | 452 | |
453 | 453 | //editor options |
454 | 454 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
455 | 455 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
456 | 456 | |
457 | 457 | // are we singular |
458 | - $is_singular = is_singular(); |
|
458 | + $is_singular = is_singular(); |
|
459 | 459 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
460 | 460 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
461 | 461 | $theme_supports = current_theme_supports('post-thumbnails'); |
462 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
462 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
463 | 463 | |
464 | 464 | // do we support pending status |
465 | 465 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
466 | 466 | |
467 | 467 | ?> |
468 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
468 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
469 | 469 | <div class="lasso--modal__inner"> |
470 | 470 | |
471 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
471 | + <?php if ($tabs) { echo $tabs; } ?> |
|
472 | 472 | |
473 | 473 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
474 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
474 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
475 | 475 | |
476 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
476 | + <?php if ($is_singular && $theme_supports) : ?> |
|
477 | 477 | <div class="lasso--postsettings__left"> |
478 | - <label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
479 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
478 | + <label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
479 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
480 | 480 | |
481 | 481 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
482 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
483 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
482 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
483 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
484 | 484 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
485 | 485 | </div> |
486 | 486 | |
487 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
487 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
488 | 488 | |
489 | 489 | </div> |
490 | 490 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -494,15 +494,15 @@ discard block |
||
494 | 494 | |
495 | 495 | <div class="lasso--postsettings__right"> |
496 | 496 | |
497 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
497 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
498 | 498 | <div class="lasso--postsettings__option story-status-option"> |
499 | - <label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
500 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
501 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
502 | - <?php if( !$no_pending_status ): ?> |
|
503 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
499 | + <label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
500 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
501 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
502 | + <?php if (!$no_pending_status): ?> |
|
503 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
504 | 504 | <?php endif; ?> |
505 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
505 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
506 | 506 | </ul> |
507 | 507 | <div class="lasso--slider_wrap"> |
508 | 508 | <div id="lasso--slider"></div> |
@@ -510,10 +510,10 @@ discard block |
||
510 | 510 | </div> |
511 | 511 | <?php endif; ?> |
512 | 512 | |
513 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
513 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
514 | 514 | <div class="lasso--postsettings__option story-slug-option"> |
515 | - <label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
516 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
515 | + <label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
516 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
517 | 517 | </div> |
518 | 518 | <?php endif; ?> |
519 | 519 | |
@@ -522,21 +522,21 @@ discard block |
||
522 | 522 | <div class="lasso--postsettings__middle"> |
523 | 523 | |
524 | 524 | <div class="lasso--postsettings__option story-categories-option"> |
525 | - <label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
526 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
525 | + <label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
526 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
527 | 527 | </div> |
528 | 528 | |
529 | 529 | <div class="lasso--postsettings__option story-tags-option"> |
530 | - <label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
531 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
530 | + <label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
531 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
532 | 532 | </div> |
533 | 533 | <?php |
534 | 534 | if ($allow_change_date) { |
535 | - $dateformat = get_option( 'date_format' ); |
|
535 | + $dateformat = get_option('date_format'); |
|
536 | 536 | ?> |
537 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
538 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
539 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
537 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
538 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
539 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
540 | 540 | <?php |
541 | 541 | }?> |
542 | 542 | |
@@ -558,23 +558,23 @@ discard block |
||
558 | 558 | ?> |
559 | 559 | <!--/div--> |
560 | 560 | |
561 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
561 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
562 | 562 | |
563 | 563 | <div class="lasso--postsettings__footer" > |
564 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
564 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
565 | 565 | <input type="hidden" name="status" value=""> |
566 | 566 | <input type="hidden" name="categories" value=""> |
567 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
567 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
568 | 568 | <input type="hidden" name="action" value="process_update-object_post"> |
569 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
570 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
571 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
569 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
570 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
571 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
572 | 572 | </div> |
573 | 573 | |
574 | 574 | </form> |
575 | 575 | </div> |
576 | 576 | |
577 | - <?php if( $tabs ) { echo $content; } ?> |
|
577 | + <?php if ($tabs) { echo $content; } ?> |
|
578 | 578 | |
579 | 579 | </div> |
580 | 580 | |
@@ -596,41 +596,41 @@ discard block |
||
596 | 596 | ob_start(); |
597 | 597 | |
598 | 598 | |
599 | - $status = get_post_status( get_the_ID() ); |
|
599 | + $status = get_post_status(get_the_ID()); |
|
600 | 600 | |
601 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
601 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
602 | 602 | |
603 | 603 | // let users add custom css classes |
604 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
604 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
605 | 605 | |
606 | 606 | // return the post type |
607 | - $type = get_post_type( get_the_ID() ); |
|
607 | + $type = get_post_type(get_the_ID()); |
|
608 | 608 | |
609 | 609 | $mobile_style = ""; |
610 | 610 | if (wp_is_mobile()) { |
611 | 611 | //$mobile_style = 'style="top:140px !important;"'; |
612 | 612 | } |
613 | 613 | ?> |
614 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
614 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
615 | 615 | <div class="lasso--modal__inner lasso--hasnewform"> |
616 | 616 | |
617 | 617 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
618 | 618 | |
619 | 619 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
620 | - <label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
621 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
620 | + <label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
621 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
622 | 622 | <div class="lasso--select-wrap" style="width:90px"> |
623 | 623 | <select id="lasso--select-type" name="story_type"> |
624 | 624 | |
625 | 625 | <?php |
626 | 626 | $types = lasso_post_types_names(); |
627 | - if ( !empty( $types ) ) { |
|
628 | - foreach( $types as $name => $label ) { |
|
629 | - $type = preg_replace( '/s\b/','', $name ); |
|
627 | + if (!empty($types)) { |
|
628 | + foreach ($types as $name => $label) { |
|
629 | + $type = preg_replace('/s\b/', '', $name); |
|
630 | 630 | if ($type == 'page' && !current_user_can('edit_pages')) { |
631 | 631 | continue; |
632 | 632 | } |
633 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
633 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
634 | 634 | } |
635 | 635 | |
636 | 636 | } |
@@ -641,19 +641,19 @@ discard block |
||
641 | 641 | </div> |
642 | 642 | |
643 | 643 | <div class="lasso--postsettings__footer"> |
644 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
644 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
645 | 645 | <input type="hidden" name="action" value="process_new-object_post"> |
646 | 646 | <?php |
647 | - if ( !empty( $types ) ) { |
|
647 | + if (!empty($types)) { |
|
648 | 648 | // get the first element |
649 | 649 | $keys = array_keys($types); |
650 | - $type =$keys[0]; |
|
651 | - $type = preg_replace( '/s\b/','', $type ); |
|
652 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
650 | + $type = $keys[0]; |
|
651 | + $type = preg_replace('/s\b/', '', $type); |
|
652 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
653 | 653 | } |
654 | 654 | ?> |
655 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
656 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
655 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
656 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
657 | 657 | </div> |
658 | 658 | |
659 | 659 | </form> |
@@ -681,18 +681,18 @@ discard block |
||
681 | 681 | ob_start(); |
682 | 682 | |
683 | 683 | // post status |
684 | - $status = get_post_status( get_the_ID() ); |
|
684 | + $status = get_post_status(get_the_ID()); |
|
685 | 685 | |
686 | 686 | // let users add custom css classes |
687 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
687 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
688 | 688 | |
689 | 689 | ?> |
690 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
690 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
691 | 691 | <div class="lasso--modal__inner"> |
692 | 692 | |
693 | 693 | <div class="lasso--post-filtering not-visible"> |
694 | 694 | <div class="lasso--search__results"> |
695 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
695 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
696 | 696 | </div> |
697 | 697 | <div class="lasso--search"> |
698 | 698 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -706,18 +706,18 @@ discard block |
||
706 | 706 | $post_types = lasso_post_types_names(); |
707 | 707 | $rest_bases = lasso_post_types_rest_base(); |
708 | 708 | |
709 | - if ( ! empty( $post_types ) ) { |
|
709 | + if (!empty($post_types)) { |
|
710 | 710 | $first = 'active'; |
711 | - foreach( $post_types as $name => $label ) { |
|
711 | + foreach ($post_types as $name => $label) { |
|
712 | 712 | if (array_key_exists($name, $rest_bases)) { |
713 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
713 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
714 | 714 | } |
715 | 715 | $first = ''; |
716 | 716 | } |
717 | 717 | |
718 | 718 | } |
719 | 719 | |
720 | - do_action('lasso_modal_post_objects');?> |
|
720 | + do_action('lasso_modal_post_objects'); ?> |
|
721 | 721 | |
722 | 722 | </ul> |
723 | 723 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -737,14 +737,14 @@ discard block |
||
737 | 737 | |
738 | 738 | |
739 | 739 | // let users add custom css classes |
740 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
740 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
741 | 741 | |
742 | 742 | ?> |
743 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
744 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
745 | - <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
746 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
747 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
743 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
744 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
745 | + <li id="lasso--wpimg-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
746 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
747 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
748 | 748 | </ul> |
749 | 749 | |
750 | 750 | <?php return ob_get_clean(); |
@@ -756,14 +756,14 @@ discard block |
||
756 | 756 | |
757 | 757 | |
758 | 758 | // let users add custom css classes |
759 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
759 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
760 | 760 | |
761 | 761 | ?> |
762 | - <ul class="lasso-component--controls <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
763 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
764 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
765 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
766 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
762 | + <ul class="lasso-component--controls <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
763 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
764 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
765 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
766 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
767 | 767 | </ul> |
768 | 768 | |
769 | 769 | <?php return ob_get_clean(); |
@@ -776,16 +776,16 @@ discard block |
||
776 | 776 | */ |
777 | 777 | function lasso_map_form_footer() { |
778 | 778 | |
779 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
779 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
780 | 780 | |
781 | 781 | ob_start(); |
782 | 782 | |
783 | 783 | ?> |
784 | 784 | <div class="lasso--map-form__footer"> |
785 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
786 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
785 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
786 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
787 | 787 | <input type="hidden" name="action" value="process_map_save"> |
788 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
788 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
789 | 789 | </div> |
790 | 790 | |
791 | 791 | <?php return ob_get_clean(); |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | |
804 | 804 | ?> |
805 | 805 | <div id="lasso--pagerefresh" class="visible"> |
806 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
806 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
807 | 807 | </div> |
808 | 808 | |
809 | 809 | <?php return ob_get_clean(); |
@@ -817,43 +817,43 @@ discard block |
||
817 | 817 | */ |
818 | 818 | function lasso_editor_options_blob() { |
819 | 819 | |
820 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : apply_filters( 'lasso_custom_options', '' ); |
|
821 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
820 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : apply_filters('lasso_custom_options', ''); |
|
821 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
822 | 822 | |
823 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
823 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
824 | 824 | |
825 | 825 | $blob = array(); |
826 | 826 | |
827 | - if ( empty( $codes ) ) |
|
827 | + if (empty($codes)) |
|
828 | 828 | return; |
829 | 829 | |
830 | - foreach ( $codes as $slug => $shortcode ) { |
|
830 | + foreach ($codes as $slug => $shortcode) { |
|
831 | 831 | $return = ''; |
832 | 832 | // Shortcode has atts |
833 | 833 | |
834 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
834 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
835 | 835 | |
836 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
836 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
837 | 837 | |
838 | 838 | |
839 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
839 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
840 | 840 | |
841 | 841 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
842 | 842 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
843 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
843 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
844 | 844 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
845 | 845 | // Select |
846 | 846 | |
847 | - if ( isset( $attr_info['values'] ) ) { |
|
847 | + if (isset($attr_info['values'])) { |
|
848 | 848 | |
849 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
849 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
850 | 850 | |
851 | - $i=0; |
|
851 | + $i = 0; |
|
852 | 852 | |
853 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
853 | + foreach ($attr_info['values'] as $attr_value) { |
|
854 | 854 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
855 | 855 | |
856 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
856 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
857 | 857 | |
858 | 858 | $i++; |
859 | 859 | } |
@@ -862,24 +862,24 @@ discard block |
||
862 | 862 | |
863 | 863 | } else { |
864 | 864 | |
865 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
865 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
866 | 866 | |
867 | 867 | // image upload |
868 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
868 | + if ('media_upload' == $attr_info['type']) { |
|
869 | 869 | |
870 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
870 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
871 | 871 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
872 | 872 | |
873 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
873 | + } elseif ('color' == $attr_info['type']) { |
|
874 | 874 | |
875 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
875 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
876 | 876 | |
877 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
877 | + } elseif ('text_area' == $attr_info['type']) { |
|
878 | 878 | |
879 | - $return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
879 | + $return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
880 | 880 | |
881 | 881 | } else { |
882 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
882 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
883 | 883 | } |
884 | 884 | } |
885 | 885 | $return .= '</p>'; |
@@ -890,9 +890,9 @@ discard block |
||
890 | 890 | /////////////////////////// |
891 | 891 | // START GALLERY AND MAP FRONT END STUFFS |
892 | 892 | /////////////////////////// |
893 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
893 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
894 | 894 | |
895 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
895 | + if ('gallery' == $shortcode['front_type']) { |
|
896 | 896 | |
897 | 897 | $return .= lasso_gallery_editor_module(); |
898 | 898 | |
@@ -903,13 +903,13 @@ discard block |
||
903 | 903 | /////////////////////////// |
904 | 904 | |
905 | 905 | // Single shortcode (not closed) |
906 | - if ( 'single' == $shortcode['type'] ) { |
|
906 | + if ('single' == $shortcode['type']) { |
|
907 | 907 | |
908 | 908 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
909 | 909 | |
910 | 910 | } else { |
911 | 911 | |
912 | - $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>'; |
|
912 | + $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>'; |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>'; |
@@ -945,14 +945,14 @@ discard block |
||
945 | 945 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
946 | 946 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
947 | 947 | <i class="lasso-icon lasso-icon-move"></i> |
948 | - <label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
948 | + <label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
949 | 949 | <div class="lasso--slider_wrap"> |
950 | 950 | <div id="lasso--slider"></div> |
951 | 951 | </div> |
952 | 952 | <ul id="lasso--revision-list"></ul> |
953 | 953 | <div class="lasso--btn-group lasso--btn-group-small"> |
954 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
955 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
954 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
955 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
956 | 956 | </div> |
957 | 957 | </div> |
958 | 958 | |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | // Normalize into a six character long hex string |
976 | 976 | $hex = str_replace('#', '', $hex); |
977 | 977 | if (strlen($hex) == 3) { |
978 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
978 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
979 | 979 | } |
980 | 980 | |
981 | 981 | // Split into three parts: R, G and B |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | |
985 | 985 | foreach ($color_parts as $color) { |
986 | 986 | $color = hexdec($color); // Convert to decimal |
987 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
987 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
988 | 988 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
989 | 989 | } |
990 | 990 |
@@ -52,23 +52,23 @@ discard block |
||
52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
53 | 53 | |
54 | 54 | // Activate plugin when new blog is added |
55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
56 | 56 | |
57 | 57 | // Load plugin text domain |
58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
59 | 59 | |
60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
62 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
63 | - add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
|
64 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
65 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
66 | - add_action( 'wp_ajax_editus_get_ase_options', array( $this, 'get_ase_options' ) ); |
|
67 | - add_action( 'wp_ajax_editus_delete_post', array( $this, 'delete_post' ) ); |
|
68 | - add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
|
69 | - add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
|
60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
62 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
63 | + add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post')); |
|
64 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
65 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
66 | + add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options')); |
|
67 | + add_action('wp_ajax_editus_delete_post', array($this, 'delete_post')); |
|
68 | + add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img')); |
|
69 | + add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img')); |
|
70 | 70 | |
71 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'publish_post' ) ); |
|
71 | + add_action('wp_ajax_editus_publish_post', array($this, 'publish_post')); |
|
72 | 72 | |
73 | 73 | // enable saving custom fields through REST API |
74 | 74 | self::enable_metasave('post'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public static function get_instance() { |
100 | 100 | |
101 | 101 | // If the single instance hasn't been set, set it now. |
102 | - if ( null == self::$instance ) { |
|
102 | + if (null == self::$instance) { |
|
103 | 103 | self::$instance = new self; |
104 | 104 | } |
105 | 105 | |
@@ -116,18 +116,18 @@ discard block |
||
116 | 116 | * WPMU is disabled or plugin is |
117 | 117 | * activated on an individual blog. |
118 | 118 | */ |
119 | - public static function activate( $network_wide ) { |
|
119 | + public static function activate($network_wide) { |
|
120 | 120 | |
121 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
121 | + if (function_exists('is_multisite') && is_multisite()) { |
|
122 | 122 | |
123 | - if ( $network_wide ) { |
|
123 | + if ($network_wide) { |
|
124 | 124 | |
125 | 125 | // Get all blog ids |
126 | 126 | $blog_ids = self::get_blog_ids(); |
127 | 127 | |
128 | - foreach ( $blog_ids as $blog_id ) { |
|
128 | + foreach ($blog_ids as $blog_id) { |
|
129 | 129 | |
130 | - switch_to_blog( $blog_id ); |
|
130 | + switch_to_blog($blog_id); |
|
131 | 131 | self::single_activate(); |
132 | 132 | } |
133 | 133 | |
@@ -153,18 +153,18 @@ discard block |
||
153 | 153 | * WPMU is disabled or plugin is |
154 | 154 | * deactivated on an individual blog. |
155 | 155 | */ |
156 | - public static function deactivate( $network_wide ) { |
|
156 | + public static function deactivate($network_wide) { |
|
157 | 157 | |
158 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
158 | + if (function_exists('is_multisite') && is_multisite()) { |
|
159 | 159 | |
160 | - if ( $network_wide ) { |
|
160 | + if ($network_wide) { |
|
161 | 161 | |
162 | 162 | // Get all blog ids |
163 | 163 | $blog_ids = self::get_blog_ids(); |
164 | 164 | |
165 | - foreach ( $blog_ids as $blog_id ) { |
|
165 | + foreach ($blog_ids as $blog_id) { |
|
166 | 166 | |
167 | - switch_to_blog( $blog_id ); |
|
167 | + switch_to_blog($blog_id); |
|
168 | 168 | self::single_deactivate(); |
169 | 169 | |
170 | 170 | } |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @param int $blog_id ID of the new blog. |
190 | 190 | */ |
191 | - public function activate_new_site( $blog_id ) { |
|
191 | + public function activate_new_site($blog_id) { |
|
192 | 192 | |
193 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
193 | + if (1 !== did_action('wpmu_new_blog')) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | 196 | |
197 | - switch_to_blog( $blog_id ); |
|
197 | + switch_to_blog($blog_id); |
|
198 | 198 | self::single_activate(); |
199 | 199 | restore_current_blog(); |
200 | 200 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | WHERE archived = '0' AND spam = '0' |
220 | 220 | AND deleted = '0'"; |
221 | 221 | |
222 | - return $wpdb->get_col( $sql ); |
|
222 | + return $wpdb->get_col($sql); |
|
223 | 223 | |
224 | 224 | } |
225 | 225 | |
@@ -230,18 +230,18 @@ discard block |
||
230 | 230 | */ |
231 | 231 | private static function single_activate() { |
232 | 232 | |
233 | - $curr_version = get_option( 'lasso_version' ); |
|
233 | + $curr_version = get_option('lasso_version'); |
|
234 | 234 | |
235 | 235 | // update upgraded from |
236 | - if ( $curr_version ) { |
|
237 | - update_option( 'lasso_updated_from', $curr_version ); |
|
236 | + if ($curr_version) { |
|
237 | + update_option('lasso_updated_from', $curr_version); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | // update lasso version option |
241 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
241 | + update_option('lasso_version', LASSO_VERSION); |
|
242 | 242 | |
243 | 243 | // set transietn for activation welcome |
244 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
244 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
245 | 245 | |
246 | 246 | |
247 | 247 | } |
@@ -263,15 +263,15 @@ discard block |
||
263 | 263 | public function load_plugin_textdomain() { |
264 | 264 | |
265 | 265 | $domain = $this->plugin_slug; |
266 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
266 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
267 | 267 | |
268 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
268 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | // new ajax function to lock post for editing |
272 | 272 | public function editus_lock_post() |
273 | 273 | { |
274 | - $post_id= $_POST["postid"]; |
|
274 | + $post_id = $_POST["postid"]; |
|
275 | 275 | $locked = wp_check_post_lock($post_id); |
276 | 276 | |
277 | 277 | if (!$locked) { |
@@ -279,17 +279,17 @@ discard block |
||
279 | 279 | echo "true"; |
280 | 280 | } else { |
281 | 281 | $user_info = get_userdata($locked); |
282 | - echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name . " " . $user_info->last_name; |
|
282 | + echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name; |
|
283 | 283 | } |
284 | 284 | exit; |
285 | 285 | } |
286 | 286 | |
287 | 287 | public function editus_unlock_post() |
288 | 288 | { |
289 | - $post_id= $_POST["postid"]; |
|
289 | + $post_id = $_POST["postid"]; |
|
290 | 290 | $locked = wp_check_post_lock($post_id); |
291 | 291 | if (!$locked) { |
292 | - delete_post_meta( $post_id, '_edit_lock'); |
|
292 | + delete_post_meta($post_id, '_edit_lock'); |
|
293 | 293 | } |
294 | 294 | echo "true"; |
295 | 295 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | { |
302 | 302 | $user_id = get_current_user_ID(); |
303 | 303 | |
304 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
304 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
305 | 305 | exit; |
306 | 306 | } |
307 | 307 | |
@@ -312,14 +312,14 @@ discard block |
||
312 | 312 | $data = array(); |
313 | 313 | parse_str($_POST['data'], $data); |
314 | 314 | |
315 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
315 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
316 | 316 | wp_send_json_error(); |
317 | 317 | exit; |
318 | 318 | } |
319 | 319 | |
320 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
321 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
322 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
320 | + $status = isset($data['status']) ? $data['status'] : false; |
|
321 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
322 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
323 | 323 | |
324 | 324 | |
325 | 325 | $args = array( |
@@ -330,24 +330,24 @@ discard block |
||
330 | 330 | |
331 | 331 | |
332 | 332 | |
333 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
333 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
334 | 334 | |
335 | 335 | // update categories |
336 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
336 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
337 | 337 | |
338 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
338 | + self::set_post_terms($postid, $cats, 'category'); |
|
339 | 339 | |
340 | 340 | // update tags |
341 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
342 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
341 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
342 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
343 | 343 | |
344 | 344 | //update date |
345 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
346 | - self::set_date( $postid, $date ); |
|
345 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
346 | + self::set_date($postid, $date); |
|
347 | 347 | |
348 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
349 | - $response= array( |
|
350 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
348 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
349 | + $response = array( |
|
350 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
351 | 351 | ); |
352 | 352 | wp_send_json_success($response); |
353 | 353 | exit; |
@@ -355,11 +355,11 @@ discard block |
||
355 | 355 | |
356 | 356 | public static function enable_metasave($type) |
357 | 357 | { |
358 | - register_rest_field( $type, 'metadata', array( |
|
359 | - 'get_callback' => function ( $data ) { |
|
360 | - return get_post_meta( $data['id']);//, '', '' ); |
|
358 | + register_rest_field($type, 'metadata', array( |
|
359 | + 'get_callback' => function($data) { |
|
360 | + return get_post_meta($data['id']); //, '', '' ); |
|
361 | 361 | }, |
362 | - 'update_callback' => function( $data, $post ) { |
|
362 | + 'update_callback' => function($data, $post) { |
|
363 | 363 | foreach ($data as $key => $value) { |
364 | 364 | update_post_meta($post->ID, $key, $value); |
365 | 365 | } |
@@ -371,13 +371,13 @@ discard block |
||
371 | 371 | public function editus_do_shortcode() |
372 | 372 | { |
373 | 373 | |
374 | - $code= $_POST["code"]; |
|
374 | + $code = $_POST["code"]; |
|
375 | 375 | $code = str_replace('\"', '"', $code); |
376 | 376 | |
377 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
378 | - $out = do_shortcode($code); |
|
377 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
378 | + $out = do_shortcode($code); |
|
379 | 379 | if ($out != '') { |
380 | - $out = do_shortcode($code_wrapped); |
|
380 | + $out = do_shortcode($code_wrapped); |
|
381 | 381 | echo $out; |
382 | 382 | exit; |
383 | 383 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | /** @var \WP_Embed $wp_embed */ |
388 | 388 | global $wp_embed; |
389 | 389 | $wp_embed->post_ID = $_POST["ID"]; |
390 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
390 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
391 | 391 | |
392 | 392 | echo $out; |
393 | 393 | exit; |
@@ -397,53 +397,53 @@ discard block |
||
397 | 397 | { |
398 | 398 | |
399 | 399 | |
400 | - $code= $_POST["code"]; |
|
400 | + $code = $_POST["code"]; |
|
401 | 401 | $atts = array( |
402 | 402 | ); |
403 | 403 | foreach ($_POST as $key => $value) { |
404 | - if ($key !="code" && $key !="action") { |
|
404 | + if ($key != "code" && $key != "action") { |
|
405 | 405 | //$shortcode = $shortcode.$key.'="'.$value.'" '; |
406 | 406 | $atts[$key] = $value; |
407 | 407 | } |
408 | 408 | } |
409 | 409 | if ($code == "aesop_video") { |
410 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
410 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
411 | 411 | echo aesop_video_shortcode($atts); |
412 | 412 | } |
413 | 413 | else if ($code == "aesop_image") { |
414 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
414 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
415 | 415 | echo aesop_image_shortcode($atts); |
416 | 416 | } |
417 | 417 | else if ($code == "aesop_quote") { |
418 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
418 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
419 | 419 | echo aesop_quote_shortcode($atts); |
420 | 420 | } |
421 | 421 | else if ($code == "aesop_parallax") { |
422 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
422 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
423 | 423 | echo aesop_parallax_shortcode($atts); |
424 | 424 | } |
425 | 425 | else if ($code == "aesop_character") { |
426 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
426 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
427 | 427 | echo aesop_character_shortcode($atts); |
428 | 428 | } |
429 | 429 | else if ($code == "aesop_collection") { |
430 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
430 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
431 | 431 | echo aesop_collection_shortcode($atts); |
432 | 432 | } |
433 | 433 | else if ($code == "aesop_chapter") { |
434 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
434 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
435 | 435 | echo aesop_chapter_shortcode($atts); |
436 | 436 | } |
437 | 437 | else if ($code == "aesop_content") { |
438 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
438 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
439 | 439 | echo aesop_content_shortcode($atts, $atts['content_data']); |
440 | 440 | } |
441 | 441 | else if ($code == "aesop_gallery") { |
442 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
443 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
442 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
443 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
444 | 444 | } |
445 | 445 | else if ($code == "aesop_audio") { |
446 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
446 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
447 | 447 | echo aesop_audio_shortcode($atts); |
448 | 448 | } |
449 | 449 | else { |
@@ -464,20 +464,20 @@ discard block |
||
464 | 464 | public function get_ase_options() |
465 | 465 | { |
466 | 466 | $blob = lasso_editor_options_blob(); |
467 | - $code= $_POST["component"]; |
|
467 | + $code = $_POST["component"]; |
|
468 | 468 | echo $blob[$code]; |
469 | 469 | exit; |
470 | 470 | } |
471 | 471 | |
472 | 472 | public function delete_post( ) { |
473 | 473 | |
474 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
474 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
475 | 475 | |
476 | 476 | // bail out if the current user can't publish posts |
477 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
477 | + if (!lasso_user_can('delete_post', $postid)) |
|
478 | 478 | return; |
479 | 479 | |
480 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
|
480 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) { |
|
481 | 481 | wp_send_json_error(); |
482 | 482 | exit; |
483 | 483 | } |
@@ -487,9 +487,9 @@ discard block |
||
487 | 487 | 'post_status' => 'trash' |
488 | 488 | ); |
489 | 489 | |
490 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
490 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
491 | 491 | |
492 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
492 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
493 | 493 | |
494 | 494 | exit; |
495 | 495 | } |
@@ -497,40 +497,40 @@ discard block |
||
497 | 497 | /* This function doesn't actually publish post, but should be called when a post is published */ |
498 | 498 | public function publish_post( ) { |
499 | 499 | |
500 | - $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
500 | + $post_id = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
501 | 501 | |
502 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
502 | + do_action('transition_post_status', 'publish', 'draft', get_post($post_id)); |
|
503 | 503 | |
504 | 504 | exit; |
505 | 505 | } |
506 | 506 | |
507 | 507 | public function set_featured_img( ) { |
508 | 508 | |
509 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
510 | - $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false; |
|
511 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
509 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
510 | + $image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false; |
|
511 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
512 | 512 | wp_send_json_error(); |
513 | 513 | exit; |
514 | 514 | } |
515 | 515 | |
516 | - set_post_thumbnail( $postid, $image_id ); |
|
516 | + set_post_thumbnail($postid, $image_id); |
|
517 | 517 | |
518 | - do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() ); |
|
518 | + do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID()); |
|
519 | 519 | |
520 | 520 | exit; |
521 | 521 | } |
522 | 522 | |
523 | 523 | public function del_featured_img( ) { |
524 | 524 | |
525 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
526 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
525 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
526 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
527 | 527 | wp_send_json_error(); |
528 | 528 | exit; |
529 | 529 | } |
530 | 530 | |
531 | - delete_post_thumbnail( $postid ); |
|
531 | + delete_post_thumbnail($postid); |
|
532 | 532 | |
533 | - do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() ); |
|
533 | + do_action('lasso_featured_image_deleted', $postid, get_current_user_ID()); |
|
534 | 534 | |
535 | 535 | exit; |
536 | 536 | } |
@@ -551,17 +551,17 @@ discard block |
||
551 | 551 | return self::$revisions; |
552 | 552 | }*/ |
553 | 553 | |
554 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
555 | - if( $value ) { |
|
556 | - $value = explode( ',', $value ); |
|
557 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
554 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
555 | + if ($value) { |
|
556 | + $value = explode(',', $value); |
|
557 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
558 | 558 | |
559 | - if ($taxonomy =='category') { |
|
559 | + if ($taxonomy == 'category') { |
|
560 | 560 | // convert from names to category ids |
561 | 561 | $cats = array(); |
562 | 562 | foreach ($value as $cat) { |
563 | 563 | $cat_id = get_cat_ID($cat); |
564 | - if ($cat_id !=0) { |
|
564 | + if ($cat_id != 0) { |
|
565 | 565 | $cats [] = $cat_id; |
566 | 566 | } else if ($allow_new_category) { |
567 | 567 | $cats [] = wp_create_category($cat); |
@@ -570,47 +570,47 @@ discard block |
||
570 | 570 | $value = $cats; |
571 | 571 | } |
572 | 572 | |
573 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
573 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
574 | 574 | } |
575 | - else { |
|
575 | + else { |
|
576 | 576 | //remove all terms from post |
577 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
577 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
578 | 578 | } |
579 | 579 | |
580 | - if ( ! is_wp_error( $result ) ) { |
|
580 | + if (!is_wp_error($result)) { |
|
581 | 581 | return true; |
582 | - }else{ |
|
582 | + } else { |
|
583 | 583 | return false; |
584 | 584 | } |
585 | 585 | } |
586 | 586 | |
587 | - function getEnglishMonthName($foreignMonthName){ |
|
587 | + function getEnglishMonthName($foreignMonthName) { |
|
588 | 588 | |
589 | 589 | setlocale(LC_ALL, 'en_US'); |
590 | 590 | |
591 | - $month_numbers = range(1,12); |
|
591 | + $month_numbers = range(1, 12); |
|
592 | 592 | |
593 | - foreach($month_numbers as $month) |
|
594 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
593 | + foreach ($month_numbers as $month) |
|
594 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
595 | 595 | |
596 | 596 | setlocale(LC_ALL, get_locale()); |
597 | 597 | |
598 | - foreach($month_numbers as $month) |
|
599 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
598 | + foreach ($month_numbers as $month) |
|
599 | + $foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011))); |
|
600 | 600 | |
601 | 601 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
602 | 602 | } |
603 | 603 | |
604 | 604 | |
605 | 605 | |
606 | - public function set_date( $postid, $value) { |
|
607 | - if( $value ) { |
|
608 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
606 | + public function set_date($postid, $value) { |
|
607 | + if ($value) { |
|
608 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
609 | 609 | wp_update_post( |
610 | - array ( |
|
610 | + array( |
|
611 | 611 | 'ID' => $postid, // ID of the post to update |
612 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
613 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
612 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
613 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
614 | 614 | ) |
615 | 615 | ); |
616 | 616 | } |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | class assets { |
12 | 12 | |
13 | - public function __construct(){ |
|
13 | + public function __construct() { |
|
14 | 14 | |
15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | function is_multipage() |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | if (!$pos) return -1; |
23 | 23 | |
24 | 24 | global $wp; |
25 | - $url = home_url( $wp->request ); |
|
26 | - $index = intval(basename($url)) == 0 ? 0 : intval(basename($url))-1; |
|
25 | + $url = home_url($wp->request); |
|
26 | + $index = intval(basename($url)) == 0 ? 0 : intval(basename($url)) - 1; |
|
27 | 27 | echo $index; |
28 | 28 | return $index; |
29 | 29 | } |
30 | 30 | |
31 | - public function scripts(){ |
|
31 | + public function scripts() { |
|
32 | 32 | |
33 | 33 | |
34 | 34 | global $post; |
35 | - if ( lasso_user_can('edit_posts') |
|
35 | + if (lasso_user_can('edit_posts') |
|
36 | 36 | /* uncomment this line to disable Editus on Gutenberg posts*/ |
37 | 37 | /* && !( function_exists( 'has_blocks' ) && has_blocks( $post->post_content) && !is_home()) */ |
38 | 38 | ) { |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | /** Returns the time offset from UTC |
41 | 41 | */ |
42 | 42 | function get_UTC_offset() { |
43 | - $timezone_string = get_option( 'timezone_string' ); |
|
44 | - if (empty( $timezone_string ) ) { |
|
45 | - return get_option('gmt_offset')*3600; |
|
43 | + $timezone_string = get_option('timezone_string'); |
|
44 | + if (empty($timezone_string)) { |
|
45 | + return get_option('gmt_offset') * 3600; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $origin_dtz = new \DateTimeZone($timezone_string); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
55 | 55 | |
56 | 56 | //don't load autocomplete if it's a stockholm theme |
57 | - $themename = wp_get_theme()->get('Name'); |
|
58 | - if ($themename !='Stockholm' ) { |
|
57 | + $themename = wp_get_theme()->get('Name'); |
|
58 | + if ($themename != 'Stockholm') { |
|
59 | 59 | wp_enqueue_script('jquery-ui-autocomplete'); |
60 | 60 | } |
61 | 61 | wp_enqueue_script('jquery-ui-draggable'); |
@@ -68,28 +68,28 @@ discard block |
||
68 | 68 | // url for json api |
69 | 69 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
70 | 70 | |
71 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
71 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
72 | 72 | |
73 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
73 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
74 | 74 | |
75 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
76 | - if (empty( $featImgClass )) { |
|
75 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
76 | + if (empty($featImgClass)) { |
|
77 | 77 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
78 | 78 | } |
79 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
80 | - if (empty( $titleClass )) { |
|
79 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
80 | + if (empty($titleClass)) { |
|
81 | 81 | $titleClass = lasso_get_supported_theme_title_class(); |
82 | 82 | } |
83 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
84 | - $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
83 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
84 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
85 | 85 | $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
86 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
86 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
87 | 87 | $disableRESTSave = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
88 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
89 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
88 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
89 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
90 | 90 | |
91 | - $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor','b'); |
|
92 | - $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor','i'); |
|
91 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', 'b'); |
|
92 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', 'i'); |
|
93 | 93 | |
94 | 94 | |
95 | 95 | //text alignement |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | |
107 | 107 | if ($show_color) { |
108 | 108 | //color picker |
109 | - wp_enqueue_style( 'wp-color-picker' ); |
|
110 | - wp_enqueue_script( 'iris', admin_url( 'js/iris.min.js' ), array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); |
|
109 | + wp_enqueue_style('wp-color-picker'); |
|
110 | + wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | // click to insert components, not drag and drop |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | // custom fields |
121 | 121 | |
122 | - $custom_fields = apply_filters( 'editus_custom_fields', null ); //array('testFieldName' => '#field1'); |
|
122 | + $custom_fields = apply_filters('editus_custom_fields', null); //array('testFieldName' => '#field1'); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | |
@@ -127,47 +127,47 @@ discard block |
||
127 | 127 | $postid = get_the_ID(); |
128 | 128 | $tz_offset = get_UTC_offset(); |
129 | 129 | $post_date = get_the_time('U', $postid); |
130 | - $time = (time()+$tz_offset); |
|
130 | + $time = (time() + $tz_offset); |
|
131 | 131 | $delta = $time - $post_date; |
132 | 132 | |
133 | 133 | $strings = array( |
134 | - 'save' => __('Save','lasso'), |
|
135 | - 'selectText' => __('Please Select Text First.','lasso'), |
|
136 | - 'cancel' => __('Cancel','lasso'), |
|
137 | - 'exiteditor' => __('Exit Editor','lasso'), |
|
138 | - 'saving' => __('Saving...','lasso'), |
|
139 | - 'saved' => __('Saved!','lasso'), |
|
140 | - 'adding' => __('Adding...','lasso'), |
|
141 | - 'added' => __('Added!','lasso'), |
|
142 | - 'loading' => __('Loading...','lasso'), |
|
143 | - 'loadMore' => __('Load More','lasso'), |
|
144 | - 'close' => __('Close','lasso'), |
|
145 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
146 | - 'fetchFail' => __('Fetching failed.','lasso'), |
|
147 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
148 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
149 | - 'justWrite' => __('Just write...','lasso'), |
|
150 | - 'chooseImage' => __('Choose an image','lasso'), |
|
151 | - 'updateImage' => __('Update Image','lasso'), |
|
152 | - 'insertImage' => __('Insert Image','lasso'), |
|
153 | - 'selectImage' => __('Select Image','lasso'), |
|
154 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
155 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
156 | - 'chooseImages' => __('Choose images','lasso'), |
|
157 | - 'editImage' => __('Edit Image','lasso'), |
|
158 | - 'addImages' => __('Add Images','lasso'), |
|
159 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
160 | - 'selectGallery' => __('Select Editus Gallery Image','lasso'), |
|
161 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
162 | - 'publishPost' => __('Publish Post?','lasso'), |
|
163 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
164 | - 'deletePost' => __('Trash Post?','lasso'), |
|
165 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
166 | - 'warning' => __('Oh snap!','laso'), |
|
167 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
168 | - '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'), |
|
134 | + 'save' => __('Save', 'lasso'), |
|
135 | + 'selectText' => __('Please Select Text First.', 'lasso'), |
|
136 | + 'cancel' => __('Cancel', 'lasso'), |
|
137 | + 'exiteditor' => __('Exit Editor', 'lasso'), |
|
138 | + 'saving' => __('Saving...', 'lasso'), |
|
139 | + 'saved' => __('Saved!', 'lasso'), |
|
140 | + 'adding' => __('Adding...', 'lasso'), |
|
141 | + 'added' => __('Added!', 'lasso'), |
|
142 | + 'loading' => __('Loading...', 'lasso'), |
|
143 | + 'loadMore' => __('Load More', 'lasso'), |
|
144 | + 'close' => __('Close', 'lasso'), |
|
145 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
146 | + 'fetchFail' => __('Fetching failed.', 'lasso'), |
|
147 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
148 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
149 | + 'justWrite' => __('Just write...', 'lasso'), |
|
150 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
151 | + 'updateImage' => __('Update Image', 'lasso'), |
|
152 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
153 | + 'selectImage' => __('Select Image', 'lasso'), |
|
154 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
155 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
156 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
157 | + 'editImage' => __('Edit Image', 'lasso'), |
|
158 | + 'addImages' => __('Add Images', 'lasso'), |
|
159 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
160 | + 'selectGallery' => __('Select Editus Gallery Image', 'lasso'), |
|
161 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
162 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
163 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
164 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
165 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
166 | + 'warning' => __('Oh snap!', 'laso'), |
|
167 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
168 | + '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'), |
|
169 | 169 | 'missingConfirm' => __('Update Settings', 'lasso'), |
170 | - 'helperText' => __('one more letter','lasso'), |
|
170 | + 'helperText' => __('one more letter', 'lasso'), |
|
171 | 171 | 'editingBackup' => __('You are currently editing a backup copy of this post.'), |
172 | 172 | |
173 | 173 | 'catsPlaceholder' => __('add categories...'), |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | |
177 | 177 | ); |
178 | 178 | |
179 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
179 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
180 | 180 | |
181 | 181 | $gallery_class = new gallery(); |
182 | 182 | $gallery_nonce_action = $gallery_class->nonce_action; |
183 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
183 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
184 | 184 | |
185 | 185 | |
186 | 186 | if ($allow_change_date) { |
@@ -195,13 +195,13 @@ discard block |
||
195 | 195 | |
196 | 196 | if (function_exists('rest_url')) { |
197 | 197 | //$rest_root = esc_url_raw( rest_url()); |
198 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); |
|
199 | - $settings = array( 'root' => $rest_root, 'nonce' => $rest_nonce ); |
|
200 | - wp_enqueue_script( 'wp-api', '', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
201 | - wp_localize_script( 'wp-api', 'wpApiSettings', $settings ); |
|
202 | - wp_localize_script( 'wp-api', 'WP_API_Settings', $settings ); |
|
198 | + $rest_nonce = wp_create_nonce('wp_rest'); |
|
199 | + $settings = array('root' => $rest_root, 'nonce' => $rest_nonce); |
|
200 | + wp_enqueue_script('wp-api', '', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
201 | + wp_localize_script('wp-api', 'wpApiSettings', $settings); |
|
202 | + wp_localize_script('wp-api', 'WP_API_Settings', $settings); |
|
203 | 203 | |
204 | - if ( class_exists( 'WP_REST_Controller' )) { |
|
204 | + if (class_exists('WP_REST_Controller')) { |
|
205 | 205 | // we are using REST API V2 |
206 | 206 | $using_restapiv2 = true; |
207 | 207 | } |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | |
217 | 217 | // localized objects |
218 | 218 | $objects = array( |
219 | - 'ajaxurl' => esc_url( $api_url ), |
|
220 | - 'ajaxurl2' => esc_url( admin_url( 'admin-ajax.php' )), |
|
219 | + 'ajaxurl' => esc_url($api_url), |
|
220 | + 'ajaxurl2' => esc_url(admin_url('admin-ajax.php')), |
|
221 | 221 | 'siteUrl' => site_url(), |
222 | 222 | 'rest_root' => $rest_root, |
223 | 223 | 'rest_nonce' => $rest_nonce, |
@@ -226,13 +226,13 @@ discard block |
||
226 | 226 | 'featImgClass' => $featImgClass, |
227 | 227 | 'titleClass' => $titleClass, |
228 | 228 | 'strings' => $strings, |
229 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
230 | - 'post_status' => get_post_status( $postid ), |
|
229 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
230 | + 'post_status' => get_post_status($postid), |
|
231 | 231 | 'postid' => $postid, |
232 | 232 | 'permalink' => $permalink, |
233 | 233 | 'edit_others_pages' => current_user_can('edit_others_pages') ? true : false, |
234 | 234 | 'edit_others_posts' => current_user_can('edit_others_posts') ? true : false, |
235 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
235 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
236 | 236 | 'can_publish' => is_page() ? current_user_can('publish_pages') : current_user_can('publish_posts'), |
237 | 237 | //'can_publish_posts' => current_user_can('publish_posts'), |
238 | 238 | //'can_publish_pages' => current_user_can('publish_pages'), |
@@ -268,32 +268,32 @@ discard block |
||
268 | 268 | 'postTags' => lasso_get_objects('tag'), |
269 | 269 | 'noResultsDiv' => lasso_editor_empty_results(), |
270 | 270 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
271 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
272 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
273 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
274 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
271 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
272 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
273 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
274 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
275 | 275 | 'revisionModal' => lasso_editor_revision_modal(), |
276 | 276 | 'isMobile' => wp_is_mobile(), |
277 | - 'enableAutoSave' => lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ), |
|
277 | + 'enableAutoSave' => lasso_editor_get_option('enable_autosave', 'lasso_editor'), |
|
278 | 278 | 'showColor' => $show_color, |
279 | 279 | 'showAlignment' => $show_align, |
280 | 280 | 'showIgnoredItems' => lasso_editor_get_option('show_ignored_items', 'lasso_editor'), |
281 | 281 | 'restapi2' => $using_restapiv2, |
282 | 282 | 'saveusingrest' => $using_restapiv2 && !$disableRESTSave, |
283 | - 'newObjectContent' => '<p>'.apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ).'</p>', |
|
283 | + 'newObjectContent' => '<p>'.apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')).'</p>', |
|
284 | 284 | 'disableSavePost' => $save_to_post_disabled, |
285 | 285 | 'disableEditPost' => $edit_post_disabled, |
286 | 286 | 'boldTag' => $bold_tag, |
287 | 287 | 'iTag' => $i_tag, |
288 | 288 | 'customFields' => $custom_fields, |
289 | - 'clickToInsert' => ($insert_comp_ui =='click'), |
|
290 | - 'buttonOnEmptyP' => ($insert_comp_ui =='mediumcom'), // auto show a button to insert components on an empty paragraph |
|
289 | + 'clickToInsert' => ($insert_comp_ui == 'click'), |
|
290 | + 'buttonOnEmptyP' => ($insert_comp_ui == 'mediumcom'), // auto show a button to insert components on an empty paragraph |
|
291 | 291 | 'rtl' => is_rtl(), |
292 | - 'skipToEdit' =>( $delta < 10 && $delta >=0 ), // if it's a new post, skip to edit mode |
|
292 | + 'skipToEdit' =>($delta < 10 && $delta >= 0), // if it's a new post, skip to edit mode |
|
293 | 293 | 'linksEditable' => $links_editable, |
294 | 294 | 'supportPendingStatus' => !$no_pending_status, |
295 | - 'tableCode' => apply_filters( 'lasso_table_html_code','<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table>'), |
|
296 | - 'hasGutenberg' => (function_exists( 'has_blocks' ) && has_blocks( $post->post_content)), |
|
295 | + 'tableCode' => apply_filters('lasso_table_html_code', '<table><tr><th>Cell 1</th><th>Cell 2</th></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table>'), |
|
296 | + 'hasGutenberg' => (function_exists('has_blocks') && has_blocks($post->post_content)), |
|
297 | 297 | 'multipages'=> $multipage, |
298 | 298 | 'post_content'=>$post_content |
299 | 299 | ); |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | |
305 | 305 | if (!$using_restapiv2) { |
306 | 306 | // enqueue REST API V1 |
307 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
308 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
309 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
307 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
308 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
309 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | if ($allow_change_date) { |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | wp_enqueue_style('jquery-ui'); |
316 | 316 | } |
317 | 317 | |
318 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
318 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
319 | 319 | if ($show_color) { |
320 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api','iris'), LASSO_VERSION, true); |
|
320 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api', 'iris'), LASSO_VERSION, true); |
|
321 | 321 | } else { |
322 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
322 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery', 'wp-api'), LASSO_VERSION, true); |
|
323 | 323 | } |
324 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
324 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
325 | 325 | |
326 | 326 | |
327 | 327 | } |
@@ -18,27 +18,27 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | // If this file is called directly, abort. |
21 | -if ( ! defined( 'WPINC' ) ) { |
|
21 | +if (!defined('WPINC')) { |
|
22 | 22 | die; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Set some constants |
26 | -define( 'LASSO_VERSION', '1.2.0' ); |
|
27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
29 | -define( 'LASSO_FILE', __FILE__ ); |
|
26 | +define('LASSO_VERSION', '1.2.0'); |
|
27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
29 | +define('LASSO_FILE', __FILE__); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Load plugin if PHP version is 5.4 or later. |
33 | 33 | */ |
34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
35 | 35 | |
36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
37 | 37 | |
38 | 38 | } else { |
39 | 39 | |
40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
41 | - function lasso_fail_notice(){ |
|
41 | + function lasso_fail_notice() { |
|
42 | 42 | |
43 | 43 | printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>'); |
44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
49 | -function lasso_show_in_rest($args, $post_type){ |
|
49 | +function lasso_show_in_rest($args, $post_type) { |
|
50 | 50 | |
51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
53 | + if (in_array($post_type, $allowed_post_types)) { |
|
54 | 54 | $args['show_in_rest'] = true; |
55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
65 | 65 | |
66 | - if ( empty( $option ) ) |
|
66 | + if (empty($option)) |
|
67 | 67 | return; |
68 | 68 | |
69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
70 | 70 | |
71 | - $options = get_site_option( $section ); |
|
71 | + $options = get_site_option($section); |
|
72 | 72 | |
73 | 73 | } else { |
74 | 74 | |
75 | - $options = get_option( $section ); |
|
75 | + $options = get_option($section); |
|
76 | 76 | } |
77 | 77 | |
78 | - if ( isset( $options[$option] ) ) { |
|
78 | + if (isset($options[$option])) { |
|
79 | 79 | return $options[$option]; |
80 | 80 | } |
81 | 81 | |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | )); |
89 | 89 | |
90 | 90 | // Gutenberg |
91 | -if( function_exists( 'is_gutenberg_page' ) ) { |
|
92 | - function add_raw_to_post( $response, $post, $request ) { |
|
91 | +if (function_exists('is_gutenberg_page')) { |
|
92 | + function add_raw_to_post($response, $post, $request) { |
|
93 | 93 | $response_data = $response->get_data(); |
94 | - if ( is_array( $response_data['content'] )) { |
|
95 | - $response_data['content']['raw'] = $post->post_content ; |
|
96 | - $response->set_data( $response_data ); |
|
94 | + if (is_array($response_data['content'])) { |
|
95 | + $response_data['content']['raw'] = $post->post_content; |
|
96 | + $response->set_data($response_data); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $response; |
100 | 100 | } |
101 | - add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 ); |
|
101 | + add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3); |
|
102 | 102 | } |
103 | 103 |