@@ -71,23 +71,26 @@ |
||
71 | 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 | - <?php else : |
|
74 | + <?php else { |
|
75 | + : |
|
75 | 76 | |
76 | 77 | $checks = self::lasso_preflight_check(); |
78 | +} |
|
77 | 79 | |
78 | 80 | if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
79 | 81 | |
80 | 82 | foreach ( (array) $checks as $key => $check ) { |
81 | 83 | |
82 | 84 | echo $check; |
83 | - } |
|
84 | - |
|
85 | - else: |
|
85 | + } else { |
|
86 | + : |
|
86 | 87 | |
87 | 88 | // pre-flight is go for flight |
88 | 89 | ?> |
89 | 90 | <li class="success"> |
90 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
91 | + <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' ); |
|
92 | + } |
|
93 | + ?></h3> |
|
91 | 94 | <?php if ( lasso_get_supported_theme_class() ) { ?> |
92 | 95 | <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
93 | 96 | <?php } ?> |
@@ -204,49 +204,49 @@ |
||
204 | 204 | */ |
205 | 205 | function required_plugins() { |
206 | 206 | |
207 | - $plugins = array( |
|
208 | - |
|
209 | - array( |
|
210 | - 'name' => __('Aesop Story Engine','lasso'), |
|
211 | - 'slug' => 'aesop-story-engine', |
|
212 | - 'required' => false, |
|
213 | - ), |
|
214 | - |
|
215 | - ); |
|
216 | - |
|
217 | - $config = array( |
|
218 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
219 | - 'menu' => 'lasso-install-plugins', // Menu slug. |
|
220 | - 'has_notices' => true, // Show admin notices or not. |
|
221 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
222 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
223 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
224 | - 'message' => '', // Message to output right before the plugins table. |
|
225 | - 'strings' => array( |
|
226 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
227 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
228 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
229 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
230 | - 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
231 | - 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
232 | - 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
233 | - 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
234 | - 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
235 | - 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
236 | - 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
237 | - 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
238 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
239 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
240 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
241 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
242 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
243 | - 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
|
244 | - ) |
|
245 | - ); |
|
207 | + $plugins = array( |
|
208 | + |
|
209 | + array( |
|
210 | + 'name' => __('Aesop Story Engine','lasso'), |
|
211 | + 'slug' => 'aesop-story-engine', |
|
212 | + 'required' => false, |
|
213 | + ), |
|
214 | + |
|
215 | + ); |
|
216 | + |
|
217 | + $config = array( |
|
218 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
219 | + 'menu' => 'lasso-install-plugins', // Menu slug. |
|
220 | + 'has_notices' => true, // Show admin notices or not. |
|
221 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
222 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
223 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
224 | + 'message' => '', // Message to output right before the plugins table. |
|
225 | + 'strings' => array( |
|
226 | + 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
227 | + 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
228 | + 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
229 | + 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
230 | + 'notice_can_install_required' => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
231 | + 'notice_can_install_recommended' => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s). |
|
232 | + 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s). |
|
233 | + 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
234 | + 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s). |
|
235 | + 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s). |
|
236 | + 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s). |
|
237 | + 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s). |
|
238 | + 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
239 | + 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
240 | + 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
241 | + 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
242 | + 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
243 | + 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
|
244 | + ) |
|
245 | + ); |
|
246 | 246 | |
247 | 247 | $plugins = apply_filters( 'lasso_required_plugins', $plugins ); |
248 | 248 | |
249 | - tgmpa( $plugins, $config ); |
|
249 | + tgmpa( $plugins, $config ); |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | } |
@@ -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' )) { |
|
153 | + if (function_exists('is_gutenberg_page')) { |
|
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 | } |
@@ -76,9 +76,13 @@ |
||
76 | 76 | |
77 | 77 | /* a helper function */ |
78 | 78 | function strpos_arr($haystack, $needle) { |
79 | - if(!is_array($needle)) $needle = array($needle); |
|
79 | + if(!is_array($needle)) { |
|
80 | + $needle = array($needle); |
|
81 | + } |
|
80 | 82 | foreach($needle as $what) { |
81 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
83 | + if(($pos = strpos($haystack, $what))!==false) { |
|
84 | + return $pos; |
|
85 | + } |
|
82 | 86 | } |
83 | 87 | return false; |
84 | 88 | } |
85 | 89 | \ No newline at end of file |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ( strpos( $m[2],'aesop_' ) === 0 ) { |
69 | 69 | // check against the exceptions |
70 | 70 | if (strpos_arr($m[2],$exception_arr1)===false) { |
71 | - return $m[0]; |
|
71 | + return $m[0]; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | if (strpos_arr($m[2],$exception_arr2)!==false) { |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | |
81 | 81 | /* a helper function */ |
82 | 82 | function strpos_arr($haystack, $needle) { |
83 | - if(!is_array($needle)) $needle = array($needle); |
|
84 | - foreach($needle as $what) { |
|
85 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
86 | - } |
|
87 | - return false; |
|
83 | + if(!is_array($needle)) $needle = array($needle); |
|
84 | + foreach($needle as $what) { |
|
85 | + if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
86 | + } |
|
87 | + return false; |
|
88 | 88 | } |
89 | 89 | \ No newline at end of file |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | -if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) { |
|
10 | - add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 ); |
|
9 | +if (lasso_user_can('edit_posts') && !is_admin()) { |
|
10 | + add_filter('the_content', 'lasso_wrap_shortcodes', 9); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | /** |
@@ -20,33 +20,33 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return string |
22 | 22 | */ |
23 | -function lasso_wrap_shortcodes( $content ) { |
|
23 | +function lasso_wrap_shortcodes($content) { |
|
24 | 24 | global $shortcode_tags; |
25 | 25 | |
26 | - if ( false === strpos( $content, '[' ) ) { |
|
26 | + if (false === strpos($content, '[')) { |
|
27 | 27 | return $content; |
28 | 28 | } |
29 | 29 | |
30 | - if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) { |
|
30 | + if (empty($shortcode_tags) || !is_array($shortcode_tags)) { |
|
31 | 31 | return $content; |
32 | 32 | } |
33 | 33 | |
34 | - $tagnames = array_keys( $shortcode_tags ); |
|
35 | - $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); |
|
34 | + $tagnames = array_keys($shortcode_tags); |
|
35 | + $tagregexp = join('|', array_map('preg_quote', $tagnames)); |
|
36 | 36 | $pattern = "/\\[($tagregexp)/s"; |
37 | 37 | |
38 | - if ( 0 === preg_match( $pattern, $content ) ) { |
|
38 | + if (0 === preg_match($pattern, $content)) { |
|
39 | 39 | // Avoids parsing HTML when there are no shortcodes or embeds anyway. |
40 | 40 | return $content; |
41 | 41 | } |
42 | 42 | |
43 | - $content = do_shortcodes_in_html_tags( $content, true ,$tagnames); |
|
43 | + $content = do_shortcodes_in_html_tags($content, true, $tagnames); |
|
44 | 44 | |
45 | 45 | $pattern = get_shortcode_regex(); |
46 | - $content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content ); |
|
46 | + $content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content); |
|
47 | 47 | |
48 | 48 | // Always restore square braces so we don't break things like <!--[if IE ]> |
49 | - $content = unescape_invalid_shortcodes( $content ); |
|
49 | + $content = unescape_invalid_shortcodes($content); |
|
50 | 50 | |
51 | 51 | return $content; |
52 | 52 | } |
@@ -60,33 +60,33 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return string |
62 | 62 | */ |
63 | -function lasso_wrap_shortcode_tag( $m ) { |
|
63 | +function lasso_wrap_shortcode_tag($m) { |
|
64 | 64 | // allow [[foo]] syntax for escaping a tag |
65 | - if ( $m[1] == '[' && $m[6] == ']' ) { |
|
66 | - return substr( $m[0], 1, - 1 ); |
|
65 | + if ($m[1] == '[' && $m[6] == ']') { |
|
66 | + return substr($m[0], 1, - 1); |
|
67 | 67 | } |
68 | - $exception_arr1 = array('aesop_gallery_pop','aesop_character_carousel'); |
|
69 | - $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler','av_textblock','av_toggle_container','av_toggle'); |
|
70 | - $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions',$exception_arr2); |
|
68 | + $exception_arr1 = array('aesop_gallery_pop', 'aesop_character_carousel'); |
|
69 | + $exception_arr2 = array('su_box', 'su_note', 'su_document', 'su_spoiler', 'av_textblock', 'av_toggle_container', 'av_toggle'); |
|
70 | + $exception_arr2 = apply_filters('lasso_wrap_shortcode_exceptions', $exception_arr2); |
|
71 | 71 | |
72 | - if ( strpos( $m[2],'aesop_' ) === 0 ) { |
|
72 | + if (strpos($m[2], 'aesop_') === 0) { |
|
73 | 73 | // check against the exceptions |
74 | - if (strpos_arr($m[2],$exception_arr1)===false) { |
|
74 | + if (strpos_arr($m[2], $exception_arr1) === false) { |
|
75 | 75 | return $m[0]; |
76 | 76 | } |
77 | 77 | } |
78 | - if (strpos_arr($m[2],$exception_arr2)!==false) { |
|
78 | + if (strpos_arr($m[2], $exception_arr2) !== false) { |
|
79 | 79 | return $m[0]; |
80 | 80 | } |
81 | 81 | |
82 | - return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
82 | + return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->'; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /* a helper function */ |
86 | 86 | function strpos_arr($haystack, $needle) { |
87 | - if(!is_array($needle)) $needle = array($needle); |
|
88 | - foreach($needle as $what) { |
|
89 | - if(($pos = strpos($haystack, $what))!==false) return $pos; |
|
87 | + if (!is_array($needle)) $needle = array($needle); |
|
88 | + foreach ($needle as $what) { |
|
89 | + if (($pos = strpos($haystack, $what)) !== false) return $pos; |
|
90 | 90 | } |
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -12,65 +12,65 @@ |
||
12 | 12 | /** |
13 | 13 | * Update an existing galleries options |
14 | 14 | */ |
15 | - public static function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
15 | + public static function save_gallery_options($postid, $gallery_ids, $options, $type = false) { |
|
16 | 16 | |
17 | 17 | // gallery width |
18 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
18 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
19 | 19 | |
20 | 20 | // gallery grid item width |
21 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
21 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
22 | 22 | |
23 | 23 | // caption |
24 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
24 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
25 | 25 | |
26 | 26 | // gallery transition |
27 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
27 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
28 | 28 | |
29 | 29 | // gallery transition speed |
30 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
30 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
31 | 31 | |
32 | 32 | // gallery hide thumbs |
33 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
33 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
34 | 34 | |
35 | 35 | // photoset layout hardwired to on for now |
36 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
36 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
37 | 37 | |
38 | 38 | // photoset layout |
39 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
39 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
40 | 40 | |
41 | 41 | // hero gallery height |
42 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
42 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
43 | 43 | |
44 | 44 | // update gallery ids |
45 | - if ( !empty( $gallery_ids ) ) { |
|
45 | + if (!empty($gallery_ids)) { |
|
46 | 46 | |
47 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
47 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
48 | 48 | |
49 | 49 | } |
50 | 50 | |
51 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
51 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
52 | 52 | |
53 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
53 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
54 | 54 | |
55 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
55 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
56 | 56 | |
57 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
57 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
58 | 58 | |
59 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
59 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
60 | 60 | |
61 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
61 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
62 | 62 | |
63 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
63 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
64 | 64 | |
65 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
65 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
66 | 66 | |
67 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
67 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
68 | 68 | |
69 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
69 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
70 | 70 | |
71 | 71 | //hardwired for now |
72 | 72 | |
73 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
73 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | ob_start(); |
13 | 13 | |
14 | - if ( $galleries ) { ?> |
|
14 | + if ($galleries) { ?> |
|
15 | 15 | |
16 | - <?php if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
16 | + <?php if (lasso_user_can('publish_posts')): ?> |
|
17 | 17 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" style="display:inline !important; postion:relative !important;left:12px !important"> |
18 | 18 | <div class="ase-gallery-opts--single lasso-option"> |
19 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e( 'Create gallery', 'lasso' );?></a> |
|
19 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__create"><?php _e('Create gallery', 'lasso'); ?></a> |
|
20 | 20 | </div> |
21 | 21 | </div> |
22 | 22 | <?php endif; ?> |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | <div class="ase-gallery-opts ase-gallery-opts--edit-gallery" > |
25 | 25 | <div class="ase-gallery-opts--single lasso-option"> |
26 | 26 | |
27 | - <label><?php _e( 'Manage Images', 'lasso' );?> |
|
28 | - <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e( 'Add Images', 'lasso' );?>"><i class="lasso-icon-pencil"></i></a> |
|
27 | + <label><?php _e('Manage Images', 'lasso'); ?> |
|
28 | + <a href="#" id="ase-gallery-add-image" class="lasso-editor-tiny-btn" title="<?php esc_attr_e('Add Images', 'lasso'); ?>"><i class="lasso-icon-pencil"></i></a> |
|
29 | 29 | |
30 | 30 | </label> |
31 | - <small class="lasso-option-desc"><?php _e( 'Rearrange or edit the images in this gallery.', 'lasso' );?></small> |
|
31 | + <small class="lasso-option-desc"><?php _e('Rearrange or edit the images in this gallery.', 'lasso'); ?></small> |
|
32 | 32 | |
33 | 33 | <div id="lasso--gallery__images"><span class="lasso-icon-spinner6"></span></div> |
34 | 34 | |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | |
39 | 39 | <?php } |
40 | 40 | |
41 | - if ( lasso_user_can( 'publish_posts' ) ): ?> |
|
41 | + if (lasso_user_can('publish_posts')): ?> |
|
42 | 42 | |
43 | 43 | <div class="ase-gallery-opts ase-gallery-opts--create-gallery" > |
44 | 44 | |
45 | 45 | <div class="ase-gallery-opts--single lasso-option"> |
46 | 46 | |
47 | - <label><?php _e( 'Create a Gallery', 'lasso' );?></label> |
|
47 | + <label><?php _e('Create a Gallery', 'lasso'); ?></label> |
|
48 | 48 | <small class="lasso-option-desc">Gallery Name:</small> |
49 | 49 | <input type="text" id="lasso--gallery__galleryname" value="New Gallery"><br> |
50 | 50 | |
51 | - <small class="lasso-option-desc"><?php _e( 'Select images to create a gallery.', 'lasso' );?></small> |
|
52 | - <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e( 'Select Images', 'lasso' );?></a> |
|
51 | + <small class="lasso-option-desc"><?php _e('Select images to create a gallery.', 'lasso'); ?></small> |
|
52 | + <a href="#" class="editor-btn-secondary" id="lasso--gallery__selectImages"><?php _e('Select Images', 'lasso'); ?></a> |
|
53 | 53 | |
54 | 54 | <div id="ase-gallery-images"></div> |
55 | 55 | |
56 | - <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr( strtolower( the_title_attribute() ) );?>" id="lasso--gallery__save" href="#"><?php _e( 'Create Gallery', 'lasso' );?></a> |
|
56 | + <a style="display:none;" class="editor-btn-secondary" data-post-title="<?php echo esc_attr(strtolower(the_title_attribute())); ?>" id="lasso--gallery__save" href="#"><?php _e('Create Gallery', 'lasso'); ?></a> |
|
57 | 57 | |
58 | 58 | </div> |
59 | 59 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | <!-- Gallery Layout/Type Chooser --> |
65 | 65 | <div class="ase-gallery-opts ase-gallery-opts--type" > |
66 | 66 | <div data-option="gallery-type" class="ase-gallery-opts--single lasso-option"> |
67 | - <label><?php _e( 'Gallery Type', 'lasso' );?></label> |
|
68 | - <small class="lasso-option-desc"><?php _e( 'Select the type of gallery.', 'lasso' );?></small> |
|
67 | + <label><?php _e('Gallery Type', 'lasso'); ?></label> |
|
68 | + <small class="lasso-option-desc"><?php _e('Select the type of gallery.', 'lasso'); ?></small> |
|
69 | 69 | <fieldset> |
70 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e( 'Grid', 'lasso' );?></label> |
|
71 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e( 'Thumbnail', 'lasso' );?></label> |
|
70 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="grid"><?php _e('Grid', 'lasso'); ?></label> |
|
71 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="thumbnail"><?php _e('Thumbnail', 'lasso'); ?></label> |
|
72 | 72 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="sequence">Sequence</label> |
73 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e( 'Photoset', 'lasso' );?></label> |
|
74 | - <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e( 'Parallax', 'lasso' );?></label> |
|
73 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="photoset"><?php _e('Photoset', 'lasso'); ?></label> |
|
74 | + <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="stacked"><?php _e('Parallax', 'lasso'); ?></label> |
|
75 | 75 | <label for="lasso_gallery_type" class="ase-gallery-layout-label"><input class="lasso-generator-attr ase-gallery-type-radio" type="radio" name="lasso_gallery_type" value="hero">Hero</label> |
76 | 76 | </fieldset> |
77 | 77 | </div> |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | <div class="ase-gallery-opts ase-gallery-opts--grid" style="display:none;"> |
82 | 82 | |
83 | 83 | <div data-option="itemwidth" class="ase-gallery-opts--single lasso-option"> |
84 | - <label for="lasso_grid_gallery_width"><?php _e( 'Grid Item Width', 'lasso' );?></label> |
|
85 | - <small class="lasso-option-desc"><?php _e( 'Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso' );?></small> |
|
84 | + <label for="lasso_grid_gallery_width"><?php _e('Grid Item Width', 'lasso'); ?></label> |
|
85 | + <small class="lasso-option-desc"><?php _e('Adjust the width of the individual grid items, only if using Grid gallery style. Default is 400.', 'lasso'); ?></small> |
|
86 | 86 | <input type="text_small" class="lasso-generator-attr" name="lasso_grid_gallery_width" value=""> |
87 | 87 | </div> |
88 | 88 | |
@@ -92,24 +92,24 @@ discard block |
||
92 | 92 | <div class="ase-gallery-opts ase-gallery-opts--thumb" style="display:none;"> |
93 | 93 | |
94 | 94 | <div data-option="transition" class="ase-gallery-opts--single lasso-option"> |
95 | - <label for="lasso_thumb_gallery_transition"><?php _e( 'Gallery Transition', 'lasso' );?></label> |
|
96 | - <small class="lasso-option-desc"><?php _e( 'Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso' );?></small> |
|
95 | + <label for="lasso_thumb_gallery_transition"><?php _e('Gallery Transition', 'lasso'); ?></label> |
|
96 | + <small class="lasso-option-desc"><?php _e('Adjust the transition effect for the Thumbnail gallery. Default is slide.', 'lasso'); ?></small> |
|
97 | 97 | <select name="lasso_thumb_gallery_transition" class="lasso-generator-attr"> |
98 | - <option value="crossfade"><?php _e( 'Fade', 'lasso' );?></option> |
|
99 | - <option value="slide"><?php _e( 'Slide', 'lasso' );?></option> |
|
100 | - <option value="dissolve"><?php _e( 'Dissolve', 'lasso' );?></option> |
|
98 | + <option value="crossfade"><?php _e('Fade', 'lasso'); ?></option> |
|
99 | + <option value="slide"><?php _e('Slide', 'lasso'); ?></option> |
|
100 | + <option value="dissolve"><?php _e('Dissolve', 'lasso'); ?></option> |
|
101 | 101 | </select> |
102 | 102 | </div> |
103 | 103 | |
104 | 104 | <div data-option="speed" class="ase-gallery-opts--single lasso-option"> |
105 | - <label for="lasso_thumb_gallery_transition_speed"><?php _e( 'Gallery Transition Speed', 'lasso' );?></label> |
|
106 | - <small class="lasso-option-desc"><?php _e( 'Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso' );?></small> |
|
105 | + <label for="lasso_thumb_gallery_transition_speed"><?php _e('Gallery Transition Speed', 'lasso'); ?></label> |
|
106 | + <small class="lasso-option-desc"><?php _e('Activate slideshow by setting a speed for the transition.5000 = 5 seconds.', 'lasso'); ?></small> |
|
107 | 107 | <input type="text" class="lasso-generator-attr" name="lasso_thumb_gallery_transition_speed" value=""> |
108 | 108 | </div> |
109 | 109 | |
110 | 110 | <div data-option="hide-thumbs" class="ase-gallery-opts--single lasso-option"> |
111 | 111 | <input class="lasso-generator-attr" type="checkbox" name="lasso_thumb_gallery_hide_thumbs"> |
112 | - <label for="lasso_thumb_gallery_hide_thumbs"><?php _e( 'Hide Gallery Thumbnails', 'lasso' );?></label> |
|
112 | + <label for="lasso_thumb_gallery_hide_thumbs"><?php _e('Hide Gallery Thumbnails', 'lasso'); ?></label> |
|
113 | 113 | </div> |
114 | 114 | |
115 | 115 | </div> |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | <div class="ase-gallery-opts ase-gallery-opts--photoset" style="display:none;"> |
119 | 119 | |
120 | 120 | <div data-option="pslayout" class="ase-gallery-opts--single lasso-option"> |
121 | - <label for="lasso-photoset-gallery-layout"><?php _e( 'Gallery Layout', 'lasso' );?></label> |
|
122 | - <small class="lasso-option-desc"><?php _e( 'Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso' );?></small> |
|
121 | + <label for="lasso-photoset-gallery-layout"><?php _e('Gallery Layout', 'lasso'); ?></label> |
|
122 | + <small class="lasso-option-desc"><?php _e('Let\'s say you have 4 images in this gallery. If you enter 121 you will have one image on the top row, two images on the second row, and one image on the third row.', 'lasso'); ?></small> |
|
123 | 123 | <input type="text" class="lasso-generator-attr" name="lasso_photoset_gallery_layout" value=""> |
124 | 124 | </div> |
125 | 125 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | <div class="ase-gallery-opts ase-gallery-opts--hero" style="display:none;"> |
135 | 135 | |
136 | 136 | <div data-option="height" class="ase-gallery-opts--single lasso-option"> |
137 | - <label for="lasso_gallery_height"><?php _e( 'Main Gallery Height', 'lasso' );?></label> |
|
138 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
137 | + <label for="lasso_gallery_height"><?php _e('Main Gallery Height', 'lasso'); ?></label> |
|
138 | + <small class="lasso-option-desc"><?php _e('Adjust the overall height of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
139 | 139 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_height" value=""> |
140 | 140 | </div> |
141 | 141 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | <div class="ase-gallery-opts ase-gallery-opts--global"> |
146 | 146 | |
147 | 147 | <div data-option="width" class="ase-gallery-opts--single lasso-option"> |
148 | - <label for="lasso_gallery_width"><?php _e( 'Main Gallery Width', 'lasso' );?></label> |
|
149 | - <small class="lasso-option-desc"><?php _e( 'Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso' );?></small> |
|
148 | + <label for="lasso_gallery_width"><?php _e('Main Gallery Width', 'lasso'); ?></label> |
|
149 | + <small class="lasso-option-desc"><?php _e('Adjust the overall width of the gallery. Acceptable values include 500px or 50% etc.', 'lasso'); ?></small> |
|
150 | 150 | <input type="text_small" class="lasso-generator-attr" name="lasso_gallery_width" value=""> |
151 | 151 | </div> |
152 | 152 | <div data-option="caption" class="ase-gallery-opts--single lasso-option"> |
153 | - <label for="lasso_gallery_caption"><?php _e( 'Gallery Caption', 'lasso' );?></label> |
|
154 | - <small class="lasso-option-desc"><?php _e( 'Add an optional caption for the gallery.', 'lasso' );?></small> |
|
153 | + <label for="lasso_gallery_caption"><?php _e('Gallery Caption', 'lasso'); ?></label> |
|
154 | + <small class="lasso-option-desc"><?php _e('Add an optional caption for the gallery.', 'lasso'); ?></small> |
|
155 | 155 | <textarea name="lasso_gallery_caption" class="lasso-generator-attr"></textarea> |
156 | 156 | </div> |
157 | 157 |
@@ -11,16 +11,16 @@ discard block |
||
11 | 11 | |
12 | 12 | public function __construct() { |
13 | 13 | |
14 | - $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
14 | + $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
|
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * Draw the modal used to house the walk through |
|
22 | - * @since 0.6 |
|
23 | - */ |
|
21 | + * Draw the modal used to house the walk through |
|
22 | + * @since 0.6 |
|
23 | + */ |
|
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | 26 | $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Draw the inner slides for the welcome walkthrough |
|
84 | - * @since 0.6 |
|
85 | - */ |
|
83 | + * Draw the inner slides for the welcome walkthrough |
|
84 | + * @since 0.6 |
|
85 | + */ |
|
86 | 86 | public function tour_slides() { ?> |
87 | 87 | |
88 | 88 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
15 | 15 | if (!$disable_tour) { |
16 | - add_action( 'wp_footer', array( $this, 'draw_tour' ) ); |
|
16 | + add_action('wp_footer', array($this, 'draw_tour')); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function draw_tour() { |
25 | 25 | |
26 | - $tour_hidden = get_user_meta( get_current_user_ID(), 'lasso_hide_tour', true ); |
|
26 | + $tour_hidden = get_user_meta(get_current_user_ID(), 'lasso_hide_tour', true); |
|
27 | 27 | |
28 | - if ( lasso_user_can() && !$tour_hidden ) { |
|
28 | + if (lasso_user_can() && !$tour_hidden) { |
|
29 | 29 | |
30 | 30 | global $post; |
31 | 31 | |
32 | - $nonce = wp_create_nonce( 'lasso-editor-tour' ); |
|
32 | + $nonce = wp_create_nonce('lasso-editor-tour'); |
|
33 | 33 | |
34 | 34 | // let users add custom css classes |
35 | - $custom_classes = apply_filters( 'lasso_modal_tour_classes', '' ); |
|
35 | + $custom_classes = apply_filters('lasso_modal_tour_classes', ''); |
|
36 | 36 | |
37 | 37 | ?> |
38 | - <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class( $custom_classes );?>"> |
|
38 | + <div id="lasso--tour__modal" class="lasso--modal lasso--tour__modal lasso--modal__checkbox <?php echo sanitize_html_class($custom_classes); ?>"> |
|
39 | 39 | <script> |
40 | 40 | (function( $ ) { |
41 | 41 | $(document).ready(function(){ |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | </script> |
57 | 57 | <div class="lasso--modal__inner"> |
58 | 58 | |
59 | - <?php echo self::tour_slides();?> |
|
59 | + <?php echo self::tour_slides(); ?> |
|
60 | 60 | |
61 | 61 | <div class="lasso--postsettings__footer"> |
62 | 62 | |
63 | 63 | <div class="lasso--postsettings__option"> |
64 | 64 | <label for="hide_tour" class="checkbox-control checkbox"> |
65 | - <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked( $tour_hidden, 1 ); ?>> |
|
65 | + <input type="checkbox" id="hide_tour" name="hide_tour" <?php checked($tour_hidden, 1); ?>> |
|
66 | 66 | <span class="control-indicator"></span> |
67 | - <?php _e('Don\'t show this again','lasso');?> |
|
67 | + <?php _e('Don\'t show this again', 'lasso'); ?> |
|
68 | 68 | </label> |
69 | 69 | </div> |
70 | 70 | |
71 | - <input id ="editus_tour_submit" type="submit" value="<?php _e( 'Okay, got it!', 'lasso' );?>" data-nonce="<?php echo $nonce;?>" > |
|
71 | + <input id ="editus_tour_submit" type="submit" value="<?php _e('Okay, got it!', 'lasso'); ?>" data-nonce="<?php echo $nonce; ?>" > |
|
72 | 72 | </div> |
73 | 73 | |
74 | 74 | </div> |
@@ -92,20 +92,20 @@ discard block |
||
92 | 92 | <?php |
93 | 93 | |
94 | 94 | $out = '<ul><li>'; |
95 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg' ); |
|
96 | - $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.','lasso').'</p>'; |
|
95 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-1.jpg'); |
|
96 | + $out .= '<p>'.__('Access posts by clicking the list icon. Create a new post by clicking the new post icon.', 'lasso').'</p>'; |
|
97 | 97 | $out .= '</li><li>'; |
98 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg' ); |
|
99 | - $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.','lasso').'</p>'; |
|
98 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-2.jpg'); |
|
99 | + $out .= '<p>'.__('While on a single post, edit by clicking the Pen icon. Access post settings with the settings icon. Press escape to exit any modal.', 'lasso').'</p>'; |
|
100 | 100 | $out .= '</li><li>'; |
101 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg' ); |
|
102 | - $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.','lasso').'</p>'; |
|
101 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-3.jpg'); |
|
102 | + $out .= '<p>'.__('Highlight a piece of text, and click on a formatting option to style it. Click the Disk icon or CMD-S to save. Click the orange "X" button to exit the editor.', 'lasso').'</p>'; |
|
103 | 103 | $out .= '</li><li>'; |
104 | - $out .= sprintf( '<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg' ); |
|
105 | - $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.','lasso').'</p>'; |
|
104 | + $out .= sprintf('<img src="%s">', LASSO_URL.'/public/assets/img/s-4.jpg'); |
|
105 | + $out .= '<p>'.__('Story components can be added by clicking the plus icon, and dragging any component from the component tray into the story.', 'lasso').'</p>'; |
|
106 | 106 | $out .= '</li></ul>'; |
107 | 107 | |
108 | - echo apply_filters( 'lasso_tour_slides', $out ); |
|
108 | + echo apply_filters('lasso_tour_slides', $out); |
|
109 | 109 | |
110 | 110 | ?></div><?php |
111 | 111 |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | 13 | if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | - // using rest api v1 |
|
14 | + if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
15 | + // using rest api v1 |
|
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php |
32 | 32 | } else { |
33 | 33 | // using rest api v2 |
34 | - ?> |
|
34 | + ?> |
|
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | 37 | <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | </li> |
48 | 48 | </script> |
49 | 49 | <?php |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( !function_exists( 'lasso_backbone_templates' ) ): |
|
3 | +if (!function_exists('lasso_backbone_templates')): |
|
4 | 4 | |
5 | 5 | add_action('wp_footer', 'lasso_backbone_templates'); |
6 | - function lasso_backbone_templates(){ |
|
6 | + function lasso_backbone_templates() { |
|
7 | 7 | |
8 | 8 | $can_delete = lasso_user_can('delete_posts'); |
9 | 9 | $can_delete_class = $can_delete ? false : 'no-delete'; |
10 | 10 | |
11 | 11 | |
12 | 12 | // only run on posts and pages if user is logged in |
13 | - if ( is_user_logged_in() && lasso_user_can('edit_posts') ) { |
|
14 | - if ( !class_exists( 'WP_REST_Controller' ) ) { |
|
13 | + if (is_user_logged_in() && lasso_user_can('edit_posts')) { |
|
14 | + if (!class_exists('WP_REST_Controller')) { |
|
15 | 15 | // using rest api v1 |
16 | 16 | ?> |
17 | 17 | <script type="text/html" id="lasso-tmpl--post"> |
18 | 18 | <li> |
19 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
19 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.ID %>" > |
|
20 | 20 | <%= post.title %> |
21 | 21 | |
22 | 22 | <div class="lasso--post-list__controls"> |
23 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
24 | - <?php if( $can_delete ): ?> |
|
25 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
23 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
24 | + <?php if ($can_delete): ?> |
|
25 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
26 | 26 | <?php endif; ?> |
27 | 27 | </div> |
28 | 28 | </a> |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | ?> |
35 | 35 | <script type="text/html" id="lasso-tmpl--post"> |
36 | 36 | <li> |
37 | - <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class;?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
37 | + <a href="<%= post.link %>" class="lasso--post-list__item <?php echo $can_delete_class; ?> <%= post.status %>" data-postid="<%= post.id %>" > |
|
38 | 38 | <%= post.title.rendered %> |
39 | 39 | |
40 | 40 | <div class="lasso--post-list__controls"> |
41 | - <span title="<?php echo esc_attr_e('Edit Post','lasso');?>" id="lasso--post__edit"></span> |
|
42 | - <?php if( $can_delete ): ?> |
|
43 | - <span title="<?php echo esc_attr_e('Delete Post','lasso');?>" id="lasso--post__delete"></span> |
|
41 | + <span title="<?php echo esc_attr_e('Edit Post', 'lasso'); ?>" id="lasso--post__edit"></span> |
|
42 | + <?php if ($can_delete): ?> |
|
43 | + <span title="<?php echo esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post__delete"></span> |
|
44 | 44 | <?php endif; ?> |
45 | 45 | </div> |
46 | 46 | </a> |
@@ -163,6 +163,9 @@ |
||
163 | 163 | return $content; |
164 | 164 | } |
165 | 165 | |
166 | + /** |
|
167 | + * @param string $content |
|
168 | + */ |
|
166 | 169 | protected function remove_comments($content) { |
167 | 170 | return preg_replace('/<!--(.*)-->/Uis', '', $content); |
168 | 171 | } |
@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | protected function replace_rendered_shortcodes( $content ) { |
148 | 148 | //debug line |
149 | - //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
149 | + //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
|
150 | 150 | |
151 | 151 | |
152 | 152 | if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
@@ -19,27 +19,27 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return bool Always returns true. |
21 | 21 | */ |
22 | - public function content( $data ) { |
|
22 | + public function content($data) { |
|
23 | 23 | |
24 | 24 | $save_to_post_disabled = $this->save_to_post_disables(); |
25 | 25 | |
26 | - $postid = (int) $data[ 'post_id' ]; |
|
27 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
28 | - $content = $this->remove_comments( $content ); |
|
26 | + $postid = (int) $data['post_id']; |
|
27 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
28 | + $content = $this->remove_comments($content); |
|
29 | 29 | |
30 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
30 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
31 | 31 | |
32 | 32 | $args = array( |
33 | 33 | 'ID' => (int) $postid, |
34 | 34 | 'post_content' => $content |
35 | 35 | ); |
36 | 36 | |
37 | - wp_update_post( apply_filters( 'lasso_object_save_args', $args ) ); |
|
37 | + wp_update_post(apply_filters('lasso_object_save_args', $args)); |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | 41 | // run save action |
42 | - do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() ); |
|
42 | + do_action('lasso_post_saved', $postid, $content, get_current_user_ID()); |
|
43 | 43 | |
44 | 44 | return true; |
45 | 45 | |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return bool Always returns true. |
56 | 56 | */ |
57 | - public function publish_content( $data ) { |
|
57 | + public function publish_content($data) { |
|
58 | 58 | $save_to_post_disabled = $this->save_to_post_disables(); |
59 | 59 | |
60 | - $postid = (int) $data[ 'post_id' ]; |
|
61 | - $content = $this->replace_rendered_shortcodes( $data[ 'content' ] ); |
|
62 | - $content = $this->remove_comments( $content ); |
|
60 | + $postid = (int) $data['post_id']; |
|
61 | + $content = $this->replace_rendered_shortcodes($data['content']); |
|
62 | + $content = $this->remove_comments($content); |
|
63 | 63 | |
64 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
64 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
65 | 65 | |
66 | - $args = array ( |
|
66 | + $args = array( |
|
67 | 67 | 'ID' => $postid, |
68 | 68 | 'post_content' => $content, |
69 | 69 | 'post_status' => 'publish' |
70 | 70 | ); |
71 | - wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) ); |
|
71 | + wp_update_post(apply_filters('lasso_object_publish_args', $args)); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | - do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() ); |
|
75 | + do_action('lasso_post_published', $postid, $content, get_current_user_ID()); |
|
76 | 76 | |
77 | 77 | return true; |
78 | 78 | |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
87 | 87 | */ |
88 | - public static function params(){ |
|
89 | - $params[ 'process_save_content' ] = array( |
|
88 | + public static function params() { |
|
89 | + $params['process_save_content'] = array( |
|
90 | 90 | 'post_id' => 'absint', |
91 | 91 | 'content' => 'wp_kses_post' |
92 | 92 | ); |
93 | 93 | |
94 | - $params[ 'process_save_publish_content' ] = array( |
|
94 | + $params['process_save_publish_content'] = array( |
|
95 | 95 | 'post_id' => 'absint', |
96 | 96 | 'content' => 'wp_kses_post' |
97 | 97 | ); |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * @return array Array of additional functions to use to authorize action. |
108 | 108 | */ |
109 | 109 | public static function auth_callbacks() { |
110 | - $params[ 'process_save_content' ] = array( |
|
110 | + $params['process_save_content'] = array( |
|
111 | 111 | 'lasso_user_can' |
112 | 112 | ); |
113 | 113 | |
114 | - $params[ 'process_save_publish_content' ] = array(); |
|
114 | + $params['process_save_publish_content'] = array(); |
|
115 | 115 | |
116 | 116 | return $params; |
117 | 117 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @return bool |
128 | 128 | */ |
129 | 129 | protected function save_to_post_disables() { |
130 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
130 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
131 | 131 | |
132 | 132 | return $save_to_post_disabled; |
133 | 133 | |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | * |
145 | 145 | * @return string |
146 | 146 | */ |
147 | - protected function replace_rendered_shortcodes( $content ) { |
|
147 | + protected function replace_rendered_shortcodes($content) { |
|
148 | 148 | //debug line |
149 | 149 | //file_put_contents(WP_PLUGIN_DIR."/file1.txt", $content); |
150 | 150 | |
151 | 151 | |
152 | - if ( false === strpos( $content, '--EDITUS_OTHER_SHORTCODE_START|' ) ) { |
|
152 | + if (false === strpos($content, '--EDITUS_OTHER_SHORTCODE_START|')) { |
|
153 | 153 | return $content; |
154 | 154 | } |
155 | - $content = htmlspecialchars_decode ($content); |
|
155 | + $content = htmlspecialchars_decode($content); |
|
156 | 156 | |
157 | 157 | $content = preg_replace( |
158 | 158 | '/<!--EDITUS_OTHER_SHORTCODE_START\|\[(.*?)\]-->(.*?)<!--EDITUS_OTHER_SHORTCODE_END-->/s', |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'public' => true, |
244 | 244 | ), 'objects' ); |
245 | 245 | $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
246 | - unset( $post_types[ 'attachment' ] ); |
|
246 | + unset( $post_types[ 'attachment' ] ); |
|
247 | 247 | |
248 | 248 | /** |
249 | 249 | * Set which post types are allowed |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $post_types = get_post_types( array( |
271 | 271 | 'public' => true, |
272 | 272 | ), 'names' ); |
273 | - unset( $post_types[ 'attachment' ] ); |
|
273 | + unset( $post_types[ 'attachment' ] ); |
|
274 | 274 | |
275 | 275 | /** |
276 | 276 | * Set which post types are allowed |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | if ( !function_exists( 'lasso_user_can' ) ): |
384 | 384 | function lasso_user_can( $action = '', $postid = 0 ) { |
385 | - $result = false; |
|
385 | + $result = false; |
|
386 | 386 | if ( empty( $action ) ) |
387 | 387 | $action = 'edit_posts'; |
388 | 388 | |
@@ -397,17 +397,17 @@ discard block |
||
397 | 397 | $allowed_post_types = array_diff($allowed_post_types,array('page')); |
398 | 398 | } |
399 | 399 | |
400 | - if (!empty($allowed_post_types) && !empty($postid)) { |
|
400 | + if (!empty($allowed_post_types) && !empty($postid)) { |
|
401 | 401 | $type = get_post_type( $postid ); |
402 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
402 | + $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
403 | 403 | |
404 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
404 | + if ( in_array( $type, $allowed_post_types ) ) { |
|
405 | 405 | $result = true; |
406 | - } |
|
407 | - } else { |
|
408 | - //we are not checking against a post, return true |
|
406 | + } |
|
407 | + } else { |
|
408 | + //we are not checking against a post, return true |
|
409 | 409 | $result = true; |
410 | - } |
|
410 | + } |
|
411 | 411 | } else { |
412 | 412 | $result = false; |
413 | 413 | } |
@@ -15,8 +15,9 @@ discard block |
||
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | 16 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
19 | - return; |
|
18 | + if ( empty( $option ) ) { |
|
19 | + return; |
|
20 | + } |
|
20 | 21 | |
21 | 22 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
22 | 23 | |
@@ -44,11 +45,12 @@ discard block |
||
44 | 45 | |
45 | 46 | $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
46 | 47 | |
47 | - if ( $q->have_posts() ) |
|
48 | - return true; |
|
49 | - else |
|
50 | - return false; |
|
51 | -} |
|
48 | + if ( $q->have_posts() ) { |
|
49 | + return true; |
|
50 | + } else { |
|
51 | + return false; |
|
52 | + } |
|
53 | + } |
|
52 | 54 | |
53 | 55 | /** |
54 | 56 | * Return a CSS class of an automatically supported theme |
@@ -194,13 +196,15 @@ discard block |
||
194 | 196 | */ |
195 | 197 | function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
196 | 198 | |
197 | - if ( empty( $postid ) ) |
|
198 | - $postid = get_the_ID(); |
|
199 | + if ( empty( $postid ) ) { |
|
200 | + $postid = get_the_ID(); |
|
201 | + } |
|
199 | 202 | |
200 | 203 | $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
201 | 204 | |
202 | - if ( empty( $objects) ) |
|
203 | - return; |
|
205 | + if ( empty( $objects) ) { |
|
206 | + return; |
|
207 | + } |
|
204 | 208 | |
205 | 209 | $out = ''; |
206 | 210 | foreach( $objects as $object ) { |
@@ -222,8 +226,9 @@ discard block |
||
222 | 226 | |
223 | 227 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
224 | 228 | |
225 | - if ( empty( $objects) ) |
|
226 | - return; |
|
229 | + if ( empty( $objects) ) { |
|
230 | + return; |
|
231 | + } |
|
227 | 232 | |
228 | 233 | $out = ""; |
229 | 234 | foreach( $objects as $object ) { |
@@ -345,8 +350,9 @@ discard block |
||
345 | 350 | */ |
346 | 351 | function lasso_clean_string( $string = '' ) { |
347 | 352 | |
348 | - if ( empty( $string ) ) |
|
349 | - return; |
|
353 | + if ( empty( $string ) ) { |
|
354 | + return; |
|
355 | + } |
|
350 | 356 | |
351 | 357 | return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
352 | 358 | } |
@@ -385,11 +391,13 @@ discard block |
||
385 | 391 | if ( !function_exists( 'lasso_user_can' ) ): |
386 | 392 | function lasso_user_can( $action = '', $postid = 0 ) { |
387 | 393 | $result = false; |
388 | - if ( empty( $action ) ) |
|
389 | - $action = 'edit_posts'; |
|
394 | + if ( empty( $action ) ) { |
|
395 | + $action = 'edit_posts'; |
|
396 | + } |
|
390 | 397 | |
391 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
392 | - $postid = get_the_ID(); |
|
398 | + if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') { |
|
399 | + $postid = get_the_ID(); |
|
400 | + } |
|
393 | 401 | |
394 | 402 | if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
395 | 403 | // check against post types: |
@@ -13,6 +13,10 @@ discard block |
||
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | 15 | if( !function_exists('lasso_editor_get_option')): |
16 | + |
|
17 | + /** |
|
18 | + * @param string $section |
|
19 | + */ |
|
16 | 20 | function lasso_editor_get_option( $option, $section, $default = '' ) { |
17 | 21 | |
18 | 22 | if ( empty( $option ) ) |
@@ -216,7 +220,7 @@ discard block |
||
216 | 220 | * Return an array of categories for autocomplete |
217 | 221 | * |
218 | 222 | * @since 0.9.3 |
219 | - * @return array all categoiries |
|
223 | + * @return null|string all categoiries |
|
220 | 224 | */ |
221 | 225 | function lasso_get_objects( $taxonomy = 'category' ) { |
222 | 226 | |
@@ -309,7 +313,7 @@ discard block |
||
309 | 313 | * Used internally as a callback to build a tab or content area for modal addons |
310 | 314 | * |
311 | 315 | * @param $tab object |
312 | -* @param $type string tab or content |
|
316 | +* @param string $type string tab or content |
|
313 | 317 | * @uses lasso_modal_addons() |
314 | 318 | * @since 0.9.4 |
315 | 319 | */ |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | * @return the option value |
13 | 13 | * @since 1.0 |
14 | 14 | */ |
15 | -if( !function_exists('lasso_editor_get_option')): |
|
16 | - function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
15 | +if (!function_exists('lasso_editor_get_option')): |
|
16 | + function lasso_editor_get_option($option, $section, $default = '') { |
|
17 | 17 | |
18 | - if ( empty( $option ) ) |
|
18 | + if (empty($option)) |
|
19 | 19 | return; |
20 | 20 | |
21 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
21 | + if (function_exists('is_multisite') && is_multisite()) { |
|
22 | 22 | |
23 | - $options = get_site_option( $section ); |
|
23 | + $options = get_site_option($section); |
|
24 | 24 | |
25 | 25 | } else { |
26 | 26 | |
27 | - $options = get_option( $section ); |
|
27 | + $options = get_option($section); |
|
28 | 28 | } |
29 | 29 | |
30 | - $options = apply_filters( 'editus_filter_options', $options ); |
|
30 | + $options = apply_filters('editus_filter_options', $options); |
|
31 | 31 | |
32 | - if ( isset( $options[$option] ) ) { |
|
32 | + if (isset($options[$option])) { |
|
33 | 33 | return $options[$option]; |
34 | 34 | } |
35 | 35 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function lasso_editor_galleries_exist() { |
46 | 46 | |
47 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
47 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
48 | 48 | |
49 | - if ( $q->have_posts() ) |
|
49 | + if ($q->have_posts()) |
|
50 | 50 | return true; |
51 | 51 | else |
52 | 52 | return false; |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | function lasso_get_supported_theme_class() { |
62 | 62 | |
63 | 63 | $name = wp_get_theme()->get('Name'); |
64 | - $slug = lasso_clean_string( $name ); |
|
64 | + $slug = lasso_clean_string($name); |
|
65 | 65 | |
66 | - switch ( $slug ) { |
|
66 | + switch ($slug) { |
|
67 | 67 | case 'aesop-story-theme': // aesop |
68 | 68 | $out = '.aesop-entry-content'; |
69 | 69 | break; |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | |
113 | 113 | } |
114 | 114 | |
115 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
115 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
116 | 116 | //return !empty( $out ) ? $out : false; |
117 | 117 | } |
118 | 118 | |
119 | 119 | function lasso_get_supported_theme_title_class() { |
120 | 120 | |
121 | 121 | $name = wp_get_theme()->get('Name'); |
122 | - $slug = lasso_clean_string( $name ); |
|
122 | + $slug = lasso_clean_string($name); |
|
123 | 123 | |
124 | - switch ( $slug ) { |
|
124 | + switch ($slug) { |
|
125 | 125 | |
126 | 126 | case 'aesop-story-theme': // aesop |
127 | 127 | $out = '.aesop-entry-title'; |
@@ -149,16 +149,16 @@ discard block |
||
149 | 149 | break; |
150 | 150 | } |
151 | 151 | |
152 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
152 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | //since 0.9.9.6 |
156 | 156 | function lasso_get_supported_theme_featured_image_class() { |
157 | 157 | |
158 | 158 | $name = wp_get_theme()->get('Name'); |
159 | - $slug = lasso_clean_string( $name ); |
|
159 | + $slug = lasso_clean_string($name); |
|
160 | 160 | |
161 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
161 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @since 0.8.7 |
170 | 170 | * @return string of comma separated classes |
171 | 171 | */ |
172 | -function lasso_supported_no_save(){ |
|
172 | +function lasso_supported_no_save() { |
|
173 | 173 | |
174 | 174 | return apply_filters('lasso_dont_save', '.lasso--ignore,.sharedaddy,.us_wrapper,.meta,.edit-link,.ssba,.addtoany_share_save_container,.mashsb-container,.heateor_sss_sharing_container,.nc_socialPanel,.jp-relatedposts,.fb-comments,.adsbygoogle,.swp_social_panel'); |
175 | 175 | } |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return array|mixed|object|string|void |
185 | 185 | */ |
186 | -function lasso_sanitize_data( $data ) { |
|
187 | - return \lasso\sanatize::do_sanitize( $data ); |
|
186 | +function lasso_sanitize_data($data) { |
|
187 | + return \lasso\sanatize::do_sanitize($data); |
|
188 | 188 | |
189 | 189 | } |
190 | 190 | |
@@ -194,18 +194,18 @@ discard block |
||
194 | 194 | * @since 0.9.3 |
195 | 195 | * @return string of comma delimited category slugs |
196 | 196 | */ |
197 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
197 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
198 | 198 | |
199 | - if ( empty( $postid ) ) |
|
199 | + if (empty($postid)) |
|
200 | 200 | $postid = get_the_ID(); |
201 | 201 | |
202 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
202 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
203 | 203 | |
204 | - if ( empty( $objects) ) |
|
204 | + if (empty($objects)) |
|
205 | 205 | return; |
206 | 206 | |
207 | 207 | $out = ''; |
208 | - foreach( $objects as $object ) { |
|
208 | + foreach ($objects as $object) { |
|
209 | 209 | //$out .= $object->slug.', '; |
210 | 210 | $out .= $object->name.','; |
211 | 211 | } |
@@ -220,15 +220,15 @@ discard block |
||
220 | 220 | * @since 0.9.3 |
221 | 221 | * @return array all categoiries |
222 | 222 | */ |
223 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
223 | +function lasso_get_objects($taxonomy = 'category') { |
|
224 | 224 | |
225 | 225 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
226 | 226 | |
227 | - if ( empty( $objects) ) |
|
227 | + if (empty($objects)) |
|
228 | 228 | return; |
229 | 229 | |
230 | 230 | $out = ""; |
231 | - foreach( $objects as $object ) { |
|
231 | + foreach ($objects as $object) { |
|
232 | 232 | $out .= $object->name.','; |
233 | 233 | } |
234 | 234 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | * @since 0.9.4 |
244 | 244 | */ |
245 | 245 | function lasso_post_types_names() { |
246 | - $post_types = get_post_types( array( |
|
246 | + $post_types = get_post_types(array( |
|
247 | 247 | 'public' => true, |
248 | - ), 'objects' ); |
|
249 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
250 | - unset( $post_types[ 'attachment' ] ); |
|
248 | + ), 'objects'); |
|
249 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
250 | + unset($post_types['attachment']); |
|
251 | 251 | |
252 | 252 | /** |
253 | 253 | * Set which post types are allowed |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
258 | 258 | */ |
259 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
260 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
259 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
260 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
261 | 261 | if (!current_user_can('edit_pages')) { |
262 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
262 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
263 | 263 | } |
264 | - foreach( $post_types as $name => $label ) { |
|
265 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
266 | - unset( $post_types[ $name ] ); |
|
264 | + foreach ($post_types as $name => $label) { |
|
265 | + if (!in_array($name, $allowed_post_types)) { |
|
266 | + unset($post_types[$name]); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | return $post_types; |
@@ -271,10 +271,10 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | function lasso_post_types() { |
274 | - $post_types = get_post_types( array( |
|
274 | + $post_types = get_post_types(array( |
|
275 | 275 | 'public' => true, |
276 | - ), 'names' ); |
|
277 | - unset( $post_types[ 'attachment' ] ); |
|
276 | + ), 'names'); |
|
277 | + unset($post_types['attachment']); |
|
278 | 278 | |
279 | 279 | /** |
280 | 280 | * Set which post types are allowed |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | * |
284 | 284 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
285 | 285 | */ |
286 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post') ); |
|
287 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
288 | - foreach( $post_types as $name => $label ) { |
|
289 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
290 | - unset( $post_types[ $name ] ); |
|
286 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post')); |
|
287 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
288 | + foreach ($post_types as $name => $label) { |
|
289 | + if (!in_array($name, $allowed_post_types)) { |
|
290 | + unset($post_types[$name]); |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | return $post_types; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | global $wp_post_types; |
298 | 298 | $post_types = lasso_post_types(); |
299 | 299 | $rest_base = array(); |
300 | - foreach ( $post_types as $post_type) { |
|
300 | + foreach ($post_types as $post_type) { |
|
301 | 301 | $rest_base[$post_type] = $wp_post_types[$post_type]->rest_base; |
302 | 302 | } |
303 | 303 | |
@@ -315,22 +315,22 @@ discard block |
||
315 | 315 | * @uses lasso_modal_addons() |
316 | 316 | * @since 0.9.4 |
317 | 317 | */ |
318 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
318 | +function lasso_modal_addons_content($tab = '', $type) { |
|
319 | 319 | |
320 | - $name = lasso_clean_string( $tab['name'] ); |
|
320 | + $name = lasso_clean_string($tab['name']); |
|
321 | 321 | |
322 | - if ( 'tab' == $type ) { |
|
322 | + if ('tab' == $type) { |
|
323 | 323 | |
324 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
324 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
325 | 325 | |
326 | - } else if ( 'content' == $type ){ |
|
326 | + } else if ('content' == $type) { |
|
327 | 327 | |
328 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
329 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
328 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
329 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
330 | 330 | |
331 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
331 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
332 | 332 | %s%s |
333 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
333 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
334 | 334 | |
335 | 335 | } |
336 | 336 | |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | * |
346 | 346 | * @return void|string |
347 | 347 | */ |
348 | -function lasso_clean_string( $string = '' ) { |
|
348 | +function lasso_clean_string($string = '') { |
|
349 | 349 | |
350 | - if ( empty( $string ) ) |
|
350 | + if (empty($string)) |
|
351 | 351 | return; |
352 | 352 | |
353 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
353 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | * |
364 | 364 | * @return void|string |
365 | 365 | */ |
366 | -function lasso_unclean_string( $string = '' ) { |
|
366 | +function lasso_unclean_string($string = '') { |
|
367 | 367 | |
368 | - if ( empty( $string ) ) { |
|
368 | + if (empty($string)) { |
|
369 | 369 | return; |
370 | 370 | } |
371 | 371 | |
372 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
372 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | |
@@ -384,40 +384,40 @@ discard block |
||
384 | 384 | * @param unknown $postid int the id of the post object to check against |
385 | 385 | * @since 0.9.9.7 added filter 'lasso_user_can_filter' |
386 | 386 | */ |
387 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
388 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
387 | +if (!function_exists('lasso_user_can')): |
|
388 | + function lasso_user_can($action = '', $postid = 0) { |
|
389 | 389 | $result = false; |
390 | - if ( empty( $action ) ) |
|
390 | + if (empty($action)) |
|
391 | 391 | $action = 'edit_posts'; |
392 | 392 | |
393 | - if ( empty( $postid ) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
393 | + if (empty($postid) && $action != 'edit_posts' && $action != 'publish_posts' && $action != 'delete_posts') |
|
394 | 394 | $postid = get_the_ID(); |
395 | 395 | |
396 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
396 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
397 | 397 | // check against post types: |
398 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( 'post', 'page') ); |
|
398 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array('post', 'page')); |
|
399 | 399 | |
400 | 400 | if (!current_user_can('edit_pages')) { |
401 | - $allowed_post_types = array_diff($allowed_post_types,array('page')); |
|
401 | + $allowed_post_types = array_diff($allowed_post_types, array('page')); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | if (!empty($allowed_post_types) && !empty($postid)) { |
405 | - $type = get_post_type( $postid ); |
|
406 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
405 | + $type = get_post_type($postid); |
|
406 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
407 | 407 | |
408 | - if ( in_array( $type, $allowed_post_types ) ) { |
|
409 | - $result = true; |
|
408 | + if (in_array($type, $allowed_post_types)) { |
|
409 | + $result = true; |
|
410 | 410 | } |
411 | 411 | } else { |
412 | 412 | //we are not checking against a post, return true |
413 | - $result = true; |
|
413 | + $result = true; |
|
414 | 414 | } |
415 | 415 | } else { |
416 | 416 | $result = false; |
417 | 417 | } |
418 | 418 | //if ( function_exists( 'is_gutenberg_page' ) && has_blocks() ) return false; |
419 | 419 | |
420 | - return apply_filters( 'lasso_user_can_filter', $result, $action, $postid); |
|
420 | + return apply_filters('lasso_user_can_filter', $result, $action, $postid); |
|
421 | 421 | } |
422 | 422 | endif; |
423 | 423 | |
@@ -426,25 +426,25 @@ discard block |
||
426 | 426 | * |
427 | 427 | * @since 0.9.5 |
428 | 428 | */ |
429 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
429 | +if (!function_exists('lasso_editor_empty_results')): |
|
430 | 430 | |
431 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
431 | + function lasso_editor_empty_results($type = 'posts') { |
|
432 | 432 | |
433 | - if ( 'posts' == $type ) { |
|
433 | + if ('posts' == $type) { |
|
434 | 434 | |
435 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
435 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
436 | 436 | $icon = 'lasso-icon-file-text2'; |
437 | 437 | $button = false; |
438 | 438 | |
439 | - } elseif ( 'revision' == $type ) { |
|
439 | + } elseif ('revision' == $type) { |
|
440 | 440 | |
441 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
441 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
442 | 442 | $icon = 'lasso-icon-history'; |
443 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
443 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
444 | 444 | |
445 | 445 | } |
446 | 446 | |
447 | - return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button ); |
|
447 | + return sprintf('<div id="lasso--empty-state" class="lasso--empty-state"><i class="lasso--empty-state-icon lasso-icon %s"></i><p>%s</p>%s</div>', $icon, $string, $button); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | endif; |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
49 | - return; |
|
48 | + if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) { |
|
49 | + return; |
|
50 | + } |
|
50 | 51 | |
51 | 52 | if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
52 | 53 | |
@@ -86,8 +87,9 @@ discard block |
||
86 | 87 | */ |
87 | 88 | function lasso_editor_settings_form() { |
88 | 89 | |
89 | - if ( !is_user_logged_in() ) |
|
90 | - return; |
|
90 | + if ( !is_user_logged_in() ) { |
|
91 | + return; |
|
92 | + } |
|
91 | 93 | |
92 | 94 | $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
93 | 95 | $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
@@ -137,7 +139,9 @@ discard block |
||
137 | 139 | $post_types = get_post_types( $args, 'objects' ); |
138 | 140 | |
139 | 141 | foreach ( $post_types as $post_type ) { |
140 | - if ($post_type->name == 'attachment') continue; |
|
142 | + if ($post_type->name == 'attachment') { |
|
143 | + continue; |
|
144 | + } |
|
141 | 145 | $checked =""; |
142 | 146 | if ( in_array( $post_type->name, $allowed_post_types ) ) { |
143 | 147 | $checked = 'checked="checked"'; |
@@ -79,6 +79,10 @@ |
||
79 | 79 | |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param string $id |
|
84 | + * @param string $defvalue |
|
85 | + */ |
|
82 | 86 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | 87 | $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
84 | 88 |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | function __construct() { |
11 | 11 | |
12 | - add_action( 'admin_menu', array( $this, 'menu' ) ); |
|
13 | - add_action( 'network_admin_menu', array( $this, 'menu' ) ); |
|
14 | - add_action( 'wp_ajax_lasso-editor-settings', array( $this, 'process_settings' ) ); |
|
12 | + add_action('admin_menu', array($this, 'menu')); |
|
13 | + add_action('network_admin_menu', array($this, 'menu')); |
|
14 | + add_action('wp_ajax_lasso-editor-settings', array($this, 'process_settings')); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function menu() { |
24 | 24 | |
25 | 25 | // CHANGED Removed condition. |
26 | - add_submenu_page( 'lasso-editor', __( 'Settings', 'lasso' ), __( 'Settings', 'lasso' ), 'manage_options', 'lasso-editor-settings', array( $this, 'settings' ) ); |
|
26 | + add_submenu_page('lasso-editor', __('Settings', 'lasso'), __('Settings', 'lasso'), 'manage_options', 'lasso-editor-settings', array($this, 'settings')); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -45,26 +45,26 @@ discard block |
||
45 | 45 | function process_settings() { |
46 | 46 | |
47 | 47 | // bail out if current user isn't and administrator and they are not logged in |
48 | - if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) |
|
48 | + if (!current_user_can('manage_options') || !is_user_logged_in()) |
|
49 | 49 | return; |
50 | 50 | |
51 | - if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) { |
|
51 | + if (isset($_POST['action']) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer('nonce', 'lasso_editor_settings')) { |
|
52 | 52 | |
53 | - $options = isset( $_POST['lasso_editor'] ) ? $_POST['lasso_editor'] : false; |
|
53 | + $options = isset($_POST['lasso_editor']) ? $_POST['lasso_editor'] : false; |
|
54 | 54 | |
55 | 55 | $arr = $options['allowed_post_types']; |
56 | - $options = array_map( 'sanitize_text_field', $options ); |
|
57 | - $options['allowed_post_types'] = array_keys( $arr); |
|
56 | + $options = array_map('sanitize_text_field', $options); |
|
57 | + $options['allowed_post_types'] = array_keys($arr); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | |
61 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
61 | + if (function_exists('is_multisite') && is_multisite()) { |
|
62 | 62 | |
63 | - update_site_option( 'lasso_editor', $options ); |
|
63 | + update_site_option('lasso_editor', $options); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | |
67 | - update_option( 'lasso_editor', $options ); |
|
67 | + update_option('lasso_editor', $options); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | wp_send_json_success(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | function create_section_for_color_picker($id, $title, $defvalue) { |
83 | - $color_value = lasso_editor_get_option( $id, 'lasso_editor',$defvalue ); |
|
83 | + $color_value = lasso_editor_get_option($id, 'lasso_editor', $defvalue); |
|
84 | 84 | |
85 | 85 | echo '<div lass="lasso-editor-settings--option-inner">'."\n"; |
86 | 86 | echo '<label>'.$title.'</label>'; |
@@ -95,40 +95,40 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function lasso_editor_settings_form() { |
97 | 97 | |
98 | - if ( !is_user_logged_in() ) |
|
98 | + if (!is_user_logged_in()) |
|
99 | 99 | return; |
100 | 100 | |
101 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
102 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
103 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
104 | - |
|
105 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
106 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
107 | - $edit_post_disabled = lasso_editor_get_option( 'post_edit_disabled', 'lasso_editor' ); |
|
108 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
109 | - $allow_change_date = lasso_editor_get_option( 'allow_change_date', 'lasso_editor' ); |
|
110 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
111 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
112 | - $enable_autosave = lasso_editor_get_option( 'enable_autosave', 'lasso_editor' ); |
|
113 | - |
|
114 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
115 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
116 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
117 | - $toolbar_show_color = lasso_editor_get_option( 'toolbar_show_color', 'lasso_editor' ); |
|
118 | - $toolbar_show_alignment = lasso_editor_get_option( 'toolbar_show_alignment', 'lasso_editor' ); |
|
101 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
102 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
103 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
104 | + |
|
105 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
106 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
107 | + $edit_post_disabled = lasso_editor_get_option('post_edit_disabled', 'lasso_editor'); |
|
108 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
109 | + $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
|
110 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
111 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
112 | + $enable_autosave = lasso_editor_get_option('enable_autosave', 'lasso_editor'); |
|
113 | + |
|
114 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
115 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
116 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
117 | + $toolbar_show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
|
118 | + $toolbar_show_alignment = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
|
119 | 119 | |
120 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
121 | - $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
120 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
121 | + $objectsNonEditable = lasso_editor_get_option('non_editable', 'lasso_editor'); |
|
122 | 122 | $disable_tour = lasso_editor_get_option('disable_tour', 'lasso_editor'); |
123 | 123 | $show_ignored_items = lasso_editor_get_option('show_ignored_items', 'lasso_editor'); |
124 | 124 | $save_using_rest_disabled = lasso_editor_get_option('save_using_rest_disabled', 'lasso_editor'); |
125 | 125 | |
126 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
127 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
126 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
127 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
128 | 128 | |
129 | 129 | $links_editable = lasso_editor_get_option('links_editable', 'lasso_editor', false); |
130 | - $bold_tag = lasso_editor_get_option( 'bold_tag', 'lasso_editor', "b"); |
|
131 | - $i_tag = lasso_editor_get_option( 'i_tag', 'lasso_editor', "i"); |
|
130 | + $bold_tag = lasso_editor_get_option('bold_tag', 'lasso_editor', "b"); |
|
131 | + $i_tag = lasso_editor_get_option('i_tag', 'lasso_editor', "i"); |
|
132 | 132 | |
133 | 133 | // do we support pending status |
134 | 134 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -143,31 +143,31 @@ discard block |
||
143 | 143 | ?> |
144 | 144 | <div class="wrap"> |
145 | 145 | |
146 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
146 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
147 | 147 | |
148 | 148 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
149 | 149 | |
150 | - <?php do_action('lasso_settings_before');?> |
|
150 | + <?php do_action('lasso_settings_before'); ?> |
|
151 | 151 | |
152 | 152 | |
153 | 153 | |
154 | - <h3><?php _e( 'Enable for:', 'lasso' );?></h3> |
|
154 | + <h3><?php _e('Enable for:', 'lasso'); ?></h3> |
|
155 | 155 | <div class="lasso-editor-settings--option-wrap"> |
156 | 156 | <div class="lasso-editor-settings--option-inner"> |
157 | 157 | |
158 | - <span class="lasso--setting-description"><?php _e( 'Enable Editus for the following post types.', 'lasso' );?></span> |
|
158 | + <span class="lasso--setting-description"><?php _e('Enable Editus for the following post types.', 'lasso'); ?></span> |
|
159 | 159 | <?php |
160 | 160 | $args = array( |
161 | 161 | 'public' => true |
162 | 162 | ); |
163 | 163 | |
164 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
165 | - $post_types = get_post_types( $args, 'objects' ); |
|
164 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
165 | + $post_types = get_post_types($args, 'objects'); |
|
166 | 166 | |
167 | - foreach ( $post_types as $post_type ) { |
|
167 | + foreach ($post_types as $post_type) { |
|
168 | 168 | if ($post_type->name == 'attachment') continue; |
169 | - $checked =""; |
|
170 | - if ( in_array( $post_type->name, $allowed_post_types ) ) { |
|
169 | + $checked = ""; |
|
170 | + if (in_array($post_type->name, $allowed_post_types)) { |
|
171 | 171 | $checked = 'checked="checked"'; |
172 | 172 | } |
173 | 173 | echo '<label><input type="checkbox" '.$checked.' name="lasso_editor[allowed_post_types]['.$post_type->name.']" id="lasso_editor[allowed_post_types]['.$post_type->name.']" >'.$post_type->name.'</label>'; |
@@ -177,104 +177,104 @@ discard block |
||
177 | 177 | </div> |
178 | 178 | |
179 | 179 | |
180 | - <h3><?php _e( 'Internal Settings', 'lasso' );?></h3> |
|
180 | + <h3><?php _e('Internal Settings', 'lasso'); ?></h3> |
|
181 | 181 | <div class="lasso-editor-settings--option-wrap"> |
182 | 182 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
183 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
184 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso' );?></span> |
|
185 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
183 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
184 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class (including the preceding dot) of container that holds the post. This should be the first parent container class that holds the_content.', 'lasso'); ?></span> |
|
185 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
186 | 186 | </div> |
187 | 187 | |
188 | 188 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
189 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
190 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso' );?></span> |
|
191 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
189 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
190 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class that uses a featured image as a background image. This currently only supports themes that have the featured image set as background image.', 'lasso'); ?></span> |
|
191 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
192 | 192 | </div> |
193 | 193 | |
194 | 194 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
195 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
196 | - <span class="lasso--setting-description"><?php _e( 'Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso' );?></span> |
|
197 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
195 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
196 | + <span class="lasso--setting-description"><?php _e('Provide the CSS class for the post title. This will enable you to update the title of the post by clicking and typing.', 'lasso'); ?></span> |
|
197 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
198 | 198 | </div> |
199 | 199 | |
200 | 200 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
201 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
202 | - <span class="lasso--setting-description"><?php _e( 'If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso' );?></span> |
|
203 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
201 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
202 | + <span class="lasso--setting-description"><?php _e('If your post container holds additional markup, list the css class names (comma separated, including the dot) of those items. When you enter the editor, Editus will remove (NOT delete) these items so that it does not save them as HTML.', 'lasso'); ?></span> |
|
203 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
204 | 204 | </div> |
205 | 205 | |
206 | 206 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
207 | - <label><?php _e( 'Read Only Items', 'lasso' );?></label> |
|
208 | - <span class="lasso--setting-description"><?php _e( 'If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso' );?></span> |
|
209 | - <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNonEditable );?></textarea> |
|
207 | + <label><?php _e('Read Only Items', 'lasso'); ?></label> |
|
208 | + <span class="lasso--setting-description"><?php _e('If your post has items that should not be editable, list the css class names (comma separated, including the dot) of those items.', 'lasso'); ?></span> |
|
209 | + <textarea name="lasso_editor[non_editable]" id="lasso_editor[non_editable]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNonEditable); ?></textarea> |
|
210 | 210 | </div> |
211 | 211 | |
212 | 212 | <div class="lasso-editor-settings--option-inner" > |
213 | - <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked( $show_ignored_items, 'on' );?> > |
|
214 | - <label for="lasso_editor[show_ignored_items]"> <?php _e( 'Show Ignored Items', 'lasso' );?></label> |
|
215 | - <span class="lasso--setting-description"><?php _e( 'By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso' );?></span> |
|
213 | + <input type="checkbox" class="checkbox" name="lasso_editor[show_ignored_items]" id="lasso_editor[show_ignored_items]" <?php echo checked($show_ignored_items, 'on'); ?> > |
|
214 | + <label for="lasso_editor[show_ignored_items]"> <?php _e('Show Ignored Items', 'lasso'); ?></label> |
|
215 | + <span class="lasso--setting-description"><?php _e('By default the ignored items are hidden. Check this to show ignored items while keeping them uneditable.', 'lasso'); ?></span> |
|
216 | 216 | </div> |
217 | 217 | </div> |
218 | 218 | |
219 | - <h3><?php _e( 'Editor UI', 'lasso' );?></h3> |
|
219 | + <h3><?php _e('Editor UI', 'lasso'); ?></h3> |
|
220 | 220 | <div class="lasso-editor-settings--option-wrap"> |
221 | 221 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
222 | - <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked( $use_old_ui, 'on' );?> > |
|
223 | - <label for="lasso_editor[use_old_ui]"><?php _e( 'Use the Old Toolbar', 'lasso' );?></label> |
|
224 | - <span class="lasso--setting-description"><?php _e( 'Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso' );?></span> |
|
222 | + <input type="checkbox" class="checkbox" name="lasso_editor[use_old_ui]" id="lasso_editor_use_old_ui" <?php echo checked($use_old_ui, 'on'); ?> > |
|
223 | + <label for="lasso_editor[use_old_ui]"><?php _e('Use the Old Toolbar', 'lasso'); ?></label> |
|
224 | + <span class="lasso--setting-description"><?php _e('Use this option to disable the new color options and use the pre-1.0 toolbar.', 'lasso'); ?></span> |
|
225 | 225 | </div> |
226 | 226 | <div id="lasso-editor-settings--colors"> |
227 | 227 | <?php |
228 | - self::create_section_for_color_picker('button-color1', _e( 'Editor Bar Color Top', 'lasso' ), '#0000ff'); |
|
229 | - self::create_section_for_color_picker('button-color2', _e( 'Editor Bar Color Bottom', 'lasso' ), '#000030'); |
|
230 | - self::create_section_for_color_picker('dialog-color', _e( 'Dialog Color', 'lasso' ), '#000055'); |
|
231 | - self::create_section_for_color_picker('text-color', _e( 'Icon/Text Color', 'lasso' ), '#ffffff'); |
|
228 | + self::create_section_for_color_picker('button-color1', _e('Editor Bar Color Top', 'lasso'), '#0000ff'); |
|
229 | + self::create_section_for_color_picker('button-color2', _e('Editor Bar Color Bottom', 'lasso'), '#000030'); |
|
230 | + self::create_section_for_color_picker('dialog-color', _e('Dialog Color', 'lasso'), '#000055'); |
|
231 | + self::create_section_for_color_picker('text-color', _e('Icon/Text Color', 'lasso'), '#ffffff'); |
|
232 | 232 | ?> |
233 | - <button type="button" id="lasso-editor-settings--default-colors" ><?php _e( 'Default Colors', 'lasso' );?></button> |
|
233 | + <button type="button" id="lasso-editor-settings--default-colors" ><?php _e('Default Colors', 'lasso'); ?></button> |
|
234 | 234 | <div style="height:50px;"></div> |
235 | 235 | </div> |
236 | 236 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
237 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
238 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable H2 and H3 Buttons', 'lasso' );?></label> |
|
239 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H2 and H3 settings.', 'lasso' );?></span> |
|
237 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
238 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable H2 and H3 Buttons', 'lasso'); ?></label> |
|
239 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H2 and H3 settings.', 'lasso'); ?></span> |
|
240 | 240 | |
241 | 241 | </div> |
242 | 242 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
243 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked( $toolbar_headings_h4, 'on' );?> > |
|
244 | - <label for="lasso_editor[toolbar_headings_h4]"><?php _e( 'Enable H4/H5/H6 Buttons', 'lasso' );?></label> |
|
245 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set H4/H5/H6 settings.', 'lasso' );?></span> |
|
243 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings_h4]" id="lasso_editor[toolbar_headings_h4]" <?php echo checked($toolbar_headings_h4, 'on'); ?> > |
|
244 | + <label for="lasso_editor[toolbar_headings_h4]"><?php _e('Enable H4/H5/H6 Buttons', 'lasso'); ?></label> |
|
245 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set H4/H5/H6 settings.', 'lasso'); ?></span> |
|
246 | 246 | |
247 | 247 | </div> |
248 | 248 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
249 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked( $toolbar_show_color, 'on' );?> > |
|
250 | - <label for="lasso_editor[toolbar_show_color]"><?php _e( 'Enable Text Color Buttons', 'lasso' );?></label> |
|
251 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text colors.', 'lasso' );?></span> |
|
249 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_color]" id="lasso_editor[toolbar_show_color]" <?php echo checked($toolbar_show_color, 'on'); ?> > |
|
250 | + <label for="lasso_editor[toolbar_show_color]"><?php _e('Enable Text Color Buttons', 'lasso'); ?></label> |
|
251 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text colors.', 'lasso'); ?></span> |
|
252 | 252 | |
253 | 253 | </div> |
254 | 254 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
255 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked( $toolbar_show_alignment, 'on' );?> > |
|
256 | - <label for="lasso_editor[toolbar_show_alignment]"><?php _e( 'Enable Text Align Buttons', 'lasso' );?></label> |
|
257 | - <span class="lasso--setting-description"><?php _e( 'Show the buttons to set text alignment.', 'lasso' );?></span> |
|
255 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_show_alignment]" id="lasso_editor[toolbar_show_alignment]" <?php echo checked($toolbar_show_alignment, 'on'); ?> > |
|
256 | + <label for="lasso_editor[toolbar_show_alignment]"><?php _e('Enable Text Align Buttons', 'lasso'); ?></label> |
|
257 | + <span class="lasso--setting-description"><?php _e('Show the buttons to set text alignment.', 'lasso'); ?></span> |
|
258 | 258 | |
259 | 259 | </div> |
260 | 260 | |
261 | 261 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
262 | - <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked( $links_editable, 'on' );?> > |
|
263 | - <label for="lasso_editor[links_editable]"><?php _e( 'Make links editable under the Editing Mode', 'lasso' );?></label> |
|
264 | - <span class="lasso--setting-description"><?php _e( 'Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso' );?></span> |
|
262 | + <input type="checkbox" class="checkbox" name="lasso_editor[links_editable]" id="lasso_editor[links_editable]" <?php echo checked($links_editable, 'on'); ?> > |
|
263 | + <label for="lasso_editor[links_editable]"><?php _e('Make links editable under the Editing Mode', 'lasso'); ?></label> |
|
264 | + <span class="lasso--setting-description"><?php _e('Make links editable under the Editing Mode. Turning this on will make the links non-clickable while editing.', 'lasso'); ?></span> |
|
265 | 265 | |
266 | 266 | </div> |
267 | 267 | <div class="lasso-editor-settings--option-inner"> |
268 | - <label for="lasso_editor[insert_comp_ui]"> <?php _e( 'Insert Component UI', 'lasso' );?></label> |
|
269 | - <span class="lasso--setting-description"><?php _e( 'UI mechanism to insert components', 'lasso' );?></span> |
|
268 | + <label for="lasso_editor[insert_comp_ui]"> <?php _e('Insert Component UI', 'lasso'); ?></label> |
|
269 | + <span class="lasso--setting-description"><?php _e('UI mechanism to insert components', 'lasso'); ?></span> |
|
270 | 270 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
271 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked( $insert_comp_ui, 'drag' );?>> <?php _e( 'Drag and Drop', 'lasso' );?> |
|
271 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value='drag' <?php echo checked($insert_comp_ui, 'drag'); ?>> <?php _e('Drag and Drop', 'lasso'); ?> |
|
272 | 272 | </div> |
273 | 273 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
274 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked( $insert_comp_ui, 'click' );?>> <?php _e( 'Click', 'lasso' );?> |
|
274 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="click" <?php echo checked($insert_comp_ui, 'click'); ?>> <?php _e('Click', 'lasso'); ?> |
|
275 | 275 | </div> |
276 | 276 | <div class="lasso-editor-settings--option-inner" style="border:none;"> |
277 | - <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked( $insert_comp_ui, 'mediumcom' );?>> <?php _e( 'Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso' );?> |
|
277 | + <input type="radio" name="lasso_editor[insert_comp_ui]" value="mediumcom" <?php echo checked($insert_comp_ui, 'mediumcom'); ?>> <?php _e('Auto Button on Empty Paragraph. medium.com-like UI.', 'lasso'); ?> |
|
278 | 278 | </div> |
279 | 279 | </div> |
280 | 280 | </div> |
@@ -283,101 +283,101 @@ discard block |
||
283 | 283 | |
284 | 284 | |
285 | 285 | |
286 | - <h3><?php _e( 'Post Settings UI', 'lasso' );?></h3> |
|
286 | + <h3><?php _e('Post Settings UI', 'lasso'); ?></h3> |
|
287 | 287 | <div class="lasso-editor-settings--option-wrap" > |
288 | 288 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
289 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
290 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
291 | - <span class="lasso--setting-description"><?php _e( 'Check this to disable users from being able to edit post settings from the front-end.', 'lasso' );?></span> |
|
289 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
290 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
291 | + <span class="lasso--setting-description"><?php _e('Check this to disable users from being able to edit post settings from the front-end.', 'lasso'); ?></span> |
|
292 | 292 | </div> |
293 | 293 | |
294 | 294 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
295 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked( $allow_change_date, 'on' );?> > |
|
296 | - <label for="lasso_editor[allow_change_date]"> <?php _e( 'Allow Changing Post Date', 'lasso' );?></label> |
|
297 | - <span class="lasso--setting-description"><?php _e( 'Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso' );?></span> |
|
295 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_change_date]" id="lasso_editor[allow_change_date]" <?php echo checked($allow_change_date, 'on'); ?> > |
|
296 | + <label for="lasso_editor[allow_change_date]"> <?php _e('Allow Changing Post Date', 'lasso'); ?></label> |
|
297 | + <span class="lasso--setting-description"><?php _e('Add the date selector to change the post\'s date to the Post Setting dialog', 'lasso'); ?></span> |
|
298 | 298 | </div> |
299 | 299 | |
300 | 300 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
301 | - <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked( $allow_new_category, 'on' );?> > |
|
302 | - <label for="lasso_editor[allow_new_category]"> <?php _e( 'Allow Adding New Category', 'lasso' );?></label> |
|
303 | - <span class="lasso--setting-description"><?php _e( 'Add the user to create new, previously non-existing categories for posts.', 'lasso' );?></span> |
|
301 | + <input type="checkbox" class="checkbox" name="lasso_editor[allow_new_category]" id="lasso_editor[allow_new_category]" <?php echo checked($allow_new_category, 'on'); ?> > |
|
302 | + <label for="lasso_editor[allow_new_category]"> <?php _e('Allow Adding New Category', 'lasso'); ?></label> |
|
303 | + <span class="lasso--setting-description"><?php _e('Add the user to create new, previously non-existing categories for posts.', 'lasso'); ?></span> |
|
304 | 304 | </div> |
305 | 305 | |
306 | 306 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
307 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked( $no_pending_status, 'on' );?> > |
|
308 | - <label for="lasso_editor[no_pending_status]"> <?php _e( 'Do Not Allow "Pending" Status', 'lasso' );?></label> |
|
309 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the Status to Pending.', 'lasso' );?></span> |
|
307 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_pending_status]" id="lasso_editor[no_pending_status]" <?php echo checked($no_pending_status, 'on'); ?> > |
|
308 | + <label for="lasso_editor[no_pending_status]"> <?php _e('Do Not Allow "Pending" Status', 'lasso'); ?></label> |
|
309 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the Status to Pending.', 'lasso'); ?></span> |
|
310 | 310 | </div> |
311 | 311 | |
312 | 312 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
313 | - <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked( $no_url_setting, 'on' );?> > |
|
314 | - <label for="lasso_editor[no_url_setting]"> <?php _e( 'Remove POST URL Option', 'lasso' );?></label> |
|
315 | - <span class="lasso--setting-description"><?php _e( 'Remove the Option to Set the URL for the Post.', 'lasso' );?></span> |
|
313 | + <input type="checkbox" class="checkbox" name="lasso_editor[no_url_setting]" id="lasso_editor[no_slug_setting]" <?php echo checked($no_url_setting, 'on'); ?> > |
|
314 | + <label for="lasso_editor[no_url_setting]"> <?php _e('Remove POST URL Option', 'lasso'); ?></label> |
|
315 | + <span class="lasso--setting-description"><?php _e('Remove the Option to Set the URL for the Post.', 'lasso'); ?></span> |
|
316 | 316 | </div> |
317 | 317 | |
318 | 318 | <div class="lasso-editor-settings--option-inner" > |
319 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
320 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
321 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable users from being able to add new posts from the front-end.', 'lasso' );?></span> |
|
319 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
320 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
321 | + <span class="lasso--setting-description"><?php _e('Check this box to disable users from being able to add new posts from the front-end.', 'lasso'); ?></span> |
|
322 | 322 | </div> |
323 | 323 | |
324 | 324 | |
325 | 325 | </div> |
326 | 326 | |
327 | - <h3><?php _e( 'Misc', 'lasso' );?></h3> |
|
327 | + <h3><?php _e('Misc', 'lasso'); ?></h3> |
|
328 | 328 | <div class="lasso-editor-settings--option-wrap"> |
329 | 329 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
330 | - <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked( $disable_tour, 'on' );?> > |
|
331 | - <label for="lasso_editor[disable_tour]"> <?php _e( 'Do Not Show Tour Dialog', 'lasso' );?></label> |
|
332 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the tour dialog box for all users.', 'lasso' );?></span> |
|
330 | + <input type="checkbox" class="checkbox" name="lasso_editor[disable_tour]" id="lasso_editor[disable_tour]" <?php echo checked($disable_tour, 'on'); ?> > |
|
331 | + <label for="lasso_editor[disable_tour]"> <?php _e('Do Not Show Tour Dialog', 'lasso'); ?></label> |
|
332 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the tour dialog box for all users.', 'lasso'); ?></span> |
|
333 | 333 | </div> |
334 | 334 | |
335 | 335 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
336 | - <label for="lasso_editor[bold_tag]"> <?php _e( '"Bold" Tag', 'lasso' );?></label> |
|
337 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Bold" style.', 'lasso' );?></span> |
|
338 | - <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked( $bold_tag, 'b' );?>> b |
|
339 | - <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked( $bold_tag, 'strong' );?>> strong |
|
336 | + <label for="lasso_editor[bold_tag]"> <?php _e('"Bold" Tag', 'lasso'); ?></label> |
|
337 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Bold" style.', 'lasso'); ?></span> |
|
338 | + <input type="radio" name="lasso_editor[bold_tag]" value='b' <?php echo checked($bold_tag, 'b'); ?>> b |
|
339 | + <input type="radio" name="lasso_editor[bold_tag]" value="strong" <?php echo checked($bold_tag, 'strong'); ?>> strong |
|
340 | 340 | </div> |
341 | 341 | <div class="lasso-editor-settings--option-inner" > |
342 | - <label for="lasso_editor[i_tag]"> <?php _e( '"Italic" Tag', 'lasso' );?></label> |
|
343 | - <span class="lasso--setting-description"><?php _e( 'Choose the HTML tag used for the "Italic" style.', 'lasso' );?></span> |
|
344 | - <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked( $i_tag, 'i' );?>> i |
|
345 | - <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked( $i_tag, 'em' );?>> em |
|
342 | + <label for="lasso_editor[i_tag]"> <?php _e('"Italic" Tag', 'lasso'); ?></label> |
|
343 | + <span class="lasso--setting-description"><?php _e('Choose the HTML tag used for the "Italic" style.', 'lasso'); ?></span> |
|
344 | + <input type="radio" name="lasso_editor[i_tag]" value='i' <?php echo checked($i_tag, 'i'); ?>> i |
|
345 | + <input type="radio" name="lasso_editor[i_tag]" value="em" <?php echo checked($i_tag, 'em'); ?>> em |
|
346 | 346 | </div> |
347 | 347 | </div> |
348 | 348 | |
349 | - <h3><?php _e( 'Advanced', 'lasso' );?></h3> |
|
349 | + <h3><?php _e('Advanced', 'lasso'); ?></h3> |
|
350 | 350 | <div class="lasso-editor-settings--option-wrap "> |
351 | 351 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
352 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
353 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
354 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
352 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
353 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
354 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
355 | 355 | </div> |
356 | 356 | |
357 | 357 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
358 | - <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked( $enable_autosave, 'on' );?> > |
|
359 | - <label for="lasso_editor[enable_autosave]"><?php _e( 'Enable Auto Save', 'lasso' );?></label> |
|
360 | - <span class="lasso--setting-description"><?php _e( 'Check this box to enable auto save.', 'lasso' );?></span> |
|
358 | + <input type="checkbox" class="checkbox" name="lasso_editor[enable_autosave]" id="lasso_editor[enable_autosave]" <?php echo checked($enable_autosave, 'on'); ?> > |
|
359 | + <label for="lasso_editor[enable_autosave]"><?php _e('Enable Auto Save', 'lasso'); ?></label> |
|
360 | + <span class="lasso--setting-description"><?php _e('Check this box to enable auto save.', 'lasso'); ?></span> |
|
361 | 361 | </div> |
362 | 362 | |
363 | 363 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
364 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked( $save_to_post_disabled, 'on' );?> > |
|
365 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
366 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso' );?></span> |
|
364 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_save_disabled]" id="lasso_editor[post_save_disabled]" <?php echo checked($save_to_post_disabled, 'on'); ?> > |
|
365 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
366 | + <span class="lasso--setting-description"><?php _e('By default the editor will update the database with the post or page it is being used on. Check this box to disable this. If you check this box, it is assumed that you will be using the provided filters to save your own content.', 'lasso'); ?></span> |
|
367 | 367 | |
368 | 368 | </div> |
369 | 369 | |
370 | 370 | <div class="lasso-editor-settings--option-inner" style="border:none"> |
371 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked( $edit_post_disabled, 'on' );?> > |
|
372 | - <label for="lasso_editor[post_edit_disabled]"><?php _e( 'Disable Post Editing', 'lasso' );?></label> |
|
373 | - <span class="lasso--setting-description"><?php _e( 'You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso' );?></span> |
|
371 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_edit_disabled]" id="lasso_editor[post_edit_disabled]" <?php echo checked($edit_post_disabled, 'on'); ?> > |
|
372 | + <label for="lasso_editor[post_edit_disabled]"><?php _e('Disable Post Editing', 'lasso'); ?></label> |
|
373 | + <span class="lasso--setting-description"><?php _e('You may use this option if you only want to edit custom fields. Refer <a href="https://edituswp.com/editing-and-updating-custom-fields-from-frontend/">here</a> for more information. The custom fields you specify will be still editable under the editing mode.', 'lasso'); ?></span> |
|
374 | 374 | |
375 | 375 | </div> |
376 | 376 | |
377 | 377 | <div class="lasso-editor-settings--option-inner"> |
378 | - <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked( $save_using_rest_disabled, 'on' );?> > |
|
379 | - <label for="lasso_editor[save_using_rest_disabled]"><?php _e( "Don't Use REST API to Save", 'lasso' );?></label> |
|
380 | - <span class="lasso--setting-description"><?php _e( 'By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso' );?></span> |
|
378 | + <input type="checkbox" class="checkbox" name="lasso_editor[save_using_rest_disabled]" id="lasso_editor[save_using_rest_disabled]" <?php echo checked($save_using_rest_disabled, 'on'); ?> > |
|
379 | + <label for="lasso_editor[save_using_rest_disabled]"><?php _e("Don't Use REST API to Save", 'lasso'); ?></label> |
|
380 | + <span class="lasso--setting-description"><?php _e('By default the editor will use REST API to save posts. Check this box to use custom AJAX calls instead.', 'lasso'); ?></span> |
|
381 | 381 | |
382 | 382 | </div> |
383 | 383 | </div> |
@@ -387,11 +387,11 @@ discard block |
||
387 | 387 | |
388 | 388 | <div class="lasso-editor-settings--submit"> |
389 | 389 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
390 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
391 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
390 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
391 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
392 | 392 | </div> |
393 | 393 | |
394 | - <?php do_action('lasso_settings_after');?> |
|
394 | + <?php do_action('lasso_settings_after'); ?> |
|
395 | 395 | </form> |
396 | 396 | |
397 | 397 | </div><?php |