@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | * If we're on multsite we'll grab the site option which is stored in the main blogs site option tables, otherwise |
| 7 | 7 | * we'll grab the option which is stored on the single blogs option tables |
| 8 | 8 | * |
| 9 | - * @param unknown $option string name of the option |
|
| 10 | - * @param unknown $section string name of the section |
|
| 9 | + * @param string $option string name of the option |
|
| 10 | + * @param string $section string name of the section |
|
| 11 | 11 | * @param unknown $default string/int default option value |
| 12 | 12 | * @return the option value |
| 13 | 13 | * @since 1.0 |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * Used internally as a callback to build a tab or content area for modal addons |
| 275 | 275 | * |
| 276 | 276 | * @param $tab object |
| 277 | -* @param $type string tab or content |
|
| 277 | +* @param string $type string tab or content |
|
| 278 | 278 | * @uses lasso_modal_addons() |
| 279 | 279 | * @since 0.9.4 |
| 280 | 280 | */ |
@@ -12,21 +12,21 @@ discard block |
||
| 12 | 12 | * @return the option value |
| 13 | 13 | * @since 1.0 |
| 14 | 14 | */ |
| 15 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
| 15 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
| 16 | 16 | |
| 17 | - if ( empty( $option ) ) |
|
| 17 | + if (empty($option)) |
|
| 18 | 18 | return; |
| 19 | 19 | |
| 20 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 20 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 21 | 21 | |
| 22 | - $options = get_site_option( $section ); |
|
| 22 | + $options = get_site_option($section); |
|
| 23 | 23 | |
| 24 | 24 | } else { |
| 25 | 25 | |
| 26 | - $options = get_option( $section ); |
|
| 26 | + $options = get_option($section); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if ( isset( $options[$option] ) ) { |
|
| 29 | + if (isset($options[$option])) { |
|
| 30 | 30 | return $options[$option]; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | function lasso_editor_galleries_exist() { |
| 42 | 42 | |
| 43 | - $q = new wp_query( array( 'post_type' => 'ai_galleries', 'post_status' => 'publish' ) ); |
|
| 43 | + $q = new wp_query(array('post_type' => 'ai_galleries', 'post_status' => 'publish')); |
|
| 44 | 44 | |
| 45 | - if ( $q->have_posts() ) |
|
| 45 | + if ($q->have_posts()) |
|
| 46 | 46 | return true; |
| 47 | 47 | else |
| 48 | 48 | return false; |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | function lasso_get_supported_theme_class() { |
| 58 | 58 | |
| 59 | 59 | $name = wp_get_theme()->get('Name'); |
| 60 | - $slug = lasso_clean_string( $name ); |
|
| 60 | + $slug = lasso_clean_string($name); |
|
| 61 | 61 | |
| 62 | - switch ( $slug ) { |
|
| 62 | + switch ($slug) { |
|
| 63 | 63 | case 'aesop-story-theme': // aesop |
| 64 | 64 | $out = '.aesop-entry-content'; |
| 65 | 65 | break; |
@@ -108,16 +108,16 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return apply_filters('lasso_content_class', !empty( $out ) ? $out : false); |
|
| 111 | + return apply_filters('lasso_content_class', !empty($out) ? $out : false); |
|
| 112 | 112 | //return !empty( $out ) ? $out : false; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | function lasso_get_supported_theme_title_class() { |
| 116 | 116 | |
| 117 | 117 | $name = wp_get_theme()->get('Name'); |
| 118 | - $slug = lasso_clean_string( $name ); |
|
| 118 | + $slug = lasso_clean_string($name); |
|
| 119 | 119 | |
| 120 | - switch ( $slug ) { |
|
| 120 | + switch ($slug) { |
|
| 121 | 121 | |
| 122 | 122 | case 'aesop-story-theme': // aesop |
| 123 | 123 | $out = '.aesop-entry-title'; |
@@ -148,16 +148,16 @@ discard block |
||
| 148 | 148 | break; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - return apply_filters('lasso_title_class', !empty( $out ) ? $out : false); |
|
| 151 | + return apply_filters('lasso_title_class', !empty($out) ? $out : false); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //since 0.9.9.6 |
| 155 | 155 | function lasso_get_supported_theme_featured_image_class() { |
| 156 | 156 | |
| 157 | 157 | $name = wp_get_theme()->get('Name'); |
| 158 | - $slug = lasso_clean_string( $name ); |
|
| 158 | + $slug = lasso_clean_string($name); |
|
| 159 | 159 | |
| 160 | - return apply_filters('lasso_featured_image_class', !empty( $out ) ? $out : false); |
|
| 160 | + return apply_filters('lasso_featured_image_class', !empty($out) ? $out : false); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * @since 0.8.7 |
| 169 | 169 | * @return string of comma separated classes |
| 170 | 170 | */ |
| 171 | -function lasso_supported_no_save(){ |
|
| 171 | +function lasso_supported_no_save() { |
|
| 172 | 172 | |
| 173 | 173 | return apply_filters('lasso_dont_save', '.lasso--ignore, .sharedaddy, .us_wrapper, .twitter-tweet, .meta'); |
| 174 | 174 | } |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | * |
| 183 | 183 | * @return array|mixed|object|string|void |
| 184 | 184 | */ |
| 185 | -function lasso_sanitize_data( $data ) { |
|
| 186 | - return \lasso\sanatize::do_sanitize( $data ); |
|
| 185 | +function lasso_sanitize_data($data) { |
|
| 186 | + return \lasso\sanatize::do_sanitize($data); |
|
| 187 | 187 | |
| 188 | 188 | } |
| 189 | 189 | |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | * @since 0.9.3 |
| 194 | 194 | * @return string of comma delimited category slugs |
| 195 | 195 | */ |
| 196 | -function lasso_get_post_objects( $postid = '', $taxonomy = 'category') { |
|
| 196 | +function lasso_get_post_objects($postid = '', $taxonomy = 'category') { |
|
| 197 | 197 | |
| 198 | - if ( empty( $postid ) ) |
|
| 198 | + if (empty($postid)) |
|
| 199 | 199 | $postid = get_the_ID(); |
| 200 | 200 | |
| 201 | - $objects = 'category' == $taxonomy ? get_the_category( $postid ) : get_the_tags( $postid ); |
|
| 201 | + $objects = 'category' == $taxonomy ? get_the_category($postid) : get_the_tags($postid); |
|
| 202 | 202 | |
| 203 | - if ( empty( $objects) ) |
|
| 203 | + if (empty($objects)) |
|
| 204 | 204 | return; |
| 205 | 205 | |
| 206 | 206 | $out = ''; |
| 207 | - foreach( $objects as $object ) { |
|
| 207 | + foreach ($objects as $object) { |
|
| 208 | 208 | $out .= $object->slug.', '; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -218,15 +218,15 @@ discard block |
||
| 218 | 218 | * @since 0.9.3 |
| 219 | 219 | * @return array all categoiries |
| 220 | 220 | */ |
| 221 | -function lasso_get_objects( $taxonomy = 'category' ) { |
|
| 221 | +function lasso_get_objects($taxonomy = 'category') { |
|
| 222 | 222 | |
| 223 | 223 | $objects = 'category' == $taxonomy ? get_categories(array('hide_empty' => 0)) : get_tags(array('hide_empty' => 0)); |
| 224 | 224 | |
| 225 | - if ( empty( $objects) ) |
|
| 225 | + if (empty($objects)) |
|
| 226 | 226 | return; |
| 227 | 227 | |
| 228 | 228 | $out = array(); |
| 229 | - foreach( $objects as $object ) { |
|
| 229 | + foreach ($objects as $object) { |
|
| 230 | 230 | $out[] = $object->slug; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | function lasso_post_types() { |
| 244 | 244 | |
| 245 | - $post_types = get_post_types( array( |
|
| 245 | + $post_types = get_post_types(array( |
|
| 246 | 246 | 'public' => true, |
| 247 | - ), 'objects' ); |
|
| 248 | - $post_types = array_combine( array_keys( $post_types ), wp_list_pluck( $post_types, 'label' ) ); |
|
| 249 | - unset( $post_types[ 'attachment' ] ); |
|
| 247 | + ), 'objects'); |
|
| 248 | + $post_types = array_combine(array_keys($post_types), wp_list_pluck($post_types, 'label')); |
|
| 249 | + unset($post_types['attachment']); |
|
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | 252 | * Set which post types are allowed |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | * |
| 256 | 256 | * @param array $allowed_post_types Array of names (not labels) of allowed post types. Must be registered. |
| 257 | 257 | */ |
| 258 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page' ) ); |
|
| 259 | - foreach( $post_types as $name => $label ) { |
|
| 260 | - if ( ! in_array( $name, $allowed_post_types ) ) { |
|
| 261 | - unset( $post_types[ $name ] ); |
|
| 258 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
| 259 | + foreach ($post_types as $name => $label) { |
|
| 260 | + if (!in_array($name, $allowed_post_types)) { |
|
| 261 | + unset($post_types[$name]); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | } |
@@ -278,22 +278,22 @@ discard block |
||
| 278 | 278 | * @uses lasso_modal_addons() |
| 279 | 279 | * @since 0.9.4 |
| 280 | 280 | */ |
| 281 | -function lasso_modal_addons_content( $tab = '', $type ){ |
|
| 281 | +function lasso_modal_addons_content($tab = '', $type) { |
|
| 282 | 282 | |
| 283 | - $name = lasso_clean_string( $tab['name'] ); |
|
| 283 | + $name = lasso_clean_string($tab['name']); |
|
| 284 | 284 | |
| 285 | - if ( 'tab' == $type ) { |
|
| 285 | + if ('tab' == $type) { |
|
| 286 | 286 | |
| 287 | - $out = sprintf( '<li data-addon-name="%s">%s</li>', $name, $tab['name'] ); |
|
| 287 | + $out = sprintf('<li data-addon-name="%s">%s</li>', $name, $tab['name']); |
|
| 288 | 288 | |
| 289 | - } else if ( 'content' == $type ){ |
|
| 289 | + } else if ('content' == $type) { |
|
| 290 | 290 | |
| 291 | - $content = isset( $tab['content'] ) && is_callable( $tab['content'] ) ? call_user_func( $tab['content'] ) : false; |
|
| 292 | - $options = isset( $tab['options'] ) && is_callable( $tab['options'] ) ? call_user_func( $tab['options'] ) : false; |
|
| 291 | + $content = isset($tab['content']) && is_callable($tab['content']) ? call_user_func($tab['content']) : false; |
|
| 292 | + $options = isset($tab['options']) && is_callable($tab['options']) ? call_user_func($tab['options']) : false; |
|
| 293 | 293 | |
| 294 | - $out = sprintf( '<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
| 294 | + $out = sprintf('<div class="lasso--modal__content not-visible" data-addon-content="%s"> |
|
| 295 | 295 | %s%s |
| 296 | - </div>', $name, $content, lasso_option_form( $name, $options ) ); |
|
| 296 | + </div>', $name, $content, lasso_option_form($name, $options)); |
|
| 297 | 297 | |
| 298 | 298 | } |
| 299 | 299 | |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | * |
| 309 | 309 | * @return void|string |
| 310 | 310 | */ |
| 311 | -function lasso_clean_string( $string = '' ) { |
|
| 311 | +function lasso_clean_string($string = '') { |
|
| 312 | 312 | |
| 313 | - if ( empty( $string ) ) |
|
| 313 | + if (empty($string)) |
|
| 314 | 314 | return; |
| 315 | 315 | |
| 316 | - return sanitize_text_field( strtolower( preg_replace('/[\s_]/', '-', $string ) ) ); |
|
| 316 | + return sanitize_text_field(strtolower(preg_replace('/[\s_]/', '-', $string))); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -326,13 +326,13 @@ discard block |
||
| 326 | 326 | * |
| 327 | 327 | * @return void|string |
| 328 | 328 | */ |
| 329 | -function lasso_unclean_string( $string = '' ) { |
|
| 329 | +function lasso_unclean_string($string = '') { |
|
| 330 | 330 | |
| 331 | - if ( empty( $string ) ) { |
|
| 331 | + if (empty($string)) { |
|
| 332 | 332 | return; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | - return sanitize_text_field( strtolower( str_replace( '-', '_', $string ) ) ); |
|
| 335 | + return sanitize_text_field(strtolower(str_replace('-', '_', $string))); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | |
@@ -347,16 +347,16 @@ discard block |
||
| 347 | 347 | * @param unknown $postid int the id of the post object to check against |
| 348 | 348 | * @since 1.0 |
| 349 | 349 | */ |
| 350 | -if ( !function_exists( 'lasso_user_can' ) ): |
|
| 351 | - function lasso_user_can( $action = '', $postid = 0 ) { |
|
| 350 | +if (!function_exists('lasso_user_can')): |
|
| 351 | + function lasso_user_can($action = '', $postid = 0) { |
|
| 352 | 352 | |
| 353 | - if ( empty( $action ) ) |
|
| 353 | + if (empty($action)) |
|
| 354 | 354 | $action = 'edit_posts'; |
| 355 | 355 | |
| 356 | - if ( empty( $postid ) ) |
|
| 356 | + if (empty($postid)) |
|
| 357 | 357 | $postid = get_the_ID(); |
| 358 | 358 | |
| 359 | - if ( is_user_logged_in() && current_user_can( $action, $postid ) ) { |
|
| 359 | + if (is_user_logged_in() && current_user_can($action, $postid)) { |
|
| 360 | 360 | |
| 361 | 361 | return true; |
| 362 | 362 | |
@@ -374,25 +374,25 @@ discard block |
||
| 374 | 374 | * |
| 375 | 375 | * @since 0.9.5 |
| 376 | 376 | */ |
| 377 | -if ( !function_exists('lasso_editor_empty_results') ): |
|
| 377 | +if (!function_exists('lasso_editor_empty_results')): |
|
| 378 | 378 | |
| 379 | - function lasso_editor_empty_results( $type = 'posts' ){ |
|
| 379 | + function lasso_editor_empty_results($type = 'posts') { |
|
| 380 | 380 | |
| 381 | - if ( 'posts' == $type ) { |
|
| 381 | + if ('posts' == $type) { |
|
| 382 | 382 | |
| 383 | - $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso') ); |
|
| 383 | + $string = apply_filters('lasso_empty_state_message', __('No posts to show', 'lasso')); |
|
| 384 | 384 | $icon = 'lasso-icon-file-text2'; |
| 385 | 385 | $button = false; |
| 386 | 386 | |
| 387 | - } elseif ( 'revision' == $type ) { |
|
| 387 | + } elseif ('revision' == $type) { |
|
| 388 | 388 | |
| 389 | - $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso') ); |
|
| 389 | + $string = apply_filters('lasso_empty_state_message', __('No revisions found', 'lasso')); |
|
| 390 | 390 | $icon = 'lasso-icon-history'; |
| 391 | - $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close','lasso') ); |
|
| 391 | + $button = sprintf('<a href="#" class="lasso--btn-secondary" id="lasso--close-modal">%s</a>', __('Close', 'lasso')); |
|
| 392 | 392 | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - 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 ); |
|
| 395 | + 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); |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | endif; |
@@ -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,22 +45,22 @@ 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 | - $options = array_map( 'sanitize_text_field', $options ); |
|
| 55 | + $options = array_map('sanitize_text_field', $options); |
|
| 56 | 56 | |
| 57 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 57 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 58 | 58 | |
| 59 | - update_site_option( 'lasso_editor', $options ); |
|
| 59 | + update_site_option('lasso_editor', $options); |
|
| 60 | 60 | |
| 61 | 61 | } else { |
| 62 | 62 | |
| 63 | - update_option( 'lasso_editor', $options ); |
|
| 63 | + update_option('lasso_editor', $options); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | wp_send_json_success(); |
@@ -82,111 +82,111 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function lasso_editor_settings_form() { |
| 84 | 84 | |
| 85 | - if ( !is_user_logged_in() ) |
|
| 85 | + if (!is_user_logged_in()) |
|
| 86 | 86 | return; |
| 87 | 87 | |
| 88 | - $article_object = lasso_editor_get_option( 'article_class', 'lasso_editor' ); |
|
| 89 | - $featImgClass = lasso_editor_get_option( 'featimg_class', 'lasso_editor' ); |
|
| 90 | - $titleClass = lasso_editor_get_option( 'title_class', 'lasso_editor' ); |
|
| 88 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
| 89 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
| 90 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
| 91 | 91 | |
| 92 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
| 93 | - $save_to_post_disabled = lasso_editor_get_option( 'post_save_disabled', 'lasso_editor' ); |
|
| 94 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
| 95 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
| 92 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
| 93 | + $save_to_post_disabled = lasso_editor_get_option('post_save_disabled', 'lasso_editor'); |
|
| 94 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
| 95 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
| 96 | 96 | |
| 97 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
| 98 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
| 97 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 98 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
| 99 | 99 | |
| 100 | 100 | ?> |
| 101 | 101 | <div class="wrap"> |
| 102 | 102 | |
| 103 | - <h2><?php _e( 'Editus Settings', 'lasso' );?></h2> |
|
| 103 | + <h2><?php _e('Editus Settings', 'lasso'); ?></h2> |
|
| 104 | 104 | |
| 105 | 105 | <form id="lasso-editor-settings-form" class="lasso--form-settings" method="post" enctype="multipart/form-data"> |
| 106 | 106 | |
| 107 | - <?php do_action('lasso_settings_before');?> |
|
| 107 | + <?php do_action('lasso_settings_before'); ?> |
|
| 108 | 108 | |
| 109 | 109 | <div class="lasso-editor-settings--option-wrap"> |
| 110 | 110 | <div class="lasso-editor-settings--option-inner"> |
| 111 | - <label><?php _e( 'Article Class', 'lasso' );?></label> |
|
| 112 | - <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> |
|
| 113 | - <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr( $article_object );?>" placeholder=".entry-content"> |
|
| 111 | + <label><?php _e('Article Class', 'lasso'); ?></label> |
|
| 112 | + <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> |
|
| 113 | + <input type="text" name="lasso_editor[article_class]" id="lasso_editor[article_class]" value="<?php echo esc_attr($article_object); ?>" placeholder=".entry-content"> |
|
| 114 | 114 | </div> |
| 115 | 115 | </div> |
| 116 | 116 | |
| 117 | 117 | <div class="lasso-editor-settings--option-wrap"> |
| 118 | 118 | <div class="lasso-editor-settings--option-inner"> |
| 119 | - <label><?php _e( 'Featured Image Class', 'lasso' );?></label> |
|
| 120 | - <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> |
|
| 121 | - <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr( $featImgClass );?>" placeholder=".entry-content"> |
|
| 119 | + <label><?php _e('Featured Image Class', 'lasso'); ?></label> |
|
| 120 | + <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> |
|
| 121 | + <input type="text" name="lasso_editor[featimg_class]" id="lasso_editor[featimg_class]" value="<?php echo esc_attr($featImgClass); ?>" placeholder=".entry-content"> |
|
| 122 | 122 | </div> |
| 123 | 123 | </div> |
| 124 | 124 | |
| 125 | 125 | <div class="lasso-editor-settings--option-wrap"> |
| 126 | 126 | <div class="lasso-editor-settings--option-inner"> |
| 127 | - <label><?php _e( 'Article Title Class', 'lasso' );?></label> |
|
| 128 | - <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> |
|
| 129 | - <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr( $titleClass );?>" placeholder=".entry-content"> |
|
| 127 | + <label><?php _e('Article Title Class', 'lasso'); ?></label> |
|
| 128 | + <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> |
|
| 129 | + <input type="text" name="lasso_editor[title_class]" id="lasso_editor[title_class]" value="<?php echo esc_attr($titleClass); ?>" placeholder=".entry-content"> |
|
| 130 | 130 | </div> |
| 131 | 131 | </div> |
| 132 | 132 | |
| 133 | 133 | <!-- Advanced --> |
| 134 | 134 | <div class="lasso-editor-settings--option-wrap"> |
| 135 | 135 | <div class="lasso-editor-settings--option-inner"> |
| 136 | - <label><?php _e( 'Ignored Items to Save', 'lasso' );?></label> |
|
| 137 | - <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> |
|
| 138 | - <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr( $objectsNoSave );?></textarea> |
|
| 136 | + <label><?php _e('Ignored Items to Save', 'lasso'); ?></label> |
|
| 137 | + <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> |
|
| 138 | + <textarea name="lasso_editor[dont_save]" id="lasso_editor[dont_save]" placeholder=".classname, .another-class"><?php echo esc_attr($objectsNoSave); ?></textarea> |
|
| 139 | 139 | </div> |
| 140 | 140 | </div> |
| 141 | 141 | |
| 142 | 142 | <div class="lasso-editor-settings--option-wrap"> |
| 143 | 143 | <div class="lasso-editor-settings--option-inner"> |
| 144 | - <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked( $toolbar_headings, 'on' );?> > |
|
| 145 | - <label for="lasso_editor[toolbar_headings]"><?php _e( 'Enable Toolbar Headings', 'lasso' );?></label> |
|
| 146 | - <span class="lasso--setting-description"><?php _e( 'By default the H2 and H3 options for headings are in the insert HTML area. You may prefer those headings to act just like the underline, and strikethrough, so toggling this will add them to the toolbar.', 'lasso' );?></span> |
|
| 144 | + <input type="checkbox" class="checkbox" name="lasso_editor[toolbar_headings]" id="lasso_editor[toolbar_headings]" <?php echo checked($toolbar_headings, 'on'); ?> > |
|
| 145 | + <label for="lasso_editor[toolbar_headings]"><?php _e('Enable Toolbar Headings', 'lasso'); ?></label> |
|
| 146 | + <span class="lasso--setting-description"><?php _e('By default the H2 and H3 options for headings are in the insert HTML area. You may prefer those headings to act just like the underline, and strikethrough, so toggling this will add them to the toolbar.', 'lasso'); ?></span> |
|
| 147 | 147 | |
| 148 | 148 | </div> |
| 149 | 149 | </div> |
| 150 | 150 | |
| 151 | 151 | <div class="lasso-editor-settings--option-wrap"> |
| 152 | 152 | <div class="lasso-editor-settings--option-inner"> |
| 153 | - <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' );?> > |
|
| 154 | - <label for="lasso_editor[post_save_disabled]"><?php _e( 'Disable Post Saving', 'lasso' );?></label> |
|
| 155 | - <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> |
|
| 153 | + <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'); ?> > |
|
| 154 | + <label for="lasso_editor[post_save_disabled]"><?php _e('Disable Post Saving', 'lasso'); ?></label> |
|
| 155 | + <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> |
|
| 156 | 156 | |
| 157 | 157 | </div> |
| 158 | 158 | </div> |
| 159 | 159 | |
| 160 | 160 | <div class="lasso-editor-settings--option-wrap"> |
| 161 | 161 | <div class="lasso-editor-settings--option-inner"> |
| 162 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked( $post_settings_disabled, 'on' );?> > |
|
| 163 | - <label for="lasso_editor[post_settings_disabled]"> <?php _e( 'Disable Post Settings', 'lasso' );?></label> |
|
| 164 | - <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> |
|
| 162 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_settings_disabled]" id="lasso_editor[post_settings_disabled]" <?php echo checked($post_settings_disabled, 'on'); ?> > |
|
| 163 | + <label for="lasso_editor[post_settings_disabled]"> <?php _e('Disable Post Settings', 'lasso'); ?></label> |
|
| 164 | + <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> |
|
| 165 | 165 | </div> |
| 166 | 166 | </div> |
| 167 | 167 | |
| 168 | 168 | <div class="lasso-editor-settings--option-wrap"> |
| 169 | 169 | <div class="lasso-editor-settings--option-inner"> |
| 170 | - <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked( $post_new_disabled, 'on' );?> > |
|
| 171 | - <label for="lasso_editor[post_adding_disabled]"><?php _e( 'Disable Post Adding', 'lasso' );?></label> |
|
| 172 | - <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> |
|
| 170 | + <input type="checkbox" class="checkbox" name="lasso_editor[post_adding_disabled]" id="lasso_editor[post_adding_disabled]" <?php echo checked($post_new_disabled, 'on'); ?> > |
|
| 171 | + <label for="lasso_editor[post_adding_disabled]"><?php _e('Disable Post Adding', 'lasso'); ?></label> |
|
| 172 | + <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> |
|
| 173 | 173 | </div> |
| 174 | 174 | </div> |
| 175 | 175 | |
| 176 | 176 | <div class="lasso-editor-settings--option-wrap last"> |
| 177 | 177 | <div class="lasso-editor-settings--option-inner"> |
| 178 | - <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked( $shortcodify_disabled, 'on' );?> > |
|
| 179 | - <label for="lasso_editor[shortcodify_disabled]"><?php _e( 'Disable Aesop Component Conversion', 'lasso' );?></label> |
|
| 180 | - <span class="lasso--setting-description"><?php _e( 'Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso' );?></span> |
|
| 178 | + <input type="checkbox" class="checkbox" name="lasso_editor[shortcodify_disabled]" id="lasso_editor[shortcodify_disabled]" <?php echo checked($shortcodify_disabled, 'on'); ?> > |
|
| 179 | + <label for="lasso_editor[shortcodify_disabled]"><?php _e('Disable Aesop Component Conversion', 'lasso'); ?></label> |
|
| 180 | + <span class="lasso--setting-description"><?php _e('Check this box to disable the conversion process used on Aesop Story Engine components.', 'lasso'); ?></span> |
|
| 181 | 181 | </div> |
| 182 | 182 | </div> |
| 183 | 183 | |
| 184 | - <?php do_action('lasso_settings_after');?> |
|
| 184 | + <?php do_action('lasso_settings_after'); ?> |
|
| 185 | 185 | |
| 186 | 186 | <div class="lasso-editor-settings--submit"> |
| 187 | 187 | <input type="hidden" name="action" value="lasso-editor-settings" /> |
| 188 | - <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'lasso' );?>" /> |
|
| 189 | - <?php wp_nonce_field( 'nonce', 'lasso_editor_settings' ); ?> |
|
| 188 | + <input type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'lasso'); ?>" /> |
|
| 189 | + <?php wp_nonce_field('nonce', 'lasso_editor_settings'); ?> |
|
| 190 | 190 | </div> |
| 191 | 191 | </form> |
| 192 | 192 | |
@@ -10,15 +10,15 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class assets { |
| 12 | 12 | |
| 13 | - public function __construct(){ |
|
| 13 | + public function __construct() { |
|
| 14 | 14 | |
| 15 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
| 15 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - public function scripts(){ |
|
| 18 | + public function scripts() { |
|
| 19 | 19 | |
| 20 | 20 | |
| 21 | - if ( lasso_user_can('edit_posts') ) { |
|
| 21 | + if (lasso_user_can('edit_posts')) { |
|
| 22 | 22 | |
| 23 | 23 | wp_enqueue_style('lasso-style', LASSO_URL.'/public/assets/css/lasso.css', LASSO_VERSION, true); |
| 24 | 24 | |
@@ -33,81 +33,81 @@ discard block |
||
| 33 | 33 | // url for json api |
| 34 | 34 | $home_url = function_exists('json_get_url_prefix') ? json_get_url_prefix() : false; |
| 35 | 35 | |
| 36 | - $article_object = lasso_editor_get_option('article_class','lasso_editor'); |
|
| 36 | + $article_object = lasso_editor_get_option('article_class', 'lasso_editor'); |
|
| 37 | 37 | |
| 38 | - $article_object = empty( $article_object ) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
| 38 | + $article_object = empty($article_object) && lasso_get_supported_theme_class() ? lasso_get_supported_theme_class() : $article_object; |
|
| 39 | 39 | |
| 40 | - $featImgClass = lasso_editor_get_option('featimg_class','lasso_editor'); |
|
| 41 | - if (empty( $featImgClass )) { |
|
| 40 | + $featImgClass = lasso_editor_get_option('featimg_class', 'lasso_editor'); |
|
| 41 | + if (empty($featImgClass)) { |
|
| 42 | 42 | $featImgClass = lasso_get_supported_theme_featured_image_class(); |
| 43 | 43 | } |
| 44 | - $titleClass = lasso_editor_get_option('title_class','lasso_editor'); |
|
| 45 | - if (empty( $titleClass )) { |
|
| 44 | + $titleClass = lasso_editor_get_option('title_class', 'lasso_editor'); |
|
| 45 | + if (empty($titleClass)) { |
|
| 46 | 46 | $titleClass = lasso_get_supported_theme_title_class(); |
| 47 | 47 | } |
| 48 | - $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 49 | - $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
| 48 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 49 | + $objectsNoSave = lasso_editor_get_option('dont_save', 'lasso_editor'); |
|
| 50 | 50 | |
| 51 | 51 | // post id reference |
| 52 | - $postid = get_the_ID(); |
|
| 52 | + $postid = get_the_ID(); |
|
| 53 | 53 | |
| 54 | 54 | $strings = array( |
| 55 | - 'save' => __('Save','lasso'), |
|
| 56 | - 'saving' => __('Saving...','lasso'), |
|
| 57 | - 'saved' => __('Saved!','lasso'), |
|
| 58 | - 'adding' => __('Adding...','lasso'), |
|
| 59 | - 'added' => __('Added!','lasso'), |
|
| 60 | - 'loading' => __('Loading...','lasso'), |
|
| 61 | - 'loadMore' => __('Load More','lasso'), |
|
| 62 | - 'noPostsFound' => __('No more posts found','lasso'), |
|
| 63 | - 'galleryCreated' => __('Gallery Created!','lasso'), |
|
| 64 | - 'galleryUpdated' => __('Gallery Updated!','lasso'), |
|
| 65 | - 'justWrite' => __('Just write...','lasso'), |
|
| 66 | - 'chooseImage' => __('Choose an image','lasso'), |
|
| 67 | - 'updateImage' => __('Update Image','lasso'), |
|
| 68 | - 'insertImage' => __('Insert Image','lasso'), |
|
| 69 | - 'selectImage' => __('Select Image','lasso'), |
|
| 70 | - 'removeFeatImg' => __('Remove featured image?','lasso'), |
|
| 71 | - 'updateSelectedImg' => __('Update Selected Image','lasso'), |
|
| 72 | - 'chooseImages' => __('Choose images','lasso'), |
|
| 73 | - 'editImage' => __('Edit Image','lasso'), |
|
| 74 | - 'addImages' => __('Add Images','lasso'), |
|
| 75 | - 'addNewGallery' => __('Add New Gallery','lasso'), |
|
| 76 | - 'selectGallery' => __('Select Lasso Gallery Image','lasso'), |
|
| 77 | - 'useSelectedImages' => __('Use Selected Images','lasso'), |
|
| 78 | - 'publishPost' => __('Publish Post?','lasso'), |
|
| 79 | - 'publishYes' => __('Yes, publish it!','lasso'), |
|
| 80 | - 'deletePost' => __('Trash Post?','lasso'), |
|
| 81 | - 'deleteYes' => __('Yes, trash it!','lasso'), |
|
| 82 | - 'warning' => __('Oh snap!','laso'), |
|
| 83 | - 'cancelText' => __('O.K. got it!','lasso'), |
|
| 84 | - 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.','lasso'), |
|
| 55 | + 'save' => __('Save', 'lasso'), |
|
| 56 | + 'saving' => __('Saving...', 'lasso'), |
|
| 57 | + 'saved' => __('Saved!', 'lasso'), |
|
| 58 | + 'adding' => __('Adding...', 'lasso'), |
|
| 59 | + 'added' => __('Added!', 'lasso'), |
|
| 60 | + 'loading' => __('Loading...', 'lasso'), |
|
| 61 | + 'loadMore' => __('Load More', 'lasso'), |
|
| 62 | + 'noPostsFound' => __('No more posts found', 'lasso'), |
|
| 63 | + 'galleryCreated' => __('Gallery Created!', 'lasso'), |
|
| 64 | + 'galleryUpdated' => __('Gallery Updated!', 'lasso'), |
|
| 65 | + 'justWrite' => __('Just write...', 'lasso'), |
|
| 66 | + 'chooseImage' => __('Choose an image', 'lasso'), |
|
| 67 | + 'updateImage' => __('Update Image', 'lasso'), |
|
| 68 | + 'insertImage' => __('Insert Image', 'lasso'), |
|
| 69 | + 'selectImage' => __('Select Image', 'lasso'), |
|
| 70 | + 'removeFeatImg' => __('Remove featured image?', 'lasso'), |
|
| 71 | + 'updateSelectedImg' => __('Update Selected Image', 'lasso'), |
|
| 72 | + 'chooseImages' => __('Choose images', 'lasso'), |
|
| 73 | + 'editImage' => __('Edit Image', 'lasso'), |
|
| 74 | + 'addImages' => __('Add Images', 'lasso'), |
|
| 75 | + 'addNewGallery' => __('Add New Gallery', 'lasso'), |
|
| 76 | + 'selectGallery' => __('Select Lasso Gallery Image', 'lasso'), |
|
| 77 | + 'useSelectedImages' => __('Use Selected Images', 'lasso'), |
|
| 78 | + 'publishPost' => __('Publish Post?', 'lasso'), |
|
| 79 | + 'publishYes' => __('Yes, publish it!', 'lasso'), |
|
| 80 | + 'deletePost' => __('Trash Post?', 'lasso'), |
|
| 81 | + 'deleteYes' => __('Yes, trash it!', 'lasso'), |
|
| 82 | + 'warning' => __('Oh snap!', 'laso'), |
|
| 83 | + 'cancelText' => __('O.K. got it!', 'lasso'), |
|
| 84 | + 'missingClass' => __('It looks like we are either missing the Article CSS class, or it is configured incorrectly. Editus will not function correctly without this CSS class.', 'lasso'), |
|
| 85 | 85 | 'missingConfirm' => __('Update Settings', 'lasso'), |
| 86 | - 'helperText' => __('one more letter','lasso'), |
|
| 86 | + 'helperText' => __('one more letter', 'lasso'), |
|
| 87 | 87 | 'editingBackup' => __('You are currently editing a backup copy of this post.') |
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | - $api_url = trailingslashit( home_url() ) . 'lasso-internal-api'; |
|
| 90 | + $api_url = trailingslashit(home_url()).'lasso-internal-api'; |
|
| 91 | 91 | |
| 92 | 92 | $gallery_class = new gallery(); |
| 93 | 93 | $gallery_nonce_action = $gallery_class->nonce_action; |
| 94 | - $gallery_nonce = wp_create_nonce( $gallery_nonce_action ); |
|
| 94 | + $gallery_nonce = wp_create_nonce($gallery_nonce_action); |
|
| 95 | 95 | |
| 96 | 96 | // localized objects |
| 97 | 97 | $objects = array( |
| 98 | - 'ajaxurl' => esc_url( $api_url ), |
|
| 98 | + 'ajaxurl' => esc_url($api_url), |
|
| 99 | 99 | 'editor' => 'lasso--content', // ID of editable content (without #) DONT CHANGE |
| 100 | 100 | 'article_object' => $article_object, |
| 101 | 101 | 'featImgClass' => $featImgClass, |
| 102 | 102 | 'titleClass' => $titleClass, |
| 103 | 103 | 'strings' => $strings, |
| 104 | - 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url( 'settings.php?page=lasso-editor' ) : admin_url( 'admin.php?page=lasso-editor-settings' ), |
|
| 105 | - 'post_status' => get_post_status( $postid ), |
|
| 104 | + 'settingsLink' => function_exists('is_multisite') && is_multisite() ? network_admin_url('settings.php?page=lasso-editor') : admin_url('admin.php?page=lasso-editor-settings'), |
|
| 105 | + 'post_status' => get_post_status($postid), |
|
| 106 | 106 | 'postid' => $postid, |
| 107 | 107 | 'permalink' => get_permalink(), |
| 108 | 108 | 'edit_others_pages' => current_user_can('edit_others_pages') ? 'true' : 'false', |
| 109 | 109 | 'edit_others_posts' => current_user_can('edit_others_posts') ? 'true' : 'false', |
| 110 | - 'userCanEdit' => current_user_can('edit_post', $postid ), |
|
| 110 | + 'userCanEdit' => current_user_can('edit_post', $postid), |
|
| 111 | 111 | 'can_publish_posts' => current_user_can('publish_posts'), |
| 112 | 112 | 'can_publish_pages' => current_user_can('publish_pages'), |
| 113 | 113 | 'author' => is_user_logged_in() ? get_current_user_ID() : false, |
@@ -139,22 +139,22 @@ discard block |
||
| 139 | 139 | 'postTags' => lasso_get_objects('tag'), |
| 140 | 140 | 'noResultsDiv' => lasso_editor_empty_results(), |
| 141 | 141 | 'noRevisionsDiv' => lasso_editor_empty_results('revision'), |
| 142 | - 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider( $postid ) : false, |
|
| 143 | - 'mapLocations' => get_post_meta( $postid, 'ase_map_component_locations' ), |
|
| 144 | - 'mapStart' => get_post_meta( $postid, 'ase_map_component_start_point', true ), |
|
| 145 | - 'mapZoom' => get_post_meta( $postid, 'ase_map_component_zoom', true ), |
|
| 142 | + 'mapTileProvider' => function_exists('aesop_map_tile_provider') ? aesop_map_tile_provider($postid) : false, |
|
| 143 | + 'mapLocations' => get_post_meta($postid, 'ase_map_component_locations'), |
|
| 144 | + 'mapStart' => get_post_meta($postid, 'ase_map_component_start_point', true), |
|
| 145 | + 'mapZoom' => get_post_meta($postid, 'ase_map_component_zoom', true), |
|
| 146 | 146 | 'revisionModal' => lasso_editor_revision_modal() |
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | // wp api client |
| 151 | - wp_enqueue_script( 'wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array( 'jquery', 'underscore', 'backbone' ), LASSO_VERSION, true ); |
|
| 152 | - $settings = array( 'root' => home_url( $home_url ), 'nonce' => wp_create_nonce( 'wp_json' ) ); |
|
| 153 | - wp_localize_script( 'wp-api-js', 'WP_API_Settings', $settings ); |
|
| 151 | + wp_enqueue_script('wp-api-js', LASSO_URL.'/public/assets/js/source/util--wp-api.js', array('jquery', 'underscore', 'backbone'), LASSO_VERSION, true); |
|
| 152 | + $settings = array('root' => home_url($home_url), 'nonce' => wp_create_nonce('wp_json')); |
|
| 153 | + wp_localize_script('wp-api-js', 'WP_API_Settings', $settings); |
|
| 154 | 154 | |
| 155 | - $postfix = ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ) ? '' : '.min'; |
|
| 156 | - wp_enqueue_script('lasso', LASSO_URL. "/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
| 157 | - wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects ) ); |
|
| 155 | + $postfix = (defined('SCRIPT_DEBUG') && true === SCRIPT_DEBUG) ? '' : '.min'; |
|
| 156 | + wp_enqueue_script('lasso', LASSO_URL."/public/assets/js/lasso{$postfix}.js", array('jquery'), LASSO_VERSION, true); |
|
| 157 | + wp_localize_script('lasso', 'lasso_editor', apply_filters('lasso_localized_objects', $objects)); |
|
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | } |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * |
|
| 4 | - * |
|
| 5 | - * @package Editus |
|
| 6 | - * @author Nick Haskins <[email protected]> |
|
| 7 | - * @link http://edituswp.com |
|
| 8 | - * @copyright 2015 Aesopinteractive LLC |
|
| 9 | - * |
|
| 10 | - * Plugin Name: Editus |
|
| 11 | - * Plugin URI: http://edituswp.com |
|
| 12 | - * Description: Front-end editor and story builder. |
|
| 13 | - * Version: 0.9.9.6 |
|
| 14 | - * Author: Aesopinteractive LLC |
|
| 15 | - * Author URI: http://aesopinteractive.com |
|
| 16 | - * Text Domain: lasso |
|
| 17 | - * Domain Path: /languages |
|
| 18 | - */ |
|
| 3 | + * |
|
| 4 | + * |
|
| 5 | + * @package Editus |
|
| 6 | + * @author Nick Haskins <[email protected]> |
|
| 7 | + * @link http://edituswp.com |
|
| 8 | + * @copyright 2015 Aesopinteractive LLC |
|
| 9 | + * |
|
| 10 | + * Plugin Name: Editus |
|
| 11 | + * Plugin URI: http://edituswp.com |
|
| 12 | + * Description: Front-end editor and story builder. |
|
| 13 | + * Version: 0.9.9.6 |
|
| 14 | + * Author: Aesopinteractive LLC |
|
| 15 | + * Author URI: http://aesopinteractive.com |
|
| 16 | + * Text Domain: lasso |
|
| 17 | + * Domain Path: /languages |
|
| 18 | + */ |
|
| 19 | 19 | |
| 20 | 20 | // If this file is called directly, abort. |
| 21 | 21 | if ( ! defined( 'WPINC' ) ) { |
@@ -18,27 +18,27 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | // If this file is called directly, abort. |
| 21 | -if ( ! defined( 'WPINC' ) ) { |
|
| 21 | +if (!defined('WPINC')) { |
|
| 22 | 22 | die; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Set some constants |
| 26 | -define( 'LASSO_VERSION', '0.9.9.6' ); |
|
| 27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
| 28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
| 29 | -define( 'LASSO_FILE', __FILE__ ); |
|
| 26 | +define('LASSO_VERSION', '0.9.9.6'); |
|
| 27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
| 28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
| 29 | +define('LASSO_FILE', __FILE__); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Load plugin if PHP version is 5.4 or later. |
| 33 | 33 | */ |
| 34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
| 34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
| 35 | 35 | |
| 36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
| 36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
| 37 | 37 | |
| 38 | 38 | } else { |
| 39 | 39 | |
| 40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
| 41 | - function lasso_fail_notice(){ |
|
| 41 | + function lasso_fail_notice() { |
|
| 42 | 42 | |
| 43 | 43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
| 44 | 44 | |