@@ -197,53 +197,53 @@ |
||
197 | 197 | */ |
198 | 198 | function required_plugins() { |
199 | 199 | |
200 | - $plugins = array( |
|
201 | - |
|
202 | - array( |
|
203 | - 'name' => __('WP REST API','lasso'), |
|
204 | - 'slug' => 'json-rest-api', |
|
205 | - 'required' => true, |
|
206 | - ), |
|
207 | - |
|
208 | - array( |
|
209 | - 'name' => __('Aesop Story Engine','lasso'), |
|
210 | - 'slug' => 'aesop-story-engine', |
|
211 | - 'required' => false, |
|
212 | - ), |
|
213 | - |
|
214 | - ); |
|
215 | - |
|
216 | - $config = array( |
|
217 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
218 | - 'menu' => 'lasso-install-plugins', // Menu slug. |
|
219 | - 'has_notices' => true, // Show admin notices or not. |
|
220 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
221 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
222 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
223 | - 'message' => '', // Message to output right before the plugins table. |
|
224 | - 'strings' => array( |
|
225 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
226 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
227 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
228 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
229 | - '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). |
|
230 | - '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). |
|
231 | - '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). |
|
232 | - '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). |
|
233 | - '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). |
|
234 | - '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). |
|
235 | - '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). |
|
236 | - '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). |
|
237 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
238 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
239 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
240 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
241 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
242 | - 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
|
243 | - ) |
|
244 | - ); |
|
245 | - |
|
246 | - tgmpa( $plugins, $config ); |
|
200 | + $plugins = array( |
|
201 | + |
|
202 | + array( |
|
203 | + 'name' => __('WP REST API','lasso'), |
|
204 | + 'slug' => 'json-rest-api', |
|
205 | + 'required' => true, |
|
206 | + ), |
|
207 | + |
|
208 | + array( |
|
209 | + 'name' => __('Aesop Story Engine','lasso'), |
|
210 | + 'slug' => 'aesop-story-engine', |
|
211 | + 'required' => false, |
|
212 | + ), |
|
213 | + |
|
214 | + ); |
|
215 | + |
|
216 | + $config = array( |
|
217 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
218 | + 'menu' => 'lasso-install-plugins', // Menu slug. |
|
219 | + 'has_notices' => true, // Show admin notices or not. |
|
220 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
221 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
222 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
223 | + 'message' => '', // Message to output right before the plugins table. |
|
224 | + 'strings' => array( |
|
225 | + 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
226 | + 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
227 | + 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
228 | + 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
229 | + '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). |
|
230 | + '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). |
|
231 | + '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). |
|
232 | + '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). |
|
233 | + '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). |
|
234 | + '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). |
|
235 | + '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). |
|
236 | + '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). |
|
237 | + 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
238 | + 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
239 | + 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
240 | + 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
241 | + 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
242 | + 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
|
243 | + ) |
|
244 | + ); |
|
245 | + |
|
246 | + tgmpa( $plugins, $config ); |
|
247 | 247 | |
248 | 248 | } |
249 | 249 | } |
@@ -10,29 +10,29 @@ 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' ) ); |
|
13 | + add_action('admin_init', array($this, 'redirect')); |
|
14 | + add_action('admin_menu', array($this, 'lasso_welcome')); |
|
15 | 15 | |
16 | - add_action( 'tgmpa_register', array( $this,'required_plugins' )); |
|
16 | + add_action('tgmpa_register', array($this, 'required_plugins')); |
|
17 | 17 | |
18 | 18 | } |
19 | 19 | |
20 | 20 | function redirect() { |
21 | 21 | |
22 | 22 | // Bail if no activation redirect |
23 | - if ( !get_transient( '_lasso_welcome_redirect' ) ) { |
|
23 | + if (!get_transient('_lasso_welcome_redirect')) { |
|
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | 27 | // Delete the redirect transient |
28 | - delete_transient( '_lasso_welcome_redirect' ); |
|
28 | + delete_transient('_lasso_welcome_redirect'); |
|
29 | 29 | |
30 | 30 | // Bail if activating from network, or bulk |
31 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
31 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'page' => 'lasso-editor' ), admin_url( 'admin.php' ) ) ) ); |
|
35 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('page' => 'lasso-editor'), admin_url('admin.php')))); |
|
36 | 36 | |
37 | 37 | } |
38 | 38 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | */ |
44 | 44 | function lasso_welcome() { |
45 | 45 | |
46 | - if ( function_exists( 'is_multisite' ) && !is_multisite() ) { |
|
46 | + if (function_exists('is_multisite') && !is_multisite()) { |
|
47 | 47 | |
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 | } |
@@ -61,16 +61,16 @@ discard block |
||
61 | 61 | ?> |
62 | 62 | <div class="wrap lasso--welcome"> |
63 | 63 | |
64 | - <?php self::header();?> |
|
64 | + <?php self::header(); ?> |
|
65 | 65 | |
66 | 66 | <ul class="lasso--welcome__steps"> |
67 | 67 | |
68 | 68 | <?php |
69 | 69 | $checks = self::lasso_preflight_check(); |
70 | 70 | |
71 | - if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ): |
|
71 | + if ($checks && !defined('LASSO_AGENCY_MODE')): |
|
72 | 72 | |
73 | - foreach ( (array) $checks as $key => $check ) { |
|
73 | + foreach ((array) $checks as $key => $check) { |
|
74 | 74 | |
75 | 75 | echo $check; |
76 | 76 | } |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | // pre-flight is go for flight |
81 | 81 | ?> |
82 | 82 | <li class="success"> |
83 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
84 | - <?php if ( lasso_get_supported_theme_class() ) { ?> |
|
85 | - <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
|
83 | + <h3><?php _e('You\'re Ready to Rock!', 'lasso'); ?></h3> |
|
84 | + <?php if (lasso_get_supported_theme_class()) { ?> |
|
85 | + <p><?php _e('Your theme is automatically supported. No additional setup is needed.', 'lasso'); ?></p> |
|
86 | 86 | <?php } ?> |
87 | - <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> |
|
87 | + <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> |
|
88 | 88 | </li> |
89 | 89 | <?php |
90 | 90 | |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | |
107 | 107 | <div class="lasso--welcome__top"> |
108 | 108 | |
109 | - <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png';?>"> |
|
110 | - <h1><?php _e( 'Welcome to Editus', 'lasso' );?></h1> |
|
111 | - <p><?php _e( 'Version', 'lasso' );echo '<span> '.LASSO_VERSION.'</span>';?></p> |
|
109 | + <img style="width:125px;" src="<?php echo LASSO_URL.'/admin/assets/img/logo.png'; ?>"> |
|
110 | + <h1><?php _e('Welcome to Editus', 'lasso'); ?></h1> |
|
111 | + <p><?php _e('Version', 'lasso'); echo '<span> '.LASSO_VERSION.'</span>'; ?></p> |
|
112 | 112 | |
113 | - <?php if ( !defined( 'LASSO_AGENCY_MODE' ) ): ?> |
|
113 | + <?php if (!defined('LASSO_AGENCY_MODE')): ?> |
|
114 | 114 | |
115 | 115 | <ul class="lasso--welcome__social"> |
116 | - <li><a href="http://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e( 'Help', 'lasso' );?></a></li> |
|
117 | - <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e( 'Twitter', 'lasso' );?></a></li> |
|
118 | - <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e( 'Facebook', 'lasso' );?></a></li> |
|
116 | + <li><a href="http://edituswp.com/help" target="_blank"><i class="dashicons dashicons-sos"></i> <?php _e('Help', 'lasso'); ?></a></li> |
|
117 | + <li><a href="http://twitter.com/aesopinteractiv" target="_blank"><i class="dashicons dashicons-twitter"></i> <?php _e('Twitter', 'lasso'); ?></a></li> |
|
118 | + <li><a href="http://facebook.com/aesopinteractive" target="_blank"><i class="dashicons dashicons-facebook"></i> <?php _e('Facebook', 'lasso'); ?></a></li> |
|
119 | 119 | </ul> |
120 | 120 | |
121 | 121 | <?php endif; ?> |
@@ -132,61 +132,61 @@ discard block |
||
132 | 132 | */ |
133 | 133 | function lasso_preflight_check() { |
134 | 134 | |
135 | - $notices = array(); |
|
135 | + $notices = array(); |
|
136 | 136 | |
137 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
137 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
138 | 138 | |
139 | - $theme_name = wp_get_theme()->get('Name'); |
|
140 | - $theme_class = lasso_get_supported_theme_class(); |
|
139 | + $theme_name = wp_get_theme()->get('Name'); |
|
140 | + $theme_class = lasso_get_supported_theme_class(); |
|
141 | 141 | |
142 | - $license = get_option( 'lasso_license_key' ); |
|
143 | - $status = get_option( 'lasso_license_status' ); |
|
142 | + $license = get_option('lasso_license_key'); |
|
143 | + $status = get_option('lasso_license_status'); |
|
144 | 144 | |
145 | 145 | // if the required CSS class has not been saved and we're not a supported theme |
146 | - if ( empty( $article_object ) && false == $theme_class ) { |
|
146 | + if (empty($article_object) && false == $theme_class) { |
|
147 | 147 | |
148 | 148 | // we dont automatically support this theme so show them otherwise |
149 | 149 | $notices[] = sprintf('<li class="error"> |
150 | - <h3>'.__( 'Article CSS Class Needed!', 'lasso' ).'</h3> |
|
151 | - <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> |
|
152 | - </li>', admin_url( 'admin.php?page=lasso-editor-settings' ) ); |
|
150 | + <h3>'.__('Article CSS Class Needed!', 'lasso').'</h3> |
|
151 | + <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> |
|
152 | + </li>', admin_url('admin.php?page=lasso-editor-settings')); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | // WP REST API not active |
156 | - if ( !function_exists( 'json_get_url_prefix' ) ) { |
|
156 | + if (!function_exists('json_get_url_prefix')) { |
|
157 | 157 | $notices[] = '<li class="info"><h3>WP REST API not Activated!</h3> |
158 | - <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. It is required until WordPress officially merges the REST API into core sometime during 2015.', 'lasso' ).'</p> |
|
158 | + <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. It is required until WordPress officially merges the REST API into core sometime during 2015.', 'lasso').'</p> |
|
159 | 159 | </li>'; |
160 | 160 | } |
161 | 161 | |
162 | 162 | // aesop story engine isnt active |
163 | - if ( !class_exists( 'Aesop_Core' ) ) { |
|
164 | - $notices[] = sprintf( '<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
165 | - <p>'.__( 'Just a heads up that ', 'lasso' ).'<a href="%s" target="_blank |
|
166 | - ">'.__( '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> |
|
167 | - </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine') ); |
|
163 | + if (!class_exists('Aesop_Core')) { |
|
164 | + $notices[] = sprintf('<li class="info"><h3>Aesop Story Engine not Activated!</h3> |
|
165 | + <p>'.__('Just a heads up that ', 'lasso').'<a href="%s" target="_blank |
|
166 | + ">'.__('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> |
|
167 | + </li>', admin_url('plugin-install.php?tab=search&s=aesop+story+engine')); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | // 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 |
171 | - if ( class_exists( 'WP_Side_Comments' ) ) { |
|
172 | - $notices[] = '<li class="error"><h3>'.__( 'WP Side Comments Compatibility Warning!', 'lasso' ).'</h3> |
|
173 | - <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> |
|
171 | + if (class_exists('WP_Side_Comments')) { |
|
172 | + $notices[] = '<li class="error"><h3>'.__('WP Side Comments Compatibility Warning!', 'lasso').'</h3> |
|
173 | + <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> |
|
174 | 174 | </li>'; |
175 | 175 | } |
176 | 176 | |
177 | 177 | // if the license key isnt activated |
178 | - if ( empty( $license ) ) { |
|
179 | - $notices[] = '<li class="info"><h3>'.__( 'License Key Not Activated', 'lasso' ).'</h3> |
|
180 | - <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> |
|
178 | + if (empty($license)) { |
|
179 | + $notices[] = '<li class="info"><h3>'.__('License Key Not Activated', 'lasso').'</h3> |
|
180 | + <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> |
|
181 | 181 | </li>'; |
182 | 182 | } |
183 | - if ( !empty( $license ) && 'invalid' == $status ) { |
|
184 | - $notices[] = '<li class="error"><h3>'.__( 'License Key Invalid', 'lasso' ).'</h3> |
|
185 | - <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> |
|
183 | + if (!empty($license) && 'invalid' == $status) { |
|
184 | + $notices[] = '<li class="error"><h3>'.__('License Key Invalid', 'lasso').'</h3> |
|
185 | + <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> |
|
186 | 186 | </li>'; |
187 | 187 | } |
188 | 188 | |
189 | - return apply_filters( 'lasso_preflight_notices', $notices ); |
|
189 | + return apply_filters('lasso_preflight_notices', $notices); |
|
190 | 190 | |
191 | 191 | } |
192 | 192 | |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | $plugins = array( |
201 | 201 | |
202 | 202 | array( |
203 | - 'name' => __('WP REST API','lasso'), |
|
203 | + 'name' => __('WP REST API', 'lasso'), |
|
204 | 204 | 'slug' => 'json-rest-api', |
205 | 205 | 'required' => true, |
206 | 206 | ), |
207 | 207 | |
208 | 208 | array( |
209 | - 'name' => __('Aesop Story Engine','lasso'), |
|
209 | + 'name' => __('Aesop Story Engine', 'lasso'), |
|
210 | 210 | 'slug' => 'aesop-story-engine', |
211 | 211 | 'required' => false, |
212 | 212 | ), |
@@ -214,36 +214,36 @@ discard block |
||
214 | 214 | ); |
215 | 215 | |
216 | 216 | $config = array( |
217 | - 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
217 | + 'default_path' => '', // Default absolute path to pre-packaged plugins. |
|
218 | 218 | 'menu' => 'lasso-install-plugins', // Menu slug. |
219 | - 'has_notices' => true, // Show admin notices or not. |
|
220 | - 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
221 | - 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
222 | - 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
223 | - 'message' => '', // Message to output right before the plugins table. |
|
219 | + 'has_notices' => true, // Show admin notices or not. |
|
220 | + 'dismissable' => true, // If false, a user cannot dismiss the nag message. |
|
221 | + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. |
|
222 | + 'is_automatic' => false, // Automatically activate plugins after installation or not. |
|
223 | + 'message' => '', // Message to output right before the plugins table. |
|
224 | 224 | 'strings' => array( |
225 | - 'page_title' => __( 'Install Required Plugins', 'lasso' ), |
|
226 | - 'menu_title' => __( 'Install Plugins', 'lasso' ), |
|
227 | - 'installing' => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name. |
|
228 | - 'oops' => __( 'Something went wrong with the plugin API.', 'lasso' ), |
|
229 | - '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). |
|
230 | - '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). |
|
231 | - '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). |
|
232 | - '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). |
|
233 | - '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). |
|
234 | - '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). |
|
235 | - '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). |
|
236 | - '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). |
|
237 | - 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), |
|
238 | - 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), |
|
239 | - 'return' => __( 'Return to Required Plugins Installer', 'lasso' ), |
|
240 | - 'plugin_activated' => __( 'Plugin activated successfully.', 'lasso' ), |
|
241 | - 'complete' => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link. |
|
225 | + 'page_title' => __('Install Required Plugins', 'lasso'), |
|
226 | + 'menu_title' => __('Install Plugins', 'lasso'), |
|
227 | + 'installing' => __('Installing Plugin: %s', 'lasso'), // %s = plugin name. |
|
228 | + 'oops' => __('Something went wrong with the plugin API.', 'lasso'), |
|
229 | + '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). |
|
230 | + '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). |
|
231 | + '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). |
|
232 | + '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). |
|
233 | + '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). |
|
234 | + '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). |
|
235 | + '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). |
|
236 | + '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). |
|
237 | + 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins'), |
|
238 | + 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins'), |
|
239 | + 'return' => __('Return to Required Plugins Installer', 'lasso'), |
|
240 | + 'plugin_activated' => __('Plugin activated successfully.', 'lasso'), |
|
241 | + 'complete' => __('All plugins installed and activated successfully. %s', 'lasso'), // %s = dashboard link. |
|
242 | 242 | 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. |
243 | 243 | ) |
244 | 244 | ); |
245 | 245 | |
246 | - tgmpa( $plugins, $config ); |
|
246 | + tgmpa($plugins, $config); |
|
247 | 247 | |
248 | 248 | } |
249 | 249 | } |
@@ -73,14 +73,15 @@ |
||
73 | 73 | foreach ( (array) $checks as $key => $check ) { |
74 | 74 | |
75 | 75 | echo $check; |
76 | - } |
|
77 | - |
|
78 | - else: |
|
76 | + } else { |
|
77 | + : |
|
79 | 78 | |
80 | 79 | // pre-flight is go for flight |
81 | 80 | ?> |
82 | 81 | <li class="success"> |
83 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
82 | + <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' ); |
|
83 | + } |
|
84 | + ?></h3> |
|
84 | 85 | <?php if ( lasso_get_supported_theme_class() ) { ?> |
85 | 86 | <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
86 | 87 | <?php } ?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /*----------------------------------------------------------------------------* |
10 | 10 | * Register Autoloader |
11 | 11 | *----------------------------------------------------------------------------*/ |
12 | -include_once( LASSO_DIR . '/includes/lasso_autoloader.php' ); |
|
12 | +include_once(LASSO_DIR.'/includes/lasso_autoloader.php'); |
|
13 | 13 | $loader = new lasso_autoloader(); |
14 | 14 | |
15 | 15 | $loader->register(); |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | *----------------------------------------------------------------------------*/ |
20 | 20 | //require_once plugin_dir_path( __FILE__ ) . 'public/class-lasso.php'; |
21 | 21 | |
22 | -$loader->addNamespace('lasso', LASSO_DIR . 'includes' ); |
|
23 | -$loader->addNamespace('lasso_public_facing', LASSO_DIR . 'public/includes' ); |
|
24 | -$loader->addNamespace('lasso\internal_api', LASSO_DIR . 'internal-api' ); |
|
22 | +$loader->addNamespace('lasso', LASSO_DIR.'includes'); |
|
23 | +$loader->addNamespace('lasso_public_facing', LASSO_DIR.'public/includes'); |
|
24 | +$loader->addNamespace('lasso\internal_api', LASSO_DIR.'internal-api'); |
|
25 | 25 | new lasso\internal_api\end_points(); |
26 | 26 | |
27 | -register_activation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'activate' ) ); |
|
28 | -register_deactivation_hook( __FILE__, array( 'lasso_public_facing\lasso', 'deactivate' ) ); |
|
27 | +register_activation_hook(__FILE__, array('lasso_public_facing\lasso', 'activate')); |
|
28 | +register_deactivation_hook(__FILE__, array('lasso_public_facing\lasso', 'deactivate')); |
|
29 | 29 | |
30 | -add_action( 'plugins_loaded', array( 'lasso_public_facing\lasso', 'get_instance' ) ); |
|
30 | +add_action('plugins_loaded', array('lasso_public_facing\lasso', 'get_instance')); |
|
31 | 31 | |
32 | 32 | //load tour |
33 | -add_action( 'init', function() { |
|
34 | - if (! is_admin() && is_user_logged_in() ) { |
|
33 | +add_action('init', function() { |
|
34 | + if (!is_admin() && is_user_logged_in()) { |
|
35 | 35 | new \lasso_public_facing\tour(); |
36 | 36 | } |
37 | 37 | }); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * Dashboard and Administrative Functionality |
42 | 42 | *----------------------------------------------------------------------------*/ |
43 | 43 | |
44 | -if ( is_admin() ) { |
|
45 | - $loader->addNamespace('lasso_admin', LASSO_DIR . 'admin/includes' ); |
|
46 | - add_action( 'plugins_loaded', array( 'lasso_admin\load_admin', 'get_instance' ) ); |
|
44 | +if (is_admin()) { |
|
45 | + $loader->addNamespace('lasso_admin', LASSO_DIR.'admin/includes'); |
|
46 | + add_action('plugins_loaded', array('lasso_admin\load_admin', 'get_instance')); |
|
47 | 47 | |
48 | 48 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @since 1.0 |
27 | 27 | */ |
28 | - public function post( $data ) { |
|
28 | + public function post($data) { |
|
29 | 29 | |
30 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
30 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
31 | 31 | |
32 | 32 | // bail out if teh current user can't publish posts |
33 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
33 | + if (!lasso_user_can('delete_post', $postid)) |
|
34 | 34 | return; |
35 | 35 | |
36 | 36 | $args = array( |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | 'post_status' => 'trash' |
39 | 39 | ); |
40 | 40 | |
41 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
41 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
42 | 42 | |
43 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
43 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
44 | 44 | |
45 | 45 | return true; |
46 | 46 | } |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
54 | 54 | */ |
55 | - public static function params(){ |
|
56 | - $params[ 'process_delete_post' ] = array( |
|
55 | + public static function params() { |
|
56 | + $params['process_delete_post'] = array( |
|
57 | 57 | 'postid' => 'absint', |
58 | 58 | ); |
59 | 59 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return array Array of additional functions to use to authorize action. |
69 | 69 | */ |
70 | 70 | public static function auth_callbacks() { |
71 | - $params[ 'process_delete_post' ] = array( |
|
71 | + $params['process_delete_post'] = array( |
|
72 | 72 | 'lasso_user_can' |
73 | 73 | ); |
74 | 74 |
@@ -30,8 +30,9 @@ |
||
30 | 30 | $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
31 | 31 | |
32 | 32 | // bail out if teh current user can't publish posts |
33 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
34 | - return; |
|
33 | + if ( !lasso_user_can( 'delete_post', $postid ) ) { |
|
34 | + return; |
|
35 | + } |
|
35 | 36 | |
36 | 37 | $args = array( |
37 | 38 | 'ID' => (int) $postid, |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @return array Key "markup" has the HTML. |
31 | 31 | */ |
32 | - public function swap( $data ) { |
|
32 | + public function swap($data) { |
|
33 | 33 | |
34 | 34 | |
35 | - $id = $data[ 'gallery_id' ]; |
|
36 | - if ( is_null( $id ) ) { |
|
35 | + $id = $data['gallery_id']; |
|
36 | + if (is_null($id)) { |
|
37 | 37 | $id = false; |
38 | 38 | } |
39 | 39 | |
40 | - $markup = sprintf( '<div contenteditable="false" class="lasso--empty-component aesop-component aesop-gallery-component" data-component-type="gallery" data-id="%s">%s</div>', $id, __( 'Save and refresh to view gallery.','lasso' ) ); |
|
40 | + $markup = sprintf('<div contenteditable="false" class="lasso--empty-component aesop-component aesop-gallery-component" data-component-type="gallery" data-id="%s">%s</div>', $id, __('Save and refresh to view gallery.', 'lasso')); |
|
41 | 41 | |
42 | 42 | return array( |
43 | 43 | 'gallery' => $markup |
@@ -54,23 +54,23 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return array|bool On success an array containing "message" or on failure false. |
56 | 56 | */ |
57 | - public function create( $data ) { |
|
57 | + public function create($data) { |
|
58 | 58 | |
59 | 59 | //@todo adapt auth callbacks to work with args. |
60 | - if ( ! lasso_user_can( 'publish_posts' ) ) { |
|
60 | + if (!lasso_user_can('publish_posts')) { |
|
61 | 61 | return false; |
62 | 62 | |
63 | 63 | } |
64 | 64 | |
65 | - $gallery_ids = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false; |
|
65 | + $gallery_ids = isset($data['gallery_ids']) ? $data['gallery_ids'] : false; |
|
66 | 66 | |
67 | 67 | // bail if no gallery ids |
68 | - if ( empty( $gallery_ids ) ) { |
|
68 | + if (empty($gallery_ids)) { |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
72 | - $postid = isset( $data['postid'] ) ? (int) $data['postid'] : false; |
|
73 | - $type = isset( $data['gallery_type'] ) ? $data['gallery_type'] : false; |
|
72 | + $postid = isset($data['postid']) ? (int) $data['postid'] : false; |
|
73 | + $type = isset($data['gallery_type']) ? $data['gallery_type'] : false; |
|
74 | 74 | |
75 | 75 | // insert a new gallery |
76 | 76 | $args = array( |
@@ -79,23 +79,23 @@ discard block |
||
79 | 79 | 'post_type' => 'ai_galleries' |
80 | 80 | ); |
81 | 81 | |
82 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) ); |
|
82 | + $postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args)); |
|
83 | 83 | |
84 | 84 | // update gallery ids |
85 | - if ( $gallery_ids ) { |
|
85 | + if ($gallery_ids) { |
|
86 | 86 | |
87 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
87 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
88 | 88 | |
89 | 89 | } |
90 | 90 | |
91 | 91 | // update the gallery type |
92 | - if ( !empty( $type ) ) { |
|
92 | + if (!empty($type)) { |
|
93 | 93 | |
94 | - update_post_meta( $postid, 'aesop_gallery_type', $type ); |
|
94 | + update_post_meta($postid, 'aesop_gallery_type', $type); |
|
95 | 95 | |
96 | 96 | } |
97 | 97 | |
98 | - do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() ); |
|
98 | + do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID()); |
|
99 | 99 | |
100 | 100 | return array( |
101 | 101 | 'message' => 'gallery-created' |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @return array "message" key has the message. |
114 | 114 | */ |
115 | - public function update( $data ) { |
|
116 | - |
|
117 | - $options = isset( $data['fields'] ) ? $data['fields'] : false; |
|
118 | - $postid = !empty( $options ) ? (int) $options['id'] : false; |
|
119 | - $gallery_ids = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false; |
|
120 | - if ( ! empty( $data ) && $data[ 'gallery_type' ] ) { |
|
121 | - $type = $data[ 'gallery_type' ]; |
|
122 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
123 | - $type = $options[ 'galleryType' ]; |
|
124 | - }else{ |
|
115 | + public function update($data) { |
|
116 | + |
|
117 | + $options = isset($data['fields']) ? $data['fields'] : false; |
|
118 | + $postid = !empty($options) ? (int) $options['id'] : false; |
|
119 | + $gallery_ids = isset($data['gallery_ids']) ? $data['gallery_ids'] : false; |
|
120 | + if (!empty($data) && $data['gallery_type']) { |
|
121 | + $type = $data['gallery_type']; |
|
122 | + }elseif (!empty($options) && $options['galleryType']) { |
|
123 | + $type = $options['galleryType']; |
|
124 | + } else { |
|
125 | 125 | $type = false; |
126 | 126 | } |
127 | 127 | |
128 | - save_gallery::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
|
128 | + save_gallery::save_gallery_options($postid, $gallery_ids, $options, $type); |
|
129 | 129 | |
130 | 130 | return array( |
131 | 131 | 'message' => 'gallery-updated' |
@@ -143,25 +143,25 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return bool |
145 | 145 | */ |
146 | - public function get_images( $data ) { |
|
146 | + public function get_images($data) { |
|
147 | 147 | |
148 | 148 | //check caps |
149 | - if ( !current_user_can( 'edit_posts' ) ) { |
|
149 | + if (!current_user_can('edit_posts')) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
153 | 153 | // bail if no id specified like on new galleries |
154 | - if ( is_null( $data['post_id'] ) || empty( $data['post_id'] ) ) { |
|
154 | + if (is_null($data['post_id']) || empty($data['post_id'])) { |
|
155 | 155 | return false; |
156 | 156 | } |
157 | 157 | |
158 | - $postid = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
158 | + $postid = isset($data['post_id']) ? $data['post_id'] : false; |
|
159 | 159 | |
160 | 160 | // fetch image ids from cache |
161 | - $image_ids = get_post_meta( $postid, '_ase_gallery_images', true ); |
|
161 | + $image_ids = get_post_meta($postid, '_ase_gallery_images', true); |
|
162 | 162 | |
163 | 163 | // send ids to return images |
164 | - return self::get_the_images( $image_ids ); |
|
164 | + return self::get_the_images($image_ids); |
|
165 | 165 | |
166 | 166 | } |
167 | 167 | |
@@ -171,32 +171,32 @@ discard block |
||
171 | 171 | * @param $image_ids array array of image ids |
172 | 172 | * @since 0.1 |
173 | 173 | */ |
174 | - private function get_the_images( $image_ids = '' ) { |
|
174 | + private function get_the_images($image_ids = '') { |
|
175 | 175 | |
176 | - if ( empty( $image_ids ) ) |
|
176 | + if (empty($image_ids)) |
|
177 | 177 | return; |
178 | 178 | |
179 | - $image_ids = array_map( 'intval', explode( ',', $image_ids ) ); |
|
179 | + $image_ids = array_map('intval', explode(',', $image_ids)); |
|
180 | 180 | |
181 | 181 | $out[] = '<ul id="ase-gallery-images">'; |
182 | 182 | |
183 | - if ( !empty( $image_ids ) ): |
|
183 | + if (!empty($image_ids)): |
|
184 | 184 | |
185 | - foreach ( $image_ids as $image_id ) { |
|
185 | + foreach ($image_ids as $image_id) { |
|
186 | 186 | |
187 | - $image = wp_get_attachment_image_src( $image_id, 'thumbnail', false ); |
|
187 | + $image = wp_get_attachment_image_src($image_id, 'thumbnail', false); |
|
188 | 188 | |
189 | - $out[] = sprintf( ' |
|
189 | + $out[] = sprintf(' |
|
190 | 190 | <li id="%1s" class="ase-gallery-image"> |
191 | 191 | <i class="dashicons dashicons-no-alt" title="%2s"></i> |
192 | 192 | <i class="dashicons dashicons-edit" title="%3s"></i> |
193 | 193 | <img src="%4s"> |
194 | 194 | </li> |
195 | 195 | ', |
196 | - absint( $image_id ), |
|
197 | - __( 'Delete From Gallery', 'lasso' ), |
|
198 | - __( 'Edit Image Caption', 'lasso' ), |
|
199 | - esc_url( $image[0] ) |
|
196 | + absint($image_id), |
|
197 | + __('Delete From Gallery', 'lasso'), |
|
198 | + __('Edit Image Caption', 'lasso'), |
|
199 | + esc_url($image[0]) |
|
200 | 200 | ); |
201 | 201 | |
202 | 202 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | $out[] = '</ul>'; |
207 | 207 | |
208 | - return array( 'html' => implode( '', $out ) ); |
|
208 | + return array('html' => implode('', $out)); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | * |
218 | 218 | * @return array Array of keys to pull from $data per action and their sanitization callback |
219 | 219 | */ |
220 | - public static function params(){ |
|
221 | - $params[ 'process_gallery_swap' ] = array( |
|
220 | + public static function params() { |
|
221 | + $params['process_gallery_swap'] = array( |
|
222 | 222 | 'gallery_id' => 'absint', |
223 | 223 | |
224 | 224 | ); |
225 | 225 | |
226 | - $params[ 'process_gallery_create' ] = array( |
|
226 | + $params['process_gallery_create'] = array( |
|
227 | 227 | 'postid' => 'absint', |
228 | 228 | 'content' => 'wp_kses_post', |
229 | 229 | 'galleryType' => array( |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | ); |
236 | 236 | |
237 | - $params[ 'process_gallery_update' ] = array( |
|
237 | + $params['process_gallery_update'] = array( |
|
238 | 238 | 'postid' => 'absint', |
239 | 239 | 'gallery_ids' => 'lasso_sanitize_data', |
240 | 240 | 'fields' => 'lasso_sanitize_data', |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | ) |
245 | 245 | ); |
246 | 246 | |
247 | - $params[ 'process_gallery_get_images' ] = array( |
|
247 | + $params['process_gallery_get_images'] = array( |
|
248 | 248 | 'post_id' => 'absint' |
249 | 249 | ); |
250 | 250 | |
@@ -260,19 +260,19 @@ discard block |
||
260 | 260 | * @return array Array of additional functions to use to authorize action. |
261 | 261 | */ |
262 | 262 | public static function auth_callbacks() { |
263 | - $params[ 'process_gallery_swap' ] = array( |
|
263 | + $params['process_gallery_swap'] = array( |
|
264 | 264 | 'lasso_user_can' |
265 | 265 | ); |
266 | 266 | |
267 | - $params[ 'process_gallery_create' ] = array( |
|
267 | + $params['process_gallery_create'] = array( |
|
268 | 268 | 'is_user_logged_in' |
269 | 269 | ); |
270 | 270 | |
271 | - $params[ 'process_gallery_update' ] = array( |
|
271 | + $params['process_gallery_update'] = array( |
|
272 | 272 | 'lasso_user_can' |
273 | 273 | ); |
274 | 274 | |
275 | - $params[ 'process_gallery_get_images' ] = array(); |
|
275 | + $params['process_gallery_get_images'] = array(); |
|
276 | 276 | |
277 | 277 | return $params; |
278 | 278 |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | $gallery_ids = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false; |
120 | 120 | if ( ! empty( $data ) && $data[ 'gallery_type' ] ) { |
121 | 121 | $type = $data[ 'gallery_type' ]; |
122 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
122 | + } elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
123 | 123 | $type = $options[ 'galleryType' ]; |
124 | - }else{ |
|
124 | + } else{ |
|
125 | 125 | $type = false; |
126 | 126 | } |
127 | 127 | |
@@ -173,8 +173,9 @@ discard block |
||
173 | 173 | */ |
174 | 174 | private function get_the_images( $image_ids = '' ) { |
175 | 175 | |
176 | - if ( empty( $image_ids ) ) |
|
177 | - return; |
|
176 | + if ( empty( $image_ids ) ) { |
|
177 | + return; |
|
178 | + } |
|
178 | 179 | |
179 | 180 | $image_ids = array_map( 'intval', explode( ',', $image_ids ) ); |
180 | 181 |
@@ -28,27 +28,27 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function save( $data ) { |
|
31 | + public function save($data) { |
|
32 | 32 | |
33 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
34 | - $locations = isset( $data['ase-map-component-locations'] ) ? $data['ase-map-component-locations'] : false; |
|
35 | - $start_point = isset( $data['ase-map-component-start-point'] ) ? $data['ase-map-component-start-point']: false; |
|
36 | - $zoom = isset( $data['ase-map-component-zoom'] ) ? $data['ase-map-component-zoom' ] : false; |
|
33 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
34 | + $locations = isset($data['ase-map-component-locations']) ? $data['ase-map-component-locations'] : false; |
|
35 | + $start_point = isset($data['ase-map-component-start-point']) ? $data['ase-map-component-start-point'] : false; |
|
36 | + $zoom = isset($data['ase-map-component-zoom']) ? $data['ase-map-component-zoom'] : false; |
|
37 | 37 | |
38 | - if ( is_array( $locations ) ) { |
|
39 | - delete_post_meta( $postid, 'ase_map_component_locations' ); |
|
38 | + if (is_array($locations)) { |
|
39 | + delete_post_meta($postid, 'ase_map_component_locations'); |
|
40 | 40 | |
41 | 41 | // update locations if set |
42 | - foreach ( $locations as $location ) { |
|
43 | - $point = json_decode( urldecode( $location ), true ); |
|
44 | - add_post_meta( $postid, 'ase_map_component_locations', $point ); |
|
42 | + foreach ($locations as $location) { |
|
43 | + $point = json_decode(urldecode($location), true); |
|
44 | + add_post_meta($postid, 'ase_map_component_locations', $point); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // udpate start point |
48 | - update_post_meta( $postid, 'ase_map_component_start_point', $start_point ); |
|
48 | + update_post_meta($postid, 'ase_map_component_start_point', $start_point); |
|
49 | 49 | |
50 | 50 | // update zoom |
51 | - update_post_meta( $postid, 'ase_map_component_zoom', $zoom ); |
|
51 | + update_post_meta($postid, 'ase_map_component_zoom', $zoom); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return true; |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
64 | 64 | */ |
65 | - public static function params(){ |
|
66 | - $params[ 'process_map_save' ] = array( |
|
65 | + public static function params() { |
|
66 | + $params['process_map_save'] = array( |
|
67 | 67 | 'postid' => 'absint', |
68 | 68 | 'ase-map-component-locations' => 'lasso_sanitize_data', |
69 | 69 | 'ase-map-component-start-point' => array( |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @return array Array of additional functions to use to authorize action. |
88 | 88 | */ |
89 | 89 | public static function auth_callbacks() { |
90 | - $params[ 'process_map_save' ] = array( |
|
90 | + $params['process_map_save'] = array( |
|
91 | 91 | 'lasso_user_can' |
92 | 92 | ); |
93 | 93 |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return bool Always returns true. |
30 | 30 | */ |
31 | - public function update( $data ) { |
|
31 | + public function update($data) { |
|
32 | 32 | |
33 | - $post_id = isset( $data['post_id'] ) ? $data['post_id'] : false; |
|
33 | + $post_id = isset($data['post_id']) ? $data['post_id'] : false; |
|
34 | 34 | |
35 | 35 | |
36 | 36 | /** |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @param array $allowed_fields The fields |
42 | 42 | */ |
43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
44 | - if ( ! empty( $allowed_fields ) ) { |
|
45 | - foreach( $allowed_fields as $field ) { |
|
46 | - if ( isset( $data[ $field ] ) ) { |
|
47 | - update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
|
43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
44 | + if (!empty($allowed_fields)) { |
|
45 | + foreach ($allowed_fields as $field) { |
|
46 | + if (isset($data[$field])) { |
|
47 | + update_post_meta($post_id, lasso_unclean_string($field), $data[$field]); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | } |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return array Array of keys to pull from $data per action and their sanitization callback |
64 | 64 | */ |
65 | - public static function params(){ |
|
66 | - $params[ 'process_meta_update' ] = array( |
|
65 | + public static function params() { |
|
66 | + $params['process_meta_update'] = array( |
|
67 | 67 | 'post_id' => 'absint', |
68 | 68 | 'tab_name' => 'trim' |
69 | 69 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return array Array of additional functions to use to authorize action. |
81 | 81 | */ |
82 | 82 | public static function auth_callbacks() { |
83 | - $params[ 'process_meta_update' ] = array( |
|
83 | + $params['process_meta_update'] = array( |
|
84 | 84 | 'lasso_user_can' |
85 | 85 | ); |
86 | 86 |
@@ -28,26 +28,26 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.0 |
30 | 30 | */ |
31 | - public function post( $data ) { |
|
31 | + public function post($data) { |
|
32 | 32 | |
33 | - $title = $data[ 'story_title' ]; |
|
33 | + $title = $data['story_title']; |
|
34 | 34 | |
35 | - $object = is_null( $data[ 'object'] ) ? false : $data[ 'object' ]; |
|
35 | + $object = is_null($data['object']) ? false : $data['object']; |
|
36 | 36 | |
37 | 37 | // insert a new post |
38 | 38 | $args = array( |
39 | 39 | 'post_title' => $title, |
40 | 40 | 'post_status' => 'draft', |
41 | 41 | 'post_type' => $object, |
42 | - 'post_content' => apply_filters( 'lasso_new_object_content', __( 'Once upon a time...','lasso') ) |
|
42 | + 'post_content' => apply_filters('lasso_new_object_content', __('Once upon a time...', 'lasso')) |
|
43 | 43 | ); |
44 | 44 | |
45 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_object_args', $args ) ); |
|
45 | + $postid = wp_insert_post(apply_filters('lasso_insert_object_args', $args)); |
|
46 | 46 | |
47 | - do_action( 'lasso_new_object', $postid, $object, $title, get_current_user_ID() ); |
|
47 | + do_action('lasso_new_object', $postid, $object, $title, get_current_user_ID()); |
|
48 | 48 | |
49 | 49 | return array( |
50 | - 'postlink' => get_permalink( $postid ) |
|
50 | + 'postlink' => get_permalink($postid) |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | } |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
61 | 61 | */ |
62 | 62 | public static function params() { |
63 | - $params[ 'process_new_object_post' ] = array( |
|
64 | - 'story_title' => array( 'wp_strip_all_tags', 'trim' ), |
|
63 | + $params['process_new_object_post'] = array( |
|
64 | + 'story_title' => array('wp_strip_all_tags', 'trim'), |
|
65 | 65 | 'object' => 'trim' |
66 | 66 | ); |
67 | 67 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return array Array of additional functions to use to authorize action. |
78 | 78 | */ |
79 | 79 | public static function auth_callbacks() { |
80 | - $params[ 'process_new_object_post' ] = array(); |
|
80 | + $params['process_new_object_post'] = array(); |
|
81 | 81 | |
82 | 82 | return $params; |
83 | 83 |
@@ -27,17 +27,17 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return array |
29 | 29 | */ |
30 | - public static function get( $data ) { |
|
30 | + public static function get($data) { |
|
31 | 31 | $args = array(); |
32 | - if ( isset( $data[ 'limit' ] ) ) { |
|
33 | - $args[ 'posts_per_page' ] = $data[ 'limit' ]; |
|
34 | - }else{ |
|
35 | - $args[ 'posts_per_page' ] = 6; // we start at revision 0 |
|
32 | + if (isset($data['limit'])) { |
|
33 | + $args['posts_per_page'] = $data['limit']; |
|
34 | + } else { |
|
35 | + $args['posts_per_page'] = 6; // we start at revision 0 |
|
36 | 36 | } |
37 | 37 | |
38 | - $revisions = wp_get_post_revisions( $data[ 'postid' ], $args ); |
|
39 | - if ( is_array( $revisions ) && ! empty( $revisions ) ) { |
|
40 | - self::set_revisions( $data[ 'postid' ], $revisions ); |
|
38 | + $revisions = wp_get_post_revisions($data['postid'], $args); |
|
39 | + if (is_array($revisions) && !empty($revisions)) { |
|
40 | + self::set_revisions($data['postid'], $revisions); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return self::$revisions; |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @param int $id The post ID to get the revisions for |
54 | 54 | * @param obj $revisions The revisions for this post |
55 | 55 | */ |
56 | - protected static function set_revisions( $id, $revisions ) { |
|
56 | + protected static function set_revisions($id, $revisions) { |
|
57 | 57 | |
58 | - array_walk( $revisions, function ( $post, $i ) { |
|
58 | + array_walk($revisions, function($post, $i) { |
|
59 | 59 | self::$revisions[] = array( |
60 | 60 | 'post_content' => $post->post_content, |
61 | 61 | 'post_title' => $post->post_title, |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
75 | 75 | */ |
76 | - public static function params(){ |
|
77 | - $params[ 'process_revision_get' ] = array( |
|
76 | + public static function params() { |
|
77 | + $params['process_revision_get'] = array( |
|
78 | 78 | 'postid' => 'absint', |
79 | 79 | 'limit' => 'absint' |
80 | 80 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @return array Array of additional functions to use to authorize action. |
91 | 91 | */ |
92 | 92 | public static function auth_callbacks() { |
93 | - $params[ 'process_revision_get' ] = array( |
|
93 | + $params['process_revision_get'] = array( |
|
94 | 94 | 'lasso_user_can' |
95 | 95 | ); |
96 | 96 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $args = array(); |
32 | 32 | if ( isset( $data[ 'limit' ] ) ) { |
33 | 33 | $args[ 'posts_per_page' ] = $data[ 'limit' ]; |
34 | - }else{ |
|
34 | + } else{ |
|
35 | 35 | $args[ 'posts_per_page' ] = 6; // we start at revision 0 |
36 | 36 | } |
37 | 37 |
@@ -19,26 +19,26 @@ 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 = $data[ 'content' ]; |
|
26 | + $postid = (int) $data['post_id']; |
|
27 | + $content = $data['content']; |
|
28 | 28 | |
29 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
29 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
30 | 30 | |
31 | 31 | $args = array( |
32 | 32 | 'ID' => (int) $postid, |
33 | 33 | 'post_content' => $content |
34 | 34 | ); |
35 | 35 | |
36 | - wp_update_post( apply_filters( 'lasso_object_save_args', $args ) ); |
|
36 | + wp_update_post(apply_filters('lasso_object_save_args', $args)); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
40 | 40 | // run save action |
41 | - do_action( 'lasso_post_saved', $postid, $content, get_current_user_ID() ); |
|
41 | + do_action('lasso_post_saved', $postid, $content, get_current_user_ID()); |
|
42 | 42 | |
43 | 43 | return true; |
44 | 44 | |
@@ -53,24 +53,24 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @return bool Always returns true. |
55 | 55 | */ |
56 | - public function publish_content( $data ) { |
|
56 | + public function publish_content($data) { |
|
57 | 57 | $save_to_post_disabled = $this->save_to_post_disables(); |
58 | 58 | |
59 | - $postid = (int) $data[ 'post_id' ]; |
|
60 | - $content = $data[ 'content' ]; |
|
59 | + $postid = (int) $data['post_id']; |
|
60 | + $content = $data['content']; |
|
61 | 61 | |
62 | - if ( 'off' == $save_to_post_disabled || empty( $save_to_post_disabled ) ) { |
|
62 | + if ('off' == $save_to_post_disabled || empty($save_to_post_disabled)) { |
|
63 | 63 | |
64 | - $args = array ( |
|
64 | + $args = array( |
|
65 | 65 | 'ID' => $postid, |
66 | 66 | 'post_content' => $content, |
67 | 67 | 'post_status' => 'publish' |
68 | 68 | ); |
69 | - wp_update_post( apply_filters( 'lasso_object_publish_args', $args ) ); |
|
69 | + wp_update_post(apply_filters('lasso_object_publish_args', $args)); |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - do_action( 'lasso_post_published', $postid, $content, get_current_user_ID() ); |
|
73 | + do_action('lasso_post_published', $postid, $content, get_current_user_ID()); |
|
74 | 74 | |
75 | 75 | return true; |
76 | 76 | |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @return array Array of keys to pull from $_POST per action and their sanitization callback |
85 | 85 | */ |
86 | - public static function params(){ |
|
87 | - $params[ 'process_save_content' ] = array( |
|
86 | + public static function params() { |
|
87 | + $params['process_save_content'] = array( |
|
88 | 88 | 'post_id' => 'absint', |
89 | 89 | 'content' => 'wp_kses_post' |
90 | 90 | ); |
91 | 91 | |
92 | - $params[ 'process_save_publish_content' ] = array( |
|
92 | + $params['process_save_publish_content'] = array( |
|
93 | 93 | 'post_id' => 'absint', |
94 | 94 | 'content' => 'wp_kses_post' |
95 | 95 | ); |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | * @return array Array of additional functions to use to authorize action. |
106 | 106 | */ |
107 | 107 | public static function auth_callbacks() { |
108 | - $params[ 'process_save_content' ] = array( |
|
108 | + $params['process_save_content'] = array( |
|
109 | 109 | 'lasso_user_can' |
110 | 110 | ); |
111 | 111 | |
112 | - $params[ 'process_save_publish_content' ] = array(); |
|
112 | + $params['process_save_publish_content'] = array(); |
|
113 | 113 | |
114 | 114 | return $params; |
115 | 115 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return bool |
126 | 126 | */ |
127 | 127 | protected function save_to_post_disables() { |
128 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
128 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
129 | 129 | |
130 | 130 | return $save_to_post_disabled; |
131 | 131 |