@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @since 0.0.1 |
| 95 | 95 | * |
| 96 | - * @return Plugin slug variable. |
|
| 96 | + * @return string slug variable. |
|
| 97 | 97 | */ |
| 98 | 98 | public function get_plugin_slug() { |
| 99 | 99 | return $this->plugin_slug; |
@@ -668,6 +668,9 @@ discard block |
||
| 668 | 668 | return self::$revisions; |
| 669 | 669 | }*/ |
| 670 | 670 | |
| 671 | + /** |
|
| 672 | + * @param string $taxonomy |
|
| 673 | + */ |
|
| 671 | 674 | public function set_post_terms( $postid, $value, $taxonomy ) { |
| 672 | 675 | if( $value ) { |
| 673 | 676 | $value = explode( ',', $value ); |
@@ -52,35 +52,35 @@ discard block |
||
| 52 | 52 | require_once LASSO_DIR.'/public/includes/wrap-shortcodes.php'; |
| 53 | 53 | |
| 54 | 54 | // Activate plugin when new blog is added |
| 55 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
| 55 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
| 56 | 56 | |
| 57 | 57 | // Load plugin text domain |
| 58 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
| 58 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
| 59 | 59 | |
| 60 | - add_action( 'wp_ajax_get_aesop_component', array( $this, 'get_aesop_component' ) ); |
|
| 61 | - add_action( 'wp_ajax_editus_do_shortcode', array( $this, 'editus_do_shortcode' ) ); |
|
| 62 | - add_action( 'wp_ajax_editus_do_block', array( $this, 'editus_do_block' ) ); |
|
| 63 | - add_action( 'wp_ajax_editus_lock_post', array( $this, 'editus_lock_post' ) ); |
|
| 64 | - add_action( 'wp_ajax_editus_unlock_post', array( $this, 'editus_unlock_post' ) ); |
|
| 65 | - add_action( 'wp_ajax_editus_hide_tour', array( $this, 'editus_hide_tour' ) ); |
|
| 66 | - add_action( 'wp_ajax_editus_set_post_setting', array( $this, 'editus_set_post_setting' ) ); |
|
| 67 | - add_action( 'wp_ajax_editus_get_ase_options', array( $this, 'get_ase_options' ) ); |
|
| 68 | - add_action( 'wp_ajax_editus_delete_post', array( $this, 'delete_post' ) ); |
|
| 69 | - add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
|
| 70 | - add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
|
| 60 | + add_action('wp_ajax_get_aesop_component', array($this, 'get_aesop_component')); |
|
| 61 | + add_action('wp_ajax_editus_do_shortcode', array($this, 'editus_do_shortcode')); |
|
| 62 | + add_action('wp_ajax_editus_do_block', array($this, 'editus_do_block')); |
|
| 63 | + add_action('wp_ajax_editus_lock_post', array($this, 'editus_lock_post')); |
|
| 64 | + add_action('wp_ajax_editus_unlock_post', array($this, 'editus_unlock_post')); |
|
| 65 | + add_action('wp_ajax_editus_hide_tour', array($this, 'editus_hide_tour')); |
|
| 66 | + add_action('wp_ajax_editus_set_post_setting', array($this, 'editus_set_post_setting')); |
|
| 67 | + add_action('wp_ajax_editus_get_ase_options', array($this, 'get_ase_options')); |
|
| 68 | + add_action('wp_ajax_editus_delete_post', array($this, 'delete_post')); |
|
| 69 | + add_action('wp_ajax_editus_featured_img', array($this, 'set_featured_img')); |
|
| 70 | + add_action('wp_ajax_editus_del_featured_img', array($this, 'del_featured_img')); |
|
| 71 | 71 | |
| 72 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'on_publish_post' ) ); |
|
| 72 | + add_action('wp_ajax_editus_publish_post', array($this, 'on_publish_post')); |
|
| 73 | 73 | |
| 74 | - add_action( 'wp_ajax_editus_create_gallery', array( $this, 'create_gallery' ) ); |
|
| 75 | - add_action( 'wp_ajax_editus_update_gallery', array( $this, 'update_gallery' ) ); |
|
| 74 | + add_action('wp_ajax_editus_create_gallery', array($this, 'create_gallery')); |
|
| 75 | + add_action('wp_ajax_editus_update_gallery', array($this, 'update_gallery')); |
|
| 76 | 76 | |
| 77 | 77 | // enable saving custom fields through REST API |
| 78 | 78 | self::enable_metasave('post'); |
| 79 | 79 | self::enable_metasave('page'); |
| 80 | 80 | |
| 81 | - $default_post_types = apply_filters( 'lasso_allowed_post_types', array( 'post', 'page')); |
|
| 82 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', $default_post_types); |
|
| 83 | - foreach ( $allowed_post_types as $post_type ) { |
|
| 81 | + $default_post_types = apply_filters('lasso_allowed_post_types', array('post', 'page')); |
|
| 82 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', $default_post_types); |
|
| 83 | + foreach ($allowed_post_types as $post_type) { |
|
| 84 | 84 | self::enable_metasave($post_type); |
| 85 | 85 | } |
| 86 | 86 | //enqueue assets |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | public static function get_instance() { |
| 110 | 110 | |
| 111 | 111 | // If the single instance hasn't been set, set it now. |
| 112 | - if ( null == self::$instance ) { |
|
| 112 | + if (null == self::$instance) { |
|
| 113 | 113 | self::$instance = new self; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | * WPMU is disabled or plugin is |
| 127 | 127 | * activated on an individual blog. |
| 128 | 128 | */ |
| 129 | - public static function activate( $network_wide ) { |
|
| 129 | + public static function activate($network_wide) { |
|
| 130 | 130 | |
| 131 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 131 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 132 | 132 | |
| 133 | - if ( $network_wide ) { |
|
| 133 | + if ($network_wide) { |
|
| 134 | 134 | |
| 135 | 135 | // Get all blog ids |
| 136 | 136 | $blog_ids = self::get_blog_ids(); |
| 137 | 137 | |
| 138 | - foreach ( $blog_ids as $blog_id ) { |
|
| 138 | + foreach ($blog_ids as $blog_id) { |
|
| 139 | 139 | |
| 140 | - switch_to_blog( $blog_id ); |
|
| 140 | + switch_to_blog($blog_id); |
|
| 141 | 141 | self::single_activate(); |
| 142 | 142 | } |
| 143 | 143 | |
@@ -163,18 +163,18 @@ discard block |
||
| 163 | 163 | * WPMU is disabled or plugin is |
| 164 | 164 | * deactivated on an individual blog. |
| 165 | 165 | */ |
| 166 | - public static function deactivate( $network_wide ) { |
|
| 166 | + public static function deactivate($network_wide) { |
|
| 167 | 167 | |
| 168 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 168 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 169 | 169 | |
| 170 | - if ( $network_wide ) { |
|
| 170 | + if ($network_wide) { |
|
| 171 | 171 | |
| 172 | 172 | // Get all blog ids |
| 173 | 173 | $blog_ids = self::get_blog_ids(); |
| 174 | 174 | |
| 175 | - foreach ( $blog_ids as $blog_id ) { |
|
| 175 | + foreach ($blog_ids as $blog_id) { |
|
| 176 | 176 | |
| 177 | - switch_to_blog( $blog_id ); |
|
| 177 | + switch_to_blog($blog_id); |
|
| 178 | 178 | self::single_deactivate(); |
| 179 | 179 | |
| 180 | 180 | } |
@@ -198,13 +198,13 @@ discard block |
||
| 198 | 198 | * |
| 199 | 199 | * @param int $blog_id ID of the new blog. |
| 200 | 200 | */ |
| 201 | - public function activate_new_site( $blog_id ) { |
|
| 201 | + public function activate_new_site($blog_id) { |
|
| 202 | 202 | |
| 203 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
| 203 | + if (1 !== did_action('wpmu_new_blog')) { |
|
| 204 | 204 | return; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - switch_to_blog( $blog_id ); |
|
| 207 | + switch_to_blog($blog_id); |
|
| 208 | 208 | self::single_activate(); |
| 209 | 209 | restore_current_blog(); |
| 210 | 210 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | WHERE archived = '0' AND spam = '0' |
| 230 | 230 | AND deleted = '0'"; |
| 231 | 231 | |
| 232 | - return $wpdb->get_col( $sql ); |
|
| 232 | + return $wpdb->get_col($sql); |
|
| 233 | 233 | |
| 234 | 234 | } |
| 235 | 235 | |
@@ -240,18 +240,18 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | private static function single_activate() { |
| 242 | 242 | |
| 243 | - $curr_version = get_option( 'lasso_version' ); |
|
| 243 | + $curr_version = get_option('lasso_version'); |
|
| 244 | 244 | |
| 245 | 245 | // update upgraded from |
| 246 | - if ( $curr_version ) { |
|
| 247 | - update_option( 'lasso_updated_from', $curr_version ); |
|
| 246 | + if ($curr_version) { |
|
| 247 | + update_option('lasso_updated_from', $curr_version); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // update lasso version option |
| 251 | - update_option( 'lasso_version', LASSO_VERSION ); |
|
| 251 | + update_option('lasso_version', LASSO_VERSION); |
|
| 252 | 252 | |
| 253 | 253 | // set transietn for activation welcome |
| 254 | - set_transient( '_lasso_welcome_redirect', true, 30 ); |
|
| 254 | + set_transient('_lasso_welcome_redirect', true, 30); |
|
| 255 | 255 | |
| 256 | 256 | |
| 257 | 257 | } |
@@ -273,15 +273,15 @@ discard block |
||
| 273 | 273 | public function load_plugin_textdomain() { |
| 274 | 274 | |
| 275 | 275 | $domain = $this->plugin_slug; |
| 276 | - $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); |
|
| 276 | + $locale = apply_filters('plugin_locale', get_locale(), $domain); |
|
| 277 | 277 | |
| 278 | - $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
|
| 278 | + $out = load_textdomain($domain, trailingslashit(LASSO_DIR).'languages/'.$domain.'-'.$locale.'.mo'); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // new ajax function to lock post for editing |
| 282 | 282 | public function editus_lock_post() |
| 283 | 283 | { |
| 284 | - $post_id= $_POST["postid"]; |
|
| 284 | + $post_id = $_POST["postid"]; |
|
| 285 | 285 | $locked = wp_check_post_lock($post_id); |
| 286 | 286 | |
| 287 | 287 | if (!$locked) { |
@@ -289,17 +289,17 @@ discard block |
||
| 289 | 289 | echo "true"; |
| 290 | 290 | } else { |
| 291 | 291 | $user_info = get_userdata($locked); |
| 292 | - echo _e( 'Post being edited by ', 'lasso' ).$user_info->first_name . " " . $user_info->last_name; |
|
| 292 | + echo _e('Post being edited by ', 'lasso').$user_info->first_name." ".$user_info->last_name; |
|
| 293 | 293 | } |
| 294 | 294 | exit; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | public function editus_unlock_post() |
| 298 | 298 | { |
| 299 | - $post_id= $_POST["postid"]; |
|
| 299 | + $post_id = $_POST["postid"]; |
|
| 300 | 300 | $locked = wp_check_post_lock($post_id); |
| 301 | 301 | if (!$locked) { |
| 302 | - delete_post_meta( $post_id, '_edit_lock'); |
|
| 302 | + delete_post_meta($post_id, '_edit_lock'); |
|
| 303 | 303 | } |
| 304 | 304 | echo "true"; |
| 305 | 305 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | { |
| 312 | 312 | $user_id = get_current_user_ID(); |
| 313 | 313 | |
| 314 | - update_user_meta( $user_id, 'lasso_hide_tour', true ); |
|
| 314 | + update_user_meta($user_id, 'lasso_hide_tour', true); |
|
| 315 | 315 | exit; |
| 316 | 316 | } |
| 317 | 317 | |
@@ -322,15 +322,15 @@ discard block |
||
| 322 | 322 | $data = array(); |
| 323 | 323 | parse_str($_POST['data'], $data); |
| 324 | 324 | |
| 325 | - if (!wp_verify_nonce( $data[ 'nonce' ], 'lasso-update-post-settings' )) { |
|
| 325 | + if (!wp_verify_nonce($data['nonce'], 'lasso-update-post-settings')) { |
|
| 326 | 326 | wp_send_json_error(); |
| 327 | 327 | exit; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - $status = isset( $data['status'] ) ? $data['status'] : false; |
|
| 331 | - $postid = isset( $data['postid'] ) ? $data['postid'] : false; |
|
| 332 | - $slug = isset( $data['story_slug'] ) ? $data['story_slug'] : false; |
|
| 333 | - $excerpt = isset( $data['excerpt'] ) ? $data['excerpt'] : false; |
|
| 330 | + $status = isset($data['status']) ? $data['status'] : false; |
|
| 331 | + $postid = isset($data['postid']) ? $data['postid'] : false; |
|
| 332 | + $slug = isset($data['story_slug']) ? $data['story_slug'] : false; |
|
| 333 | + $excerpt = isset($data['excerpt']) ? $data['excerpt'] : false; |
|
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | $args = array( |
@@ -342,24 +342,24 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | |
| 344 | 344 | |
| 345 | - wp_update_post( apply_filters( 'lasso_object_status_update_args', $args ) ); |
|
| 345 | + wp_update_post(apply_filters('lasso_object_status_update_args', $args)); |
|
| 346 | 346 | |
| 347 | 347 | // update categories |
| 348 | - $cats = isset( $data['story_cats'] ) ? $data['story_cats'] : false; |
|
| 348 | + $cats = isset($data['story_cats']) ? $data['story_cats'] : false; |
|
| 349 | 349 | |
| 350 | - self::set_post_terms( $postid, $cats, 'category' ); |
|
| 350 | + self::set_post_terms($postid, $cats, 'category'); |
|
| 351 | 351 | |
| 352 | 352 | // update tags |
| 353 | - $tags = isset( $data['story_tags'] ) ? $data['story_tags'] : false; |
|
| 354 | - self::set_post_terms( $postid, $tags, 'post_tag' ); |
|
| 353 | + $tags = isset($data['story_tags']) ? $data['story_tags'] : false; |
|
| 354 | + self::set_post_terms($postid, $tags, 'post_tag'); |
|
| 355 | 355 | |
| 356 | 356 | //update date |
| 357 | - $date = isset( $data['post_date'] ) ? $data['post_date'] : false; |
|
| 358 | - self::set_date( $postid, $date ); |
|
| 357 | + $date = isset($data['post_date']) ? $data['post_date'] : false; |
|
| 358 | + self::set_date($postid, $date); |
|
| 359 | 359 | |
| 360 | - do_action( 'lasso_post_updated', $postid, $slug, $status, get_current_user_ID() ); |
|
| 361 | - $response= array( |
|
| 362 | - 'link' => get_permalink($postid). (($status=='publish') ? '' : '&preview=true') |
|
| 360 | + do_action('lasso_post_updated', $postid, $slug, $status, get_current_user_ID()); |
|
| 361 | + $response = array( |
|
| 362 | + 'link' => get_permalink($postid).(($status == 'publish') ? '' : '&preview=true') |
|
| 363 | 363 | ); |
| 364 | 364 | wp_send_json_success($response); |
| 365 | 365 | exit; |
@@ -367,11 +367,11 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | public static function enable_metasave($type) |
| 369 | 369 | { |
| 370 | - register_rest_field( $type, 'metadata', array( |
|
| 371 | - 'get_callback' => function ( $data ) { |
|
| 372 | - return get_post_meta( $data['id']);//, '', '' ); |
|
| 370 | + register_rest_field($type, 'metadata', array( |
|
| 371 | + 'get_callback' => function($data) { |
|
| 372 | + return get_post_meta($data['id']); //, '', '' ); |
|
| 373 | 373 | }, |
| 374 | - 'update_callback' => function( $data, $post ) { |
|
| 374 | + 'update_callback' => function($data, $post) { |
|
| 375 | 375 | foreach ($data as $key => $value) { |
| 376 | 376 | update_post_meta($post->ID, $key, $value); |
| 377 | 377 | } |
@@ -383,13 +383,13 @@ discard block |
||
| 383 | 383 | public function editus_do_shortcode() |
| 384 | 384 | { |
| 385 | 385 | |
| 386 | - $code= $_POST["code"]; |
|
| 386 | + $code = $_POST["code"]; |
|
| 387 | 387 | $code = str_replace('\"', '"', $code); |
| 388 | 388 | |
| 389 | - $code_wrapped = lasso_wrap_shortcodes( $code); |
|
| 390 | - $out = do_shortcode($code); |
|
| 389 | + $code_wrapped = lasso_wrap_shortcodes($code); |
|
| 390 | + $out = do_shortcode($code); |
|
| 391 | 391 | if ($out != '') { |
| 392 | - $out = do_shortcode($code_wrapped); |
|
| 392 | + $out = do_shortcode($code_wrapped); |
|
| 393 | 393 | echo $out; |
| 394 | 394 | exit; |
| 395 | 395 | } |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | /** @var \WP_Embed $wp_embed */ |
| 400 | 400 | global $wp_embed; |
| 401 | 401 | $wp_embed->post_ID = $_POST["ID"]; |
| 402 | - $out =$wp_embed->run_shortcode( $code_wrapped ); |
|
| 402 | + $out = $wp_embed->run_shortcode($code_wrapped); |
|
| 403 | 403 | |
| 404 | 404 | echo $out; |
| 405 | 405 | exit; |
@@ -408,9 +408,9 @@ discard block |
||
| 408 | 408 | public function editus_do_block() |
| 409 | 409 | { |
| 410 | 410 | |
| 411 | - $code= $_POST["code"]; |
|
| 411 | + $code = $_POST["code"]; |
|
| 412 | 412 | |
| 413 | - $out = do_blocks( $code ); |
|
| 413 | + $out = do_blocks($code); |
|
| 414 | 414 | |
| 415 | 415 | echo $out; |
| 416 | 416 | exit; |
@@ -420,56 +420,56 @@ discard block |
||
| 420 | 420 | { |
| 421 | 421 | |
| 422 | 422 | |
| 423 | - $code= $_POST["code"]; |
|
| 423 | + $code = $_POST["code"]; |
|
| 424 | 424 | $atts = array( |
| 425 | 425 | ); |
| 426 | 426 | foreach ($_POST as $key => $value) { |
| 427 | - if ($key !="code" && $key !="action") { |
|
| 427 | + if ($key != "code" && $key != "action") { |
|
| 428 | 428 | $atts[$key] = $value; |
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | if ($code == "aesop_video") { |
| 432 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 432 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 433 | 433 | echo aesop_video_shortcode($atts); |
| 434 | 434 | } |
| 435 | 435 | else if ($code == "aesop_image") { |
| 436 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 436 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 437 | 437 | echo aesop_image_shortcode($atts); |
| 438 | 438 | } |
| 439 | 439 | else if ($code == "aesop_quote") { |
| 440 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 440 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 441 | 441 | echo aesop_quote_shortcode($atts); |
| 442 | 442 | } |
| 443 | 443 | else if ($code == "aesop_parallax") { |
| 444 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 444 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 445 | 445 | echo aesop_parallax_shortcode($atts); |
| 446 | 446 | } |
| 447 | 447 | else if ($code == "aesop_character") { |
| 448 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 448 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 449 | 449 | echo aesop_character_shortcode($atts); |
| 450 | 450 | } |
| 451 | 451 | else if ($code == "aesop_collection") { |
| 452 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 452 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 453 | 453 | echo aesop_collection_shortcode($atts); |
| 454 | 454 | } |
| 455 | 455 | else if ($code == "aesop_chapter") { |
| 456 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 456 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 457 | 457 | echo aesop_chapter_shortcode($atts); |
| 458 | 458 | } |
| 459 | 459 | else if ($code == "aesop_content") { |
| 460 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 460 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 461 | 461 | echo aesop_content_shortcode($atts, $atts['content_data']); |
| 462 | 462 | } |
| 463 | 463 | else if ($code == "aesop_gallery") { |
| 464 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 465 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 464 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 465 | + echo do_shortcode('[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 466 | 466 | } |
| 467 | 467 | else if ($code == "aesop_audio") { |
| 468 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 468 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 469 | 469 | echo aesop_audio_shortcode($atts); |
| 470 | 470 | } |
| 471 | 471 | else if ($code == "aesop_document") { |
| 472 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 472 | + require_once(ABSPATH.'/wp-content/plugins/aesop-story-engine/public/includes/components/component-document.php'); |
|
| 473 | 473 | echo aesop_document_shortcode($atts); |
| 474 | 474 | } |
| 475 | 475 | /*else if ($code == "aesop_content") { |
@@ -501,24 +501,24 @@ discard block |
||
| 501 | 501 | $extra = ""; |
| 502 | 502 | |
| 503 | 503 | // try to use srcset and sizes on new WP installs |
| 504 | - if ( function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid( $atts['img'] ) ) { |
|
| 505 | - $srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' ); |
|
| 506 | - $sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' ); |
|
| 504 | + if (function_exists('wp_get_attachment_image_srcset') && $attachment_id = attachment_url_to_postid($atts['img'])) { |
|
| 505 | + $srcset = wp_get_attachment_image_srcset($attachment_id, 'full'); |
|
| 506 | + $sizes = wp_get_attachment_image_sizes($attachment_id, 'full'); |
|
| 507 | 507 | $extra = "srcset='$srcset' sizes='$sizes' "; |
| 508 | 508 | } |
| 509 | - if ($atts['align']=="left") { |
|
| 509 | + if ($atts['align'] == "left") { |
|
| 510 | 510 | $extra .= 'class="alignleft'; |
| 511 | - } else if ($atts['align']=="right") { |
|
| 511 | + } else if ($atts['align'] == "right") { |
|
| 512 | 512 | $extra .= 'class="alignright'; |
| 513 | 513 | } else { |
| 514 | 514 | $extra .= 'class="aligncenter'; |
| 515 | 515 | } |
| 516 | 516 | if ($atts['imgwidth'] || $atts['imgheight']) { |
| 517 | 517 | if ($atts['imgwidth']) { |
| 518 | - $extra .= 'width:'. $atts['imgwidth'].';'; |
|
| 518 | + $extra .= 'width:'.$atts['imgwidth'].';'; |
|
| 519 | 519 | } |
| 520 | 520 | if ($atts['imgheight']) { |
| 521 | - $extra .= 'height:'. $atts['imgheight'].';'; |
|
| 521 | + $extra .= 'height:'.$atts['imgheight'].';'; |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | } |
@@ -530,15 +530,15 @@ discard block |
||
| 530 | 530 | //echo ' class="wp-image- lasso--wpimg__wrap lasso-component">'; |
| 531 | 531 | echo ' class="wp-caption lasso-component">'; |
| 532 | 532 | $hrefset = false; |
| 533 | - if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption']=="url" )) |
|
| 533 | + if ($atts['link'] != '' && (!isset($atts['linkoption']) || $atts['linkoption'] == "url")) |
|
| 534 | 534 | { |
| 535 | - echo '<a href="' . $atts['link'] . '">'; |
|
| 535 | + echo '<a href="'.$atts['link'].'">'; |
|
| 536 | 536 | $hrefset = true; |
| 537 | - } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img' ) { |
|
| 538 | - echo '<a href="' . $atts['img'] . '">'; |
|
| 537 | + } else if (isset($atts['linkoption']) && $atts['linkoption'] == 'img') { |
|
| 538 | + echo '<a href="'.$atts['img'].'">'; |
|
| 539 | 539 | $hrefset = true; |
| 540 | 540 | } |
| 541 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '" '. $extra. '>'; |
|
| 541 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'" '.$extra.'>'; |
|
| 542 | 542 | if ($hrefset) |
| 543 | 543 | { |
| 544 | 544 | echo '</a>'; |
@@ -558,16 +558,16 @@ discard block |
||
| 558 | 558 | $imgextra = 'class="wp-image-'.$atts['id'].'"'; |
| 559 | 559 | } |
| 560 | 560 | $figclass = 'aligncenter'; |
| 561 | - if ($atts['align']=="left") { |
|
| 561 | + if ($atts['align'] == "left") { |
|
| 562 | 562 | $figclass = 'alignleft'; |
| 563 | - } else if ($atts['align']=="right") { |
|
| 563 | + } else if ($atts['align'] == "right") { |
|
| 564 | 564 | $figclass = 'alignright'; |
| 565 | 565 | } else { |
| 566 | 566 | $figclass = 'aligncenter'; |
| 567 | 567 | } |
| 568 | 568 | echo '<div class="wp-block-image" data-component-type="wpimg-block">'; |
| 569 | 569 | echo '<figure class="'.$figclass.' size-large">'; |
| 570 | - echo '<img src="' . $atts['img'] . '" alt="'. $atts['alt'] . '"' . $imgextra . ' >'; |
|
| 570 | + echo '<img src="'.$atts['img'].'" alt="'.$atts['alt'].'"'.$imgextra.' >'; |
|
| 571 | 571 | if ($atts['caption']) |
| 572 | 572 | { |
| 573 | 573 | echo '<figcaption>'.$atts['caption'].'</figcaption>'; |
@@ -581,20 +581,20 @@ discard block |
||
| 581 | 581 | public function get_ase_options() |
| 582 | 582 | { |
| 583 | 583 | $blob = lasso_editor_options_blob(); |
| 584 | - $code= $_POST["component"]; |
|
| 584 | + $code = $_POST["component"]; |
|
| 585 | 585 | echo $blob[$code]; |
| 586 | 586 | exit; |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | public function delete_post( ) { |
| 590 | 590 | |
| 591 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
| 591 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
| 592 | 592 | |
| 593 | 593 | // bail out if the current user can't publish posts |
| 594 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
| 594 | + if (!lasso_user_can('delete_post', $postid)) |
|
| 595 | 595 | return; |
| 596 | 596 | |
| 597 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
|
| 597 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_delete_post')) { |
|
| 598 | 598 | wp_send_json_error(); |
| 599 | 599 | exit; |
| 600 | 600 | } |
@@ -604,9 +604,9 @@ discard block |
||
| 604 | 604 | 'post_status' => 'trash' |
| 605 | 605 | ); |
| 606 | 606 | |
| 607 | - wp_update_post( apply_filters( 'lasso_object_deleted_args', $args ) ); |
|
| 607 | + wp_update_post(apply_filters('lasso_object_deleted_args', $args)); |
|
| 608 | 608 | |
| 609 | - do_action( 'lasso_object_deleted', $postid, get_current_user_ID() ); |
|
| 609 | + do_action('lasso_object_deleted', $postid, get_current_user_ID()); |
|
| 610 | 610 | |
| 611 | 611 | exit; |
| 612 | 612 | } |
@@ -614,40 +614,40 @@ discard block |
||
| 614 | 614 | /* This function doesn't actually publish post, but should be called when a post is published */ |
| 615 | 615 | public function on_publish_post( ) { |
| 616 | 616 | |
| 617 | - $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
| 617 | + $post_id = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
| 618 | 618 | |
| 619 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 619 | + do_action('transition_post_status', 'publish', 'draft', get_post($post_id)); |
|
| 620 | 620 | |
| 621 | 621 | exit; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | public function set_featured_img( ) { |
| 625 | 625 | |
| 626 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
| 627 | - $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : false; |
|
| 628 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
| 626 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
| 627 | + $image_id = isset($_POST['image_id']) ? absint($_POST['image_id']) : false; |
|
| 628 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
| 629 | 629 | wp_send_json_error(); |
| 630 | 630 | exit; |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | - set_post_thumbnail( $postid, $image_id ); |
|
| 633 | + set_post_thumbnail($postid, $image_id); |
|
| 634 | 634 | |
| 635 | - do_action( 'lasso_featured_image_set', $postid, $image_id, get_current_user_ID() ); |
|
| 635 | + do_action('lasso_featured_image_set', $postid, $image_id, get_current_user_ID()); |
|
| 636 | 636 | |
| 637 | 637 | exit; |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | public function del_featured_img( ) { |
| 641 | 641 | |
| 642 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
| 643 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
| 642 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
| 643 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
| 644 | 644 | wp_send_json_error(); |
| 645 | 645 | exit; |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | - delete_post_thumbnail( $postid ); |
|
| 648 | + delete_post_thumbnail($postid); |
|
| 649 | 649 | |
| 650 | - do_action( 'lasso_featured_image_deleted', $postid, get_current_user_ID() ); |
|
| 650 | + do_action('lasso_featured_image_deleted', $postid, get_current_user_ID()); |
|
| 651 | 651 | |
| 652 | 652 | exit; |
| 653 | 653 | } |
@@ -668,17 +668,17 @@ discard block |
||
| 668 | 668 | return self::$revisions; |
| 669 | 669 | }*/ |
| 670 | 670 | |
| 671 | - public function set_post_terms( $postid, $value, $taxonomy ) { |
|
| 672 | - if( $value ) { |
|
| 673 | - $value = explode( ',', $value ); |
|
| 674 | - $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
|
| 671 | + public function set_post_terms($postid, $value, $taxonomy) { |
|
| 672 | + if ($value) { |
|
| 673 | + $value = explode(',', $value); |
|
| 674 | + $allow_new_category = lasso_editor_get_option('allow_new_category', 'lasso_editor'); |
|
| 675 | 675 | |
| 676 | - if ($taxonomy =='category') { |
|
| 676 | + if ($taxonomy == 'category') { |
|
| 677 | 677 | // convert from names to category ids |
| 678 | 678 | $cats = array(); |
| 679 | 679 | foreach ($value as $cat) { |
| 680 | 680 | $cat_id = get_cat_ID($cat); |
| 681 | - if ($cat_id !=0) { |
|
| 681 | + if ($cat_id != 0) { |
|
| 682 | 682 | $cats [] = $cat_id; |
| 683 | 683 | } else if ($allow_new_category) { |
| 684 | 684 | $cats [] = wp_create_category($cat); |
@@ -687,71 +687,71 @@ discard block |
||
| 687 | 687 | $value = $cats; |
| 688 | 688 | } |
| 689 | 689 | |
| 690 | - $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
|
| 690 | + $result = wp_set_object_terms($postid, $value, $taxonomy); |
|
| 691 | 691 | } |
| 692 | - else { |
|
| 692 | + else { |
|
| 693 | 693 | //remove all terms from post |
| 694 | - $result = wp_set_object_terms( $postid, null, $taxonomy ); |
|
| 694 | + $result = wp_set_object_terms($postid, null, $taxonomy); |
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | - if ( ! is_wp_error( $result ) ) { |
|
| 697 | + if (!is_wp_error($result)) { |
|
| 698 | 698 | return true; |
| 699 | - }else{ |
|
| 699 | + } else { |
|
| 700 | 700 | return false; |
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | public function create_gallery( ) { |
| 705 | 705 | |
| 706 | - $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
|
| 706 | + $postid = isset($_POST['postid']) ? $_POST['postid'] : false; |
|
| 707 | 707 | |
| 708 | - if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_gallery' )) { |
|
| 708 | + if (!wp_verify_nonce($_POST['nonce'], 'lasso_gallery')) { |
|
| 709 | 709 | wp_send_json_error(); |
| 710 | 710 | exit; |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | - if ( ! lasso_user_can( 'publish_posts' ) ) { |
|
| 713 | + if (!lasso_user_can('publish_posts')) { |
|
| 714 | 714 | return false; |
| 715 | 715 | |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
| 718 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
| 719 | 719 | |
| 720 | 720 | // bail if no gallery ids |
| 721 | - if ( empty( $gallery_ids ) ) { |
|
| 721 | + if (empty($gallery_ids)) { |
|
| 722 | 722 | return false; |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | - $type = isset( $_POST['gallery_type'] ) ? $_POST['gallery_type'] : false; |
|
| 726 | - $edgallerytitle = isset( $_POST['edgallerytitle'] ) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
| 725 | + $type = isset($_POST['gallery_type']) ? $_POST['gallery_type'] : false; |
|
| 726 | + $edgallerytitle = isset($_POST['edgallerytitle']) ? $_POST['edgallerytitle'] : $postid.'-'.rand(); |
|
| 727 | 727 | |
| 728 | 728 | // insert a new gallery |
| 729 | 729 | $args = array( |
| 730 | - 'post_title' => $edgallerytitle , |
|
| 730 | + 'post_title' => $edgallerytitle, |
|
| 731 | 731 | 'post_status' => 'publish', |
| 732 | 732 | 'post_type' => 'ai_galleries' |
| 733 | 733 | ); |
| 734 | 734 | |
| 735 | - $postid = wp_insert_post( apply_filters( 'lasso_insert_gallery_args', $args ) ); |
|
| 735 | + $postid = wp_insert_post(apply_filters('lasso_insert_gallery_args', $args)); |
|
| 736 | 736 | |
| 737 | 737 | // update gallery ids |
| 738 | - if ( $gallery_ids ) { |
|
| 738 | + if ($gallery_ids) { |
|
| 739 | 739 | |
| 740 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
| 740 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
| 741 | 741 | |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | // update the gallery type |
| 745 | - if ( !empty( $type ) ) { |
|
| 745 | + if (!empty($type)) { |
|
| 746 | 746 | |
| 747 | - update_post_meta( $postid, 'aesop_gallery_type', $type ); |
|
| 747 | + update_post_meta($postid, 'aesop_gallery_type', $type); |
|
| 748 | 748 | |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | - do_action( 'lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID() ); |
|
| 751 | + do_action('lasso_gallery_published', $postid, $gallery_ids, get_current_user_ID()); |
|
| 752 | 752 | |
| 753 | 753 | |
| 754 | - echo json_encode( array( |
|
| 754 | + echo json_encode(array( |
|
| 755 | 755 | 'message' => 'gallery-created', |
| 756 | 756 | 'id' => $postid) |
| 757 | 757 | ); |
@@ -760,114 +760,114 @@ discard block |
||
| 760 | 760 | |
| 761 | 761 | public function update_gallery( ) { |
| 762 | 762 | |
| 763 | - $options = isset( $_POST['fields'] ) ? $_POST['fields'] : false; |
|
| 763 | + $options = isset($_POST['fields']) ? $_POST['fields'] : false; |
|
| 764 | 764 | |
| 765 | - $postid = !empty( $options ) ? (int) $options['id'] : false; |
|
| 766 | - $gallery_ids = isset( $_POST['gallery_ids'] ) ? $_POST['gallery_ids'] : false; |
|
| 767 | - if ( $_POST[ 'gallery_type' ] ) { |
|
| 768 | - $type = $_POST[ 'gallery_type' ]; |
|
| 769 | - }elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) { |
|
| 770 | - $type = $options[ 'galleryType' ]; |
|
| 771 | - }else{ |
|
| 765 | + $postid = !empty($options) ? (int) $options['id'] : false; |
|
| 766 | + $gallery_ids = isset($_POST['gallery_ids']) ? $_POST['gallery_ids'] : false; |
|
| 767 | + if ($_POST['gallery_type']) { |
|
| 768 | + $type = $_POST['gallery_type']; |
|
| 769 | + }elseif (!empty($options) && $options['galleryType']) { |
|
| 770 | + $type = $options['galleryType']; |
|
| 771 | + } else { |
|
| 772 | 772 | $type = false; |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | - self::save_gallery_options( $postid, $gallery_ids, $options, $type ); |
|
| 775 | + self::save_gallery_options($postid, $gallery_ids, $options, $type); |
|
| 776 | 776 | |
| 777 | - echo json_encode( array('message' => 'gallery-updated') ); |
|
| 777 | + echo json_encode(array('message' => 'gallery-updated')); |
|
| 778 | 778 | |
| 779 | 779 | exit; |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | - public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 782 | + public function save_gallery_options($postid, $gallery_ids, $options, $type = false) { |
|
| 783 | 783 | |
| 784 | 784 | // gallery width |
| 785 | - $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
| 785 | + $gallery_width = isset($options['width']) ? $options['width'] : false; |
|
| 786 | 786 | |
| 787 | 787 | // gallery grid item width |
| 788 | - $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
| 788 | + $item_width = isset($options['itemwidth']) ? $options['itemwidth'] : false; |
|
| 789 | 789 | |
| 790 | 790 | // caption |
| 791 | - $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
| 791 | + $caption = isset($options['caption']) ? $options['caption'] : false; |
|
| 792 | 792 | |
| 793 | 793 | // gallery transition |
| 794 | - $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
| 794 | + $transition = isset($options['transition']) ? $options['transition'] : false; |
|
| 795 | 795 | |
| 796 | 796 | // gallery transition speed |
| 797 | - $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
| 797 | + $transitionSpeed = isset($options['speed']) ? $options['speed'] : false; |
|
| 798 | 798 | |
| 799 | 799 | // gallery hide thumbs |
| 800 | - $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
| 800 | + $hideThumbs = isset($options['hideThumbs']) ? $options['hideThumbs'] : false; |
|
| 801 | 801 | |
| 802 | 802 | // photoset layout hardwired to on for now |
| 803 | - $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
| 803 | + $psLayout = isset($options['pslayout']) ? $options['pslayout'] : false; |
|
| 804 | 804 | |
| 805 | 805 | // photoset layout |
| 806 | - $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
| 806 | + $psLightbox = 'on'; //isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
| 807 | 807 | |
| 808 | 808 | // hero gallery height |
| 809 | - $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
| 809 | + $gallery_height = isset($options['height']) ? $options['height'] : false; |
|
| 810 | 810 | |
| 811 | 811 | // update gallery ids |
| 812 | - if ( !empty( $gallery_ids ) ) { |
|
| 812 | + if (!empty($gallery_ids)) { |
|
| 813 | 813 | |
| 814 | - update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
| 814 | + update_post_meta($postid, '_ase_gallery_images', $gallery_ids); |
|
| 815 | 815 | |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
| 818 | + update_post_meta($postid, 'aesop_gallery_type', sanitize_text_field(trim($type))); |
|
| 819 | 819 | |
| 820 | - update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
| 820 | + update_post_meta($postid, 'aesop_gallery_width', sanitize_text_field(trim($gallery_width))); |
|
| 821 | 821 | |
| 822 | - update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
| 822 | + update_post_meta($postid, 'aesop_grid_gallery_width', sanitize_text_field(trim($item_width))); |
|
| 823 | 823 | |
| 824 | - update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
| 824 | + update_post_meta($postid, 'aesop_gallery_caption', sanitize_text_field(trim($caption))); |
|
| 825 | 825 | |
| 826 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
| 826 | + update_post_meta($postid, 'aesop_thumb_gallery_transition', sanitize_text_field(trim($transition))); |
|
| 827 | 827 | |
| 828 | - update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
| 828 | + update_post_meta($postid, 'aesop_thumb_gallery_transition_speed', absint(trim($transitionSpeed))); |
|
| 829 | 829 | |
| 830 | - update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
| 830 | + update_post_meta($postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field(trim($hideThumbs))); |
|
| 831 | 831 | |
| 832 | - update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
| 832 | + update_post_meta($postid, 'aesop_photoset_gallery_layout', sanitize_text_field(trim($psLayout))); |
|
| 833 | 833 | |
| 834 | - update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
| 834 | + update_post_meta($postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field(trim($psLightbox))); |
|
| 835 | 835 | |
| 836 | - update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
| 836 | + update_post_meta($postid, 'aesop_hero_gallery_height', sanitize_text_field(trim($gallery_height))); |
|
| 837 | 837 | |
| 838 | 838 | //hardwired for now |
| 839 | 839 | |
| 840 | - update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
| 840 | + update_post_meta($postid, 'aesop_hero_gallery_transition_speed', 300); |
|
| 841 | 841 | |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | - function getEnglishMonthName($foreignMonthName){ |
|
| 844 | + function getEnglishMonthName($foreignMonthName) { |
|
| 845 | 845 | |
| 846 | 846 | setlocale(LC_ALL, 'en_US'); |
| 847 | 847 | |
| 848 | - $month_numbers = range(1,12); |
|
| 848 | + $month_numbers = range(1, 12); |
|
| 849 | 849 | |
| 850 | - foreach($month_numbers as $month) |
|
| 851 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
| 850 | + foreach ($month_numbers as $month) |
|
| 851 | + $english_months[] = strftime('%B', mktime(0, 0, 0, $month, 1, 2011)); |
|
| 852 | 852 | |
| 853 | 853 | setlocale(LC_ALL, get_locale()); |
| 854 | 854 | |
| 855 | - foreach($month_numbers as $month) |
|
| 856 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
| 855 | + foreach ($month_numbers as $month) |
|
| 856 | + $foreign_months[] = utf8_encode(strftime('%B', mktime(0, 0, 0, $month, 1, 2011))); |
|
| 857 | 857 | |
| 858 | 858 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | |
| 862 | 862 | |
| 863 | - public function set_date( $postid, $value) { |
|
| 864 | - if( $value ) { |
|
| 865 | - $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
|
| 863 | + public function set_date($postid, $value) { |
|
| 864 | + if ($value) { |
|
| 865 | + $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time('timestamp', 1)); |
|
| 866 | 866 | wp_update_post( |
| 867 | - array ( |
|
| 867 | + array( |
|
| 868 | 868 | 'ID' => $postid, // ID of the post to update |
| 869 | - 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
|
| 870 | - 'post_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime($value) ), |
|
| 869 | + 'post_date' => date('Y-m-d H:i:s', strtotime($value)), |
|
| 870 | + 'post_date_gmt' => gmdate('Y-m-d H:i:s', strtotime($value)), |
|
| 871 | 871 | ) |
| 872 | 872 | ); |
| 873 | 873 | } |
@@ -11,39 +11,39 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @since 1.0 |
| 13 | 13 | */ |
| 14 | -add_action( 'wp_footer', 'lasso_editor_controls' ); |
|
| 14 | +add_action('wp_footer', 'lasso_editor_controls'); |
|
| 15 | 15 | function lasso_editor_controls() { |
| 16 | 16 | |
| 17 | 17 | global $post; |
| 18 | 18 | |
| 19 | - if ( lasso_user_can('edit_posts') ) { |
|
| 19 | + if (lasso_user_can('edit_posts')) { |
|
| 20 | 20 | |
| 21 | - $status = get_post_status( get_the_ID() ); |
|
| 22 | - $use_old_ui = lasso_editor_get_option( 'use_old_ui', 'lasso_editor' ); |
|
| 23 | - $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor','#0000ff'); |
|
| 24 | - $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor','#000000'); |
|
| 25 | - $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor','#000055'); |
|
| 26 | - $text_color = lasso_editor_get_option('text-color', 'lasso_editor','#ffffff'); |
|
| 21 | + $status = get_post_status(get_the_ID()); |
|
| 22 | + $use_old_ui = lasso_editor_get_option('use_old_ui', 'lasso_editor'); |
|
| 23 | + $button_color1 = lasso_editor_get_option('button-color1', 'lasso_editor', '#0000ff'); |
|
| 24 | + $button_color2 = lasso_editor_get_option('button-color2', 'lasso_editor', '#000000'); |
|
| 25 | + $dialog_color = lasso_editor_get_option('dialog-color', 'lasso_editor', '#000055'); |
|
| 26 | + $text_color = lasso_editor_get_option('text-color', 'lasso_editor', '#ffffff'); |
|
| 27 | 27 | $hover_color1 = lasso_editor_adjustBrightness($button_color1, 50); |
| 28 | 28 | $hover_color2 = lasso_editor_adjustBrightness($button_color2, 50); |
| 29 | 29 | |
| 30 | 30 | // let users add custom css classes |
| 31 | - $custom_classes = apply_filters( 'lasso_control_classes', '' ); |
|
| 31 | + $custom_classes = apply_filters('lasso_control_classes', ''); |
|
| 32 | 32 | |
| 33 | 33 | $post_access_class = ''; |
| 34 | - $post_new_disabled = lasso_editor_get_option( 'post_adding_disabled', 'lasso_editor' ); |
|
| 35 | - $post_settings_disabled = lasso_editor_get_option( 'post_settings_disabled', 'lasso_editor' ); |
|
| 36 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
| 34 | + $post_new_disabled = lasso_editor_get_option('post_adding_disabled', 'lasso_editor'); |
|
| 35 | + $post_settings_disabled = lasso_editor_get_option('post_settings_disabled', 'lasso_editor'); |
|
| 36 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | // CSS class if adding new post objects is disabled |
| 40 | - if ( 'on' == $post_new_disabled ) { $post_access_class = 'lasso--post-new-disabled'; } |
|
| 40 | + if ('on' == $post_new_disabled) { $post_access_class = 'lasso--post-new-disabled'; } |
|
| 41 | 41 | |
| 42 | 42 | // CSS class if adjust settings is disabled |
| 43 | - if ( 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
| 43 | + if ('on' == $post_settings_disabled) { $post_access_class = 'lasso--post-settings-disabled'; } |
|
| 44 | 44 | |
| 45 | 45 | // CSS class if adding new post objects AND settings are disabled |
| 46 | - if ( 'on' == $post_new_disabled && 'on' == $post_settings_disabled ) { $post_access_class = 'lasso--post-all-disabled'; } |
|
| 46 | + if ('on' == $post_new_disabled && 'on' == $post_settings_disabled) { $post_access_class = 'lasso--post-all-disabled'; } |
|
| 47 | 47 | |
| 48 | 48 | // CSS class if shortcodify or (Aesop Shortcode Conversion) is disabled |
| 49 | 49 | $sc_saving_class = 'on' == $shortcodify_disabled ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ?> |
| 58 | 58 | <style> |
| 59 | 59 | #lasso-html--table:before { |
| 60 | - content: "<?php esc_attr_e( 'Table', 'lasso' );?>"; |
|
| 60 | + content: "<?php esc_attr_e('Table', 'lasso'); ?>"; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -67,32 +67,32 @@ discard block |
||
| 67 | 67 | ?> |
| 68 | 68 | |
| 69 | 69 | .lasso-editor-controls--wrap, #lasso--post-settings2,#lasso--save,#lasso--post-delete,#lasso--exit,#lasso--publish { |
| 70 | - background-image: -webkit-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
| 71 | - background-image: -o-linear-gradient(top,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
| 72 | - background-image: linear-gradient(to bottom,<?php echo $button_color1;?> 0,<?php echo $button_color2;?> 100%); |
|
| 73 | - color: <?php echo $text_color;?>; |
|
| 70 | + background-image: -webkit-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
| 71 | + background-image: -o-linear-gradient(top,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
| 72 | + background-image: linear-gradient(to bottom,<?php echo $button_color1; ?> 0,<?php echo $button_color2; ?> 100%); |
|
| 73 | + color: <?php echo $text_color; ?>; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | .lasso--controls__right a:before, #lasso-toolbar--html__footer_desc, ul.lasso-editor-controls li:before,#lasso-side-comp-button.toolbar--side li:before |
| 77 | 77 | { |
| 78 | - color: <?php echo $text_color;?> !important; |
|
| 78 | + color: <?php echo $text_color; ?> !important; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | ul.lasso-editor-controls li:hover, #lasso--exit:hover,#lasso--post-settings2:hover,#lasso--post-delete:hover,#lasso--publish:hover,#lasso--save:hover { |
| 84 | - background-image: -webkit-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
| 85 | - background-image: -o-linear-gradient(top,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
| 86 | - background-image: linear-gradient(to bottom,<?php echo $hover_color1;?> 0,<?php echo $hover_color2;?> 100%); |
|
| 84 | + background-image: -webkit-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
| 85 | + background-image: -o-linear-gradient(top,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
| 86 | + background-image: linear-gradient(to bottom,<?php echo $hover_color1; ?> 0,<?php echo $hover_color2; ?> 100%); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | .lasso--modal__inner,.sweet-alert,#lasso-toolbar--components.toolbar--drop-up ul,#lasso-toolbar--components__list,#lasso-toolbar--html.html--drop-up #lasso-toolbar--html__wrap, |
| 90 | 90 | #lasso-toolbar--link.link--drop-up #lasso-toolbar--link__wrap { |
| 91 | - background: <?php echo $dialog_color;?>; |
|
| 92 | - color: <?php echo $text_color;?>; |
|
| 91 | + background: <?php echo $dialog_color; ?>; |
|
| 92 | + color: <?php echo $text_color; ?>; |
|
| 93 | 93 | } |
| 94 | 94 | .sweet-alert p,.lasso--modal__inner label,.lasso--toolbar__inner label { |
| 95 | - color: <?php echo $text_color;?> !important; |
|
| 95 | + color: <?php echo $text_color; ?> !important; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | <?php if (!$is_mobile) { ?> |
@@ -126,48 +126,48 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | ?> |
| 128 | 128 | </style> |
| 129 | - <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class( $status );?> <?php echo sanitize_html_class( $custom_classes );?>" data-post-id="<?php echo get_the_ID();?>" > |
|
| 129 | + <div id="lasso--controls" class="lasso-post-status--<?php echo sanitize_html_class($status); ?> <?php echo sanitize_html_class($custom_classes); ?>" data-post-id="<?php echo get_the_ID(); ?>" > |
|
| 130 | 130 | |
| 131 | - <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class;?> " <?php echo $mobile_style ?> > |
|
| 131 | + <ul class="lasso--controls__center lasso-editor-controls lasso-editor-controls--wrap <?php echo $post_access_class; ?> " <?php echo $mobile_style ?> > |
|
| 132 | 132 | |
| 133 | - <?php do_action( 'lasso_editor_controls_before' ); |
|
| 133 | + <?php do_action('lasso_editor_controls_before'); |
|
| 134 | 134 | |
| 135 | - if ( $is_capable ) { ?> |
|
| 135 | + if ($is_capable) { ?> |
|
| 136 | 136 | |
| 137 | - <li id="lasso--edit" title="<?php esc_attr_e( 'Edit Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 137 | + <li id="lasso--edit" title="<?php esc_attr_e('Edit Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 138 | 138 | |
| 139 | - <?php if ( 'off' == $post_settings_disabled || empty( $post_settings_disabled ) ) { ?> |
|
| 140 | - <li id="lasso--post-settings" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 139 | + <?php if ('off' == $post_settings_disabled || empty($post_settings_disabled)) { ?> |
|
| 140 | + <li id="lasso--post-settings" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 141 | 141 | <?php } |
| 142 | 142 | |
| 143 | 143 | } ?> |
| 144 | 144 | |
| 145 | - <li id="lasso--post-all" title="<?php esc_attr_e( 'All Posts', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 145 | + <li id="lasso--post-all" title="<?php esc_attr_e('All Posts', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 146 | 146 | |
| 147 | - <?php if ( $is_capable && wp_revisions_enabled( $post ) ) { ?> |
|
| 148 | - <li id="lasso--post-revisions" title="<?php esc_attr_e( 'Revisions', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 147 | + <?php if ($is_capable && wp_revisions_enabled($post)) { ?> |
|
| 148 | + <li id="lasso--post-revisions" title="<?php esc_attr_e('Revisions', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 149 | 149 | <?php } ?> |
| 150 | 150 | |
| 151 | - <?php if ( ( 'off' == $post_new_disabled || empty( $post_new_disabled ) && lasso_user_can('edit_posts') ) ) { ?> |
|
| 152 | - <li id="lasso--post-new" title="<?php esc_attr_e( 'Add Post', 'lasso' );?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 151 | + <?php if (('off' == $post_new_disabled || empty($post_new_disabled) && lasso_user_can('edit_posts'))) { ?> |
|
| 152 | + <li id="lasso--post-new" title="<?php esc_attr_e('Add Post', 'lasso'); ?>"><a href="#" class="lasso--button__primary"></a></li> |
|
| 153 | 153 | <?php } ?> |
| 154 | 154 | |
| 155 | - <?php do_action( 'lasso_editor_controls_after' );?> |
|
| 155 | + <?php do_action('lasso_editor_controls_after'); ?> |
|
| 156 | 156 | |
| 157 | 157 | </ul> |
| 158 | 158 | |
| 159 | - <?php if ( is_singular() && !$is_mobile ) { ?> |
|
| 159 | + <?php if (is_singular() && !$is_mobile) { ?> |
|
| 160 | 160 | |
| 161 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>"> |
|
| 161 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>"> |
|
| 162 | 162 | |
| 163 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 164 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 163 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 164 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 165 | 165 | |
| 166 | 166 | |
| 167 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 167 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 168 | 168 | |
| 169 | - <?php if ( ('draft' == $status ) || ('pending' == $status && $can_publish) ) { ?> |
|
| 170 | - <a href="#" title="<?php $can_publish ? esc_attr_e( 'Publish Post', 'lasso' ) : esc_attr_e( 'Submit For Review', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 169 | + <?php if (('draft' == $status) || ('pending' == $status && $can_publish)) { ?> |
|
| 170 | + <a href="#" title="<?php $can_publish ? esc_attr_e('Publish Post', 'lasso') : esc_attr_e('Submit For Review', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 171 | 171 | <?php } ?> |
| 172 | 172 | |
| 173 | 173 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | </div> |
| 179 | 179 | |
| 180 | 180 | |
| 181 | - <?php do_action( 'lasso_editor_controls_after_outside' );?> |
|
| 181 | + <?php do_action('lasso_editor_controls_after_outside'); ?> |
|
| 182 | 182 | |
| 183 | 183 | <?php } |
| 184 | 184 | } |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | // let users add custom css classes |
| 199 | - $custom_classes = apply_filters( 'lasso_sidebar_classes', '' ); |
|
| 199 | + $custom_classes = apply_filters('lasso_sidebar_classes', ''); |
|
| 200 | 200 | ?> |
| 201 | - <div id="lasso--sidebar" class="<?php echo sanitize_html_class( $custom_classes );?>" > |
|
| 201 | + <div id="lasso--sidebar" class="<?php echo sanitize_html_class($custom_classes); ?>" > |
|
| 202 | 202 | <div class="lasso--sidebar__inner"> |
| 203 | 203 | <div id="aesop-generator-settings"><div id="lasso--component__settings"></div></div> |
| 204 | 204 | </div> |
@@ -220,21 +220,21 @@ discard block |
||
| 220 | 220 | $is_mobile = wp_is_mobile(); |
| 221 | 221 | |
| 222 | 222 | // check for lasso story engine and add a class doniting this |
| 223 | - $ase_status = class_exists( 'Aesop_Core' ) || defined( 'LASSO_CUSTOM' ) ? 'ase-active' : 'ase-not-active'; |
|
| 223 | + $ase_status = class_exists('Aesop_Core') || defined('LASSO_CUSTOM') ? 'ase-active' : 'ase-not-active'; |
|
| 224 | 224 | |
| 225 | 225 | // let users add custom css classes |
| 226 | - $custom_classes = apply_filters( 'lasso_toolbar_classes', '' ); |
|
| 226 | + $custom_classes = apply_filters('lasso_toolbar_classes', ''); |
|
| 227 | 227 | |
| 228 | 228 | // are toolbar headings enabled |
| 229 | - $toolbar_headings = lasso_editor_get_option( 'toolbar_headings', 'lasso_editor' ); |
|
| 230 | - $toolbar_headings_h4 = lasso_editor_get_option( 'toolbar_headings_h4', 'lasso_editor' ); |
|
| 231 | - $toolbar_list = lasso_editor_get_option( 'toolbar_list', 'lasso_editor' ); |
|
| 229 | + $toolbar_headings = lasso_editor_get_option('toolbar_headings', 'lasso_editor'); |
|
| 230 | + $toolbar_headings_h4 = lasso_editor_get_option('toolbar_headings_h4', 'lasso_editor'); |
|
| 231 | + $toolbar_list = lasso_editor_get_option('toolbar_list', 'lasso_editor'); |
|
| 232 | 232 | |
| 233 | - $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
| 233 | + $toolbar_class = $toolbar_headings ? 'toolbar-extended' : false; |
|
| 234 | 234 | |
| 235 | 235 | // mobile styles |
| 236 | 236 | $mobile_class = $is_mobile ? 'lasso-mobile' : false; |
| 237 | - $mobile_style =$is_mobile ? 'style="bottom:0px;"' : null; |
|
| 237 | + $mobile_style = $is_mobile ? 'style="bottom:0px;"' : null; |
|
| 238 | 238 | |
| 239 | 239 | //show color |
| 240 | 240 | $show_color = lasso_editor_get_option('toolbar_show_color', 'lasso_editor'); |
@@ -242,131 +242,131 @@ discard block |
||
| 242 | 242 | //show alignment |
| 243 | 243 | $show_align = lasso_editor_get_option('toolbar_show_alignment', 'lasso_editor'); |
| 244 | 244 | |
| 245 | - $status = get_post_status( get_the_ID() ); |
|
| 245 | + $status = get_post_status(get_the_ID()); |
|
| 246 | 246 | |
| 247 | - $shortcodify_disabled = lasso_editor_get_option( 'shortcodify_disabled', 'lasso_editor' ); |
|
| 247 | + $shortcodify_disabled = lasso_editor_get_option('shortcodify_disabled', 'lasso_editor'); |
|
| 248 | 248 | |
| 249 | - $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
| 249 | + $sc_saving_class = ('on' == $shortcodify_disabled || $ase_status == 'ase-not-active') ? 'shortcodify-disabled' : 'shortcodify-enabled'; |
|
| 250 | 250 | |
| 251 | - $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor','off'); |
|
| 251 | + $use_wp_block_image = lasso_editor_get_option('use_wp_block_image', 'lasso_editor', 'off'); |
|
| 252 | 252 | |
| 253 | 253 | ?> |
| 254 | - <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style ?>> |
|
| 255 | - <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"';}?>> |
|
| 256 | - <?php do_action( 'lasso_toolbar_components_before' );?> |
|
| 257 | - <li id="lasso-toolbar--bold" title="<?php esc_attr_e( 'Bold', 'lasso' );?>"></li> |
|
| 258 | - <li id="lasso-toolbar--underline" title="<?php esc_attr_e( 'Underline', 'lasso' );?>"></li> |
|
| 259 | - <li id="lasso-toolbar--italic" title="<?php esc_attr_e( 'Italicize', 'lasso' );?>"></li> |
|
| 260 | - <li id="lasso-toolbar--strike" title="<?php esc_attr_e( 'Strikethrough', 'lasso' );?>"></li> |
|
| 261 | - <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e( 'Insert Component', 'lasso' );?>" style="color:#ffffa0;"> |
|
| 254 | + <div class="lasso--toolbar_wrap lasso-editor-controls--wrap <?php echo $toolbar_class.' '.$mobile_class.' '.$ase_status.' '.sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style ?>> |
|
| 255 | + <ul class="lasso--toolbar__inner lasso-editor-controls" <?php if ($is_mobile) {echo 'style="float:left;"'; }?>> |
|
| 256 | + <?php do_action('lasso_toolbar_components_before'); ?> |
|
| 257 | + <li id="lasso-toolbar--bold" title="<?php esc_attr_e('Bold', 'lasso'); ?>"></li> |
|
| 258 | + <li id="lasso-toolbar--underline" title="<?php esc_attr_e('Underline', 'lasso'); ?>"></li> |
|
| 259 | + <li id="lasso-toolbar--italic" title="<?php esc_attr_e('Italicize', 'lasso'); ?>"></li> |
|
| 260 | + <li id="lasso-toolbar--strike" title="<?php esc_attr_e('Strikethrough', 'lasso'); ?>"></li> |
|
| 261 | + <li id="lasso-toolbar--components" class="lasso-toolbar--components" title="<?php esc_attr_e('Insert Component', 'lasso'); ?>" style="color:#ffffa0;"> |
|
| 262 | 262 | <ul id="lasso-toolbar--components__list" style="display:none;color:white;"> |
| 263 | - <?php if ( 'ase-active' == $ase_status ): ?> |
|
| 264 | - <li data-type="image" title="<?php esc_attr_e( 'Image', 'lasso' );?>" class="lasso-toolbar--component__image"></li> |
|
| 265 | - <li data-type="character" title="<?php esc_attr_e( 'Character', 'lasso' );?>" class="lasso-toolbar--component__character"></li> |
|
| 266 | - <li data-type="quote" title="<?php esc_attr_e( 'Quote', 'lasso' );?>" class="lasso-toolbar--component__quote"></li> |
|
| 267 | - <!--li data-type="content" title="<?php esc_attr_e( 'Content', 'lasso' );?>" class="lasso-toolbar--component__content"></li--> |
|
| 268 | - <li data-type="chapter" title="<?php esc_attr_e( 'Chapter', 'lasso' );?>" class="lasso-toolbar--component__chapter"></li> |
|
| 269 | - <li data-type="parallax" title="<?php esc_attr_e( 'Parallax', 'lasso' );?>" class="lasso-toolbar--component__parallax"></li> |
|
| 270 | - <li data-type="audio" title="<?php esc_attr_e( 'Audio', 'lasso' );?>" class="lasso-toolbar--component__audio"></li> |
|
| 271 | - <li data-type="video" title="<?php esc_attr_e( 'Video', 'lasso' );?>" class="lasso-toolbar--component__video"></li> |
|
| 272 | - <li data-type="map" title="<?php esc_attr_e( 'Map', 'lasso' );?>" class="lasso-toolbar--component__map"></li> |
|
| 273 | - <li data-type="timeline_stop" title="<?php esc_attr_e( 'Timeline', 'lasso' );?>" class="lasso-toolbar--component__timeline"></li> |
|
| 274 | - <li data-type="document" title="<?php esc_attr_e( 'Document', 'lasso' );?>" class="lasso-toolbar--component__document"></li> |
|
| 275 | - <li data-type="collection" title="<?php esc_attr_e( 'Collection', 'lasso' );?>" class="lasso-toolbar--component__collection"></li> |
|
| 276 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery', 'lasso' );?>" class="lasso-toolbar--component__gallery"></li> |
|
| 277 | - <?php if ( class_exists ('Aesop_GalleryPop') ) { ?> |
|
| 278 | - <li data-type="gallery" title="<?php esc_attr_e( 'Gallery Pop', 'lasso' );?>" class="lasso-toolbar--component__gallerypop"></li> |
|
| 263 | + <?php if ('ase-active' == $ase_status): ?> |
|
| 264 | + <li data-type="image" title="<?php esc_attr_e('Image', 'lasso'); ?>" class="lasso-toolbar--component__image"></li> |
|
| 265 | + <li data-type="character" title="<?php esc_attr_e('Character', 'lasso'); ?>" class="lasso-toolbar--component__character"></li> |
|
| 266 | + <li data-type="quote" title="<?php esc_attr_e('Quote', 'lasso'); ?>" class="lasso-toolbar--component__quote"></li> |
|
| 267 | + <!--li data-type="content" title="<?php esc_attr_e('Content', 'lasso'); ?>" class="lasso-toolbar--component__content"></li--> |
|
| 268 | + <li data-type="chapter" title="<?php esc_attr_e('Chapter', 'lasso'); ?>" class="lasso-toolbar--component__chapter"></li> |
|
| 269 | + <li data-type="parallax" title="<?php esc_attr_e('Parallax', 'lasso'); ?>" class="lasso-toolbar--component__parallax"></li> |
|
| 270 | + <li data-type="audio" title="<?php esc_attr_e('Audio', 'lasso'); ?>" class="lasso-toolbar--component__audio"></li> |
|
| 271 | + <li data-type="video" title="<?php esc_attr_e('Video', 'lasso'); ?>" class="lasso-toolbar--component__video"></li> |
|
| 272 | + <li data-type="map" title="<?php esc_attr_e('Map', 'lasso'); ?>" class="lasso-toolbar--component__map"></li> |
|
| 273 | + <li data-type="timeline_stop" title="<?php esc_attr_e('Timeline', 'lasso'); ?>" class="lasso-toolbar--component__timeline"></li> |
|
| 274 | + <li data-type="document" title="<?php esc_attr_e('Document', 'lasso'); ?>" class="lasso-toolbar--component__document"></li> |
|
| 275 | + <li data-type="collection" title="<?php esc_attr_e('Collection', 'lasso'); ?>" class="lasso-toolbar--component__collection"></li> |
|
| 276 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery', 'lasso'); ?>" class="lasso-toolbar--component__gallery"></li> |
|
| 277 | + <?php if (class_exists('Aesop_GalleryPop')) { ?> |
|
| 278 | + <li data-type="gallery" title="<?php esc_attr_e('Gallery Pop', 'lasso'); ?>" class="lasso-toolbar--component__gallerypop"></li> |
|
| 279 | 279 | <?php }?> |
| 280 | - <?php if ( class_exists ('Aesop_Events') ) { ?> |
|
| 281 | - <li data-type="events" title="<?php esc_attr_e( 'Event', 'lasso' );?>" class="lasso-toolbar--component__event"></li> |
|
| 280 | + <?php if (class_exists('Aesop_Events')) { ?> |
|
| 281 | + <li data-type="events" title="<?php esc_attr_e('Event', 'lasso'); ?>" class="lasso-toolbar--component__event"></li> |
|
| 282 | 282 | <?php }?> |
| 283 | 283 | <?php else: ?> |
| 284 | 284 | <?php if ($use_wp_block_image == 'on') { ?> |
| 285 | - <li data-type="wpimg-block" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
| 285 | + <li data-type="wpimg-block" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
| 286 | 286 | <?php } else { ?> |
| 287 | - <li data-type="wpimg" title="<?php esc_attr_e( 'WordPress Image', 'lasso' );?>" class="image lasso-toolbar--component__image"></li> |
|
| 287 | + <li data-type="wpimg" title="<?php esc_attr_e('WordPress Image', 'lasso'); ?>" class="image lasso-toolbar--component__image"></li> |
|
| 288 | 288 | <?php } ?> |
| 289 | - <li data-type="wpquote" title="<?php esc_attr_e( 'WordPress Quote', 'lasso' );?>" class="quote lasso-toolbar--component__quote"></li> |
|
| 290 | - <!--li data-type="wpvideo" title="<?php esc_attr_e( 'WordPress Video', 'lasso' );?>" class="video lasso-toolbar--component__video"></li--> |
|
| 289 | + <li data-type="wpquote" title="<?php esc_attr_e('WordPress Quote', 'lasso'); ?>" class="quote lasso-toolbar--component__quote"></li> |
|
| 290 | + <!--li data-type="wpvideo" title="<?php esc_attr_e('WordPress Video', 'lasso'); ?>" class="video lasso-toolbar--component__video"></li--> |
|
| 291 | 291 | <?php endif; ?> |
| 292 | - <?php do_action( 'lasso_toolbar_components' );?> |
|
| 292 | + <?php do_action('lasso_toolbar_components'); ?> |
|
| 293 | 293 | </ul> |
| 294 | 294 | </li> |
| 295 | - <?php if ( $toolbar_headings ): ?> |
|
| 296 | - <li id="lasso-toolbar--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"></li> |
|
| 297 | - <li id="lasso-toolbar--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"></li> |
|
| 295 | + <?php if ($toolbar_headings): ?> |
|
| 296 | + <li id="lasso-toolbar--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"></li> |
|
| 297 | + <li id="lasso-toolbar--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"></li> |
|
| 298 | 298 | <?php endif; ?> |
| 299 | 299 | |
| 300 | 300 | |
| 301 | 301 | |
| 302 | - <?php if ( $toolbar_headings_h4 ): ?> |
|
| 303 | - <li id="lasso-toolbar--h4" title="<?php esc_attr_e( 'H4 Heading', 'lasso' );?>"></li> |
|
| 304 | - <li id="lasso-toolbar--h5" title="<?php esc_attr_e( 'H5 Heading', 'lasso' );?>"></li> |
|
| 305 | - <li id="lasso-toolbar--h6" title="<?php esc_attr_e( 'H6 Heading', 'lasso' );?>"></li> |
|
| 302 | + <?php if ($toolbar_headings_h4): ?> |
|
| 303 | + <li id="lasso-toolbar--h4" title="<?php esc_attr_e('H4 Heading', 'lasso'); ?>"></li> |
|
| 304 | + <li id="lasso-toolbar--h5" title="<?php esc_attr_e('H5 Heading', 'lasso'); ?>"></li> |
|
| 305 | + <li id="lasso-toolbar--h6" title="<?php esc_attr_e('H6 Heading', 'lasso'); ?>"></li> |
|
| 306 | 306 | <?php endif; ?> |
| 307 | 307 | |
| 308 | - <?php if ( $show_color ): ?> |
|
| 309 | - <li id="lasso-toolbar--color-set" title="<?php esc_attr_e( 'Set Color for Selected Text', 'lasso' );?>"></li> |
|
| 310 | - <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e( 'Choose Color', 'lasso' );?>"></li> |
|
| 308 | + <?php if ($show_color): ?> |
|
| 309 | + <li id="lasso-toolbar--color-set" title="<?php esc_attr_e('Set Color for Selected Text', 'lasso'); ?>"></li> |
|
| 310 | + <li id="lasso-toolbar--color-pick" title="<?php esc_attr_e('Choose Color', 'lasso'); ?>"></li> |
|
| 311 | 311 | <?php endif; ?> |
| 312 | 312 | |
| 313 | - <?php if ( $toolbar_list ): ?> |
|
| 314 | - <li id="lasso-toolbar--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"></li> |
|
| 315 | - <li id="lasso-toolbar--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"></li> |
|
| 313 | + <?php if ($toolbar_list): ?> |
|
| 314 | + <li id="lasso-toolbar--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"></li> |
|
| 315 | + <li id="lasso-toolbar--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"></li> |
|
| 316 | 316 | <?php endif; ?> |
| 317 | 317 | |
| 318 | 318 | |
| 319 | - <li id="lasso-toolbar--link" title="<?php esc_attr_e( 'Anchor Link', 'lasso' );?>"> |
|
| 319 | + <li id="lasso-toolbar--link" title="<?php esc_attr_e('Anchor Link', 'lasso'); ?>"> |
|
| 320 | 320 | <div id="lasso-toolbar--link__wrap" <?php echo $mobile_style ?> > |
| 321 | - <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'http://url.com', 'lasso' );?>"></div> |
|
| 322 | - <a href="#" title="<?php esc_attr_e( 'Create Link', 'lasso' );?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
| 321 | + <div id="lasso-toolbar--link__inner" contenteditable="true" placeholder="<?php esc_attr_e('http://url.com', 'lasso'); ?>"></div> |
|
| 322 | + <a href="#" title="<?php esc_attr_e('Create Link', 'lasso'); ?>" class="lasso-toolbar--link__control" id="lasso-toolbar--link__create" ></a> |
|
| 323 | 323 | <input class="styled-checkbox" type="checkbox" id="aesop-toolbar--link_newtab" checked/> |
| 324 | - <label for="aesop-toolbar--link_newtab"><?php esc_attr_e( 'Open in a New Tab', 'lasso' );?></label> |
|
| 324 | + <label for="aesop-toolbar--link_newtab"><?php esc_attr_e('Open in a New Tab', 'lasso'); ?></label> |
|
| 325 | 325 | </div> |
| 326 | 326 | </li> |
| 327 | - <?php do_action( 'lasso_toolbar_components_after' );?> |
|
| 328 | - <li id="lasso-toolbar--html" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>"> |
|
| 327 | + <?php do_action('lasso_toolbar_components_after'); ?> |
|
| 328 | + <li id="lasso-toolbar--html" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>"> |
|
| 329 | 329 | <div id="lasso-toolbar--html__wrap" <?php echo $mobile_style ?>> |
| 330 | - <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?>"></div> |
|
| 330 | + <div id="lasso-toolbar--html__inner" contenteditable="true" placeholder="<?php esc_attr_e('Enter HTML to insert', 'lasso'); ?>"></div> |
|
| 331 | 331 | <div id="lasso-toolbar--html__footer"> |
| 332 | 332 | <div id="lasso-toolbar--html__footer_desc" > |
| 333 | - <?php esc_attr_e( 'Enter HTML to insert', 'lasso' );?><br> |
|
| 334 | - <?php esc_attr_e( 'You can also use Shortcodes', 'lasso' );?><br> |
|
| 335 | - <?php esc_attr_e( 'You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso' );?> |
|
| 333 | + <?php esc_attr_e('Enter HTML to insert', 'lasso'); ?><br> |
|
| 334 | + <?php esc_attr_e('You can also use Shortcodes', 'lasso'); ?><br> |
|
| 335 | + <?php esc_attr_e('You can also enter a URL to embed, such as Youtube, Vimeo and Twitter URLs.', 'lasso'); ?> |
|
| 336 | 336 | </div> |
| 337 | 337 | <ul class="lasso-toolbar--html-snips"> |
| 338 | 338 | |
| 339 | - <?php if ( !$toolbar_headings ): ?> |
|
| 340 | - <li id="lasso-html--h2" title="<?php esc_attr_e( 'H2 Heading', 'lasso' );?>"> |
|
| 341 | - <li id="lasso-html--h3" title="<?php esc_attr_e( 'H3 Heading', 'lasso' );?>"> |
|
| 339 | + <?php if (!$toolbar_headings): ?> |
|
| 340 | + <li id="lasso-html--h2" title="<?php esc_attr_e('H2 Heading', 'lasso'); ?>"> |
|
| 341 | + <li id="lasso-html--h3" title="<?php esc_attr_e('H3 Heading', 'lasso'); ?>"> |
|
| 342 | 342 | <?php endif; ?> |
| 343 | - <li id="lasso-html--ol" title="<?php esc_attr_e( 'Ordered List', 'lasso' );?>"> |
|
| 344 | - <li id="lasso-html--ul" title="<?php esc_attr_e( 'Unordered List', 'lasso' );?>"> |
|
| 343 | + <li id="lasso-html--ol" title="<?php esc_attr_e('Ordered List', 'lasso'); ?>"> |
|
| 344 | + <li id="lasso-html--ul" title="<?php esc_attr_e('Unordered List', 'lasso'); ?>"> |
|
| 345 | 345 | |
| 346 | - <li id="lasso-html--table" title="<?php esc_attr_e( 'Table', 'lasso' );?>"> |
|
| 346 | + <li id="lasso-html--table" title="<?php esc_attr_e('Table', 'lasso'); ?>"> |
|
| 347 | 347 | </ul> |
| 348 | - <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e( 'Cancel', 'lasso' );?></a> |
|
| 349 | - <a href="#" title="<?php esc_attr_e( 'Insert HTML or Code', 'lasso' );?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e( 'Insert', 'lasso' );?></a> |
|
| 348 | + <a class="lasso-toolbar--html__control lasso-toolbar--html__cancel" href="#"><?php _e('Cancel', 'lasso'); ?></a> |
|
| 349 | + <a href="#" title="<?php esc_attr_e('Insert HTML or Code', 'lasso'); ?>" class="lasso-toolbar--html__control" id="lasso-toolbar--html__insert" ><?php _e('Insert', 'lasso'); ?></a> |
|
| 350 | 350 | </div> |
| 351 | 351 | </div> |
| 352 | 352 | </li> |
| 353 | - <?php if ( $show_align ): ?> |
|
| 354 | - <li id="lasso-toolbar--left-align" title="<?php esc_attr_e( 'Text Left Align', 'lasso' );?>"></li> |
|
| 355 | - <li id="lasso-toolbar--center-align" title="<?php esc_attr_e( 'Text Center Align', 'lasso' );?>"></li> |
|
| 356 | - <li id="lasso-toolbar--right-align" title="<?php esc_attr_e( 'Text Right Align', 'lasso' );?>"></li> |
|
| 353 | + <?php if ($show_align): ?> |
|
| 354 | + <li id="lasso-toolbar--left-align" title="<?php esc_attr_e('Text Left Align', 'lasso'); ?>"></li> |
|
| 355 | + <li id="lasso-toolbar--center-align" title="<?php esc_attr_e('Text Center Align', 'lasso'); ?>"></li> |
|
| 356 | + <li id="lasso-toolbar--right-align" title="<?php esc_attr_e('Text Right Align', 'lasso'); ?>"></li> |
|
| 357 | 357 | <?php endif; ?> |
| 358 | 358 | </ul> |
| 359 | - <?php if ( is_singular() && $is_mobile ) { ?> |
|
| 359 | + <?php if (is_singular() && $is_mobile) { ?> |
|
| 360 | 360 | |
| 361 | - <div class="lasso--controls__right" data-posttype="<?php echo get_post_type( get_the_ID() );?>" data-status="<?php echo $status;?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
| 361 | + <div class="lasso--controls__right" data-posttype="<?php echo get_post_type(get_the_ID()); ?>" data-status="<?php echo $status; ?>" style="position:static;bottom:0px;right;0px;left:auto;"> |
|
| 362 | 362 | |
| 363 | - <a href="#" title="<?php esc_attr_e( 'Delete Post', 'lasso' );?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 364 | - <a href="#" title="<?php esc_attr_e( 'Post Settings', 'lasso' );?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 363 | + <a href="#" title="<?php esc_attr_e('Delete Post', 'lasso'); ?>" id="lasso--post-delete" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 364 | + <a href="#" title="<?php esc_attr_e('Post Settings', 'lasso'); ?>" id="lasso--post-settings2" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 365 | 365 | |
| 366 | - <a href="#" title="<?php esc_attr_e( 'Save Post', 'lasso' );?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 366 | + <a href="#" title="<?php esc_attr_e('Save Post', 'lasso'); ?>" id="lasso--save" class="lasso-save-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 367 | 367 | |
| 368 | - <?php if ( 'draft' == $status && ( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ) ) { ?> |
|
| 369 | - <a href="#" title="<?php esc_attr_e( 'Publish Post', 'lasso' );?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class;?>"></a> |
|
| 368 | + <?php if ('draft' == $status && (lasso_user_can('publish_posts') || lasso_user_can('publish_pages'))) { ?> |
|
| 369 | + <a href="#" title="<?php esc_attr_e('Publish Post', 'lasso'); ?>" id="lasso--publish" class="lasso-publish-post lasso--button <?php echo $sc_saving_class; ?>"></a> |
|
| 370 | 370 | <?php } ?> |
| 371 | 371 | |
| 372 | 372 | </div> |
@@ -384,20 +384,20 @@ discard block |
||
| 384 | 384 | */ |
| 385 | 385 | function lasso_editor_settings_toolbar() { |
| 386 | 386 | |
| 387 | - $delete_nonce = wp_create_nonce( 'lasso-delete-nonce' ); |
|
| 387 | + $delete_nonce = wp_create_nonce('lasso-delete-nonce'); |
|
| 388 | 388 | |
| 389 | 389 | ob_start(); |
| 390 | 390 | |
| 391 | 391 | |
| 392 | 392 | // let users add custom css classes |
| 393 | - $custom_classes = apply_filters( 'lasso_component_classes', '' ); |
|
| 393 | + $custom_classes = apply_filters('lasso_component_classes', ''); |
|
| 394 | 394 | |
| 395 | 395 | ?> |
| 396 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
| 397 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
| 398 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
| 399 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
| 400 | - <li class="lasso-delete" data-postid="<?php echo get_the_ID();?>" data-nonce="<?php echo $delete_nonce;?>" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
| 396 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
| 397 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
| 398 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
| 399 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
| 400 | + <li class="lasso-delete" data-postid="<?php echo get_the_ID(); ?>" data-nonce="<?php echo $delete_nonce; ?>" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
| 401 | 401 | </ul> |
| 402 | 402 | |
| 403 | 403 | <?php return ob_get_clean(); |
@@ -415,13 +415,13 @@ discard block |
||
| 415 | 415 | |
| 416 | 416 | |
| 417 | 417 | // has post thumbnail |
| 418 | - $has_thumbnail = has_post_thumbnail( get_the_ID() ) ? 'class="lasso--featImg--has-thumb"' : false; |
|
| 418 | + $has_thumbnail = has_post_thumbnail(get_the_ID()) ? 'class="lasso--featImg--has-thumb"' : false; |
|
| 419 | 419 | |
| 420 | 420 | ?> |
| 421 | - <ul id="lasso--featImgControls" <?php echo $has_thumbnail;?>> |
|
| 422 | - <li id="lasso--featImgUpload"><a title="<?php esc_attr_e( 'Replace Image', 'lasso' );?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
| 423 | - <li id="lasso--featImgDelete"><a title="<?php esc_attr_e( 'Delete Image', 'lasso' );?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
| 424 | - <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e( 'save', 'lasso' );?></a></li> |
|
| 421 | + <ul id="lasso--featImgControls" <?php echo $has_thumbnail; ?>> |
|
| 422 | + <li id="lasso--featImgUpload"><a title="<?php esc_attr_e('Replace Image', 'lasso'); ?>" href="#"><i class="lasso-icon-image"></i></a></li> |
|
| 423 | + <li id="lasso--featImgDelete"><a title="<?php esc_attr_e('Delete Image', 'lasso'); ?>" href="#"><i class="lasso-icon-bin2"></i></a></li> |
|
| 424 | + <li id="lasso--featImgSave"><a href="#"><?php esc_attr_e('save', 'lasso'); ?></a></li> |
|
| 425 | 425 | </ul> |
| 426 | 426 | |
| 427 | 427 | <?php return ob_get_clean(); |
@@ -445,19 +445,19 @@ discard block |
||
| 445 | 445 | |
| 446 | 446 | $postid = get_the_ID(); |
| 447 | 447 | |
| 448 | - $status = get_post_status( $postid ); |
|
| 449 | - $nonce = wp_create_nonce( 'lasso-update-post-settings' ); |
|
| 448 | + $status = get_post_status($postid); |
|
| 449 | + $nonce = wp_create_nonce('lasso-update-post-settings'); |
|
| 450 | 450 | |
| 451 | 451 | // let users add custom css classes |
| 452 | - $custom_classes = apply_filters( 'lasso_modal_settings_classes', '' ); |
|
| 452 | + $custom_classes = apply_filters('lasso_modal_settings_classes', ''); |
|
| 453 | 453 | |
| 454 | 454 | // objects categories |
| 455 | - $categories = lasso_get_post_objects( $postid, 'category' ); |
|
| 456 | - $tags = lasso_get_post_objects( $postid, 'tag' ); |
|
| 455 | + $categories = lasso_get_post_objects($postid, 'category'); |
|
| 456 | + $tags = lasso_get_post_objects($postid, 'tag'); |
|
| 457 | 457 | |
| 458 | 458 | // modal tabs |
| 459 | - $tabs = lasso_modal_addons('tab'); |
|
| 460 | - $content = lasso_modal_addons('content'); |
|
| 459 | + $tabs = lasso_modal_addons('tab'); |
|
| 460 | + $content = lasso_modal_addons('content'); |
|
| 461 | 461 | |
| 462 | 462 | //editor options |
| 463 | 463 | $allow_change_date = lasso_editor_get_option('allow_change_date', 'lasso_editor'); |
@@ -465,11 +465,11 @@ discard block |
||
| 465 | 465 | $no_url_setting = lasso_editor_get_option('no_url_setting', 'lasso_editor'); |
| 466 | 466 | |
| 467 | 467 | // are we singular |
| 468 | - $is_singular = is_singular(); |
|
| 468 | + $is_singular = is_singular(); |
|
| 469 | 469 | $is_singular_class = $is_singular ? 'lasso--postsettings__2col' : 'lasso--postsettings__1col'; |
| 470 | 470 | $has_thumb_class = has_post_thumbnail() ? 'has-thumbnail' : 'no-thumbnail'; |
| 471 | 471 | $theme_supports = current_theme_supports('post-thumbnails'); |
| 472 | - $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
| 472 | + $default_image = LASSO_URL.'/admin/assets/img/empty-img.png'; |
|
| 473 | 473 | |
| 474 | 474 | // do we support pending status |
| 475 | 475 | $no_pending_status = lasso_editor_get_option('no_pending_status', 'lasso_editor'); |
@@ -477,26 +477,26 @@ discard block |
||
| 477 | 477 | $excerpt = $post->post_excerpt; |
| 478 | 478 | |
| 479 | 479 | ?> |
| 480 | - <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>"> |
|
| 480 | + <div id="lasso--post-settings__modal" class="lasso--modal lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>"> |
|
| 481 | 481 | <div class="lasso--modal__inner"> |
| 482 | 482 | |
| 483 | - <?php if( $tabs ) { echo $tabs; } ?> |
|
| 483 | + <?php if ($tabs) { echo $tabs; } ?> |
|
| 484 | 484 | |
| 485 | 485 | <div class="lasso--modal__content modal__content--core visible" data-addon-content="core"> |
| 486 | - <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class;?>" > |
|
| 486 | + <form id="lasso--postsettings__form" enctype="multipart/form-data" class="lasso--post-form <?php echo $is_singular_class.' '.$has_thumb_class; ?>" > |
|
| 487 | 487 | |
| 488 | - <?php if ( $is_singular && $theme_supports ) : ?> |
|
| 488 | + <?php if ($is_singular && $theme_supports) : ?> |
|
| 489 | 489 | <div class="lasso--postsettings__left"> |
| 490 | - <label><?php _e( 'Featured Image', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the featured image for this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 491 | - <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url( $default_image );?>"> |
|
| 490 | + <label><?php _e('Featured Image', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the featured image for this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 491 | + <div class="lasso--post-thumb" data-default-thumb="<?php echo esc_url($default_image); ?>"> |
|
| 492 | 492 | |
| 493 | 493 | <div id="lasso--post-thumb__controls" class="lasso--post-thumb__controls"> |
| 494 | - <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image','lasso');?>" class="dashicons dashicons-edit"></i> |
|
| 495 | - <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image','lasso');?>" class="dashicons dashicons-no-alt"></i> |
|
| 494 | + <i id="lasso--post-thumb__add" title="<?php _e('Change Featured Image', 'lasso'); ?>" class="dashicons dashicons-edit"></i> |
|
| 495 | + <i id="lasso--post-thumb__delete" title="<?php _e('Delete Featured Image', 'lasso'); ?>" class="dashicons dashicons-no-alt"></i> |
|
| 496 | 496 | <i id="lasso--save-status" class="lasso-icon lasso-icon-spinner6 not-visible"></i> |
| 497 | 497 | </div> |
| 498 | 498 | |
| 499 | - <?php echo has_post_thumbnail() ? get_the_post_thumbnail( $post->ID, 'medium' ) : '<img src="'.$default_image.'">'; ?> |
|
| 499 | + <?php echo has_post_thumbnail() ? get_the_post_thumbnail($post->ID, 'medium') : '<img src="'.$default_image.'">'; ?> |
|
| 500 | 500 | |
| 501 | 501 | </div> |
| 502 | 502 | <div id="lasso--featImgSave"><a href="#" class="not-visible">Save</a></div> |
@@ -506,15 +506,15 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | <div class="lasso--postsettings__right"> |
| 508 | 508 | |
| 509 | - <?php if( lasso_user_can('publish_posts') || lasso_user_can('publish_pages') ): ?> |
|
| 509 | + <?php if (lasso_user_can('publish_posts') || lasso_user_can('publish_pages')): ?> |
|
| 510 | 510 | <div class="lasso--postsettings__option story-status-option"> |
| 511 | - <label><?php _e( 'Status', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the status of the post to draft or publish.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 512 | - <ul class="story-status story-status-<?php echo sanitize_html_class( $status );?>"> |
|
| 513 | - <li id="lasso--status-draft"><?php _e( 'Draft', 'lasso' );?></li> |
|
| 514 | - <?php if( !$no_pending_status ): ?> |
|
| 515 | - <li id="lasso--status-pending"><?php _e( 'Pending', 'lasso' );?></li> |
|
| 511 | + <label><?php _e('Status', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the status of the post to draft or publish.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 512 | + <ul class="story-status story-status-<?php echo sanitize_html_class($status); ?>"> |
|
| 513 | + <li id="lasso--status-draft"><?php _e('Draft', 'lasso'); ?></li> |
|
| 514 | + <?php if (!$no_pending_status): ?> |
|
| 515 | + <li id="lasso--status-pending"><?php _e('Pending', 'lasso'); ?></li> |
|
| 516 | 516 | <?php endif; ?> |
| 517 | - <li id="lasso--status-publish"><?php _e( 'Publish', 'lasso' );?></li> |
|
| 517 | + <li id="lasso--status-publish"><?php _e('Publish', 'lasso'); ?></li> |
|
| 518 | 518 | </ul> |
| 519 | 519 | <div class="lasso--slider_wrap"> |
| 520 | 520 | <div id="lasso--slider"></div> |
@@ -522,10 +522,10 @@ discard block |
||
| 522 | 522 | </div> |
| 523 | 523 | <?php endif; ?> |
| 524 | 524 | |
| 525 | - <?php if ( 'publish' == $status && !$no_url_setting): ?> |
|
| 525 | + <?php if ('publish' == $status && !$no_url_setting): ?> |
|
| 526 | 526 | <div class="lasso--postsettings__option story-slug-option"> |
| 527 | - <label><?php _e( 'Post URL', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Change the URL (slug) of this post.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 528 | - <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset( $post ) ? esc_attr( $post->post_name ) : false;?>"> |
|
| 527 | + <label><?php _e('Post URL', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Change the URL (slug) of this post.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 528 | + <input class="lasso--modal__trigger-footer" type="text" name="story_slug" value="<?php echo isset($post) ? esc_attr($post->post_name) : false; ?>"> |
|
| 529 | 529 | </div> |
| 530 | 530 | <?php endif; ?> |
| 531 | 531 | |
@@ -534,30 +534,30 @@ discard block |
||
| 534 | 534 | <div class="lasso--postsettings__middle"> |
| 535 | 535 | |
| 536 | 536 | <div class="lasso--postsettings__option story-categories-option"> |
| 537 | - <label style="width:120px;"><?php _e( 'Categories', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a category name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 538 | - <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories;?>"> |
|
| 537 | + <label style="width:120px;"><?php _e('Categories', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a category name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 538 | + <input id="lasso--cat-select" class="lasso--modal__trigger-footer" type="hidden" name="story_cats" value="<?php echo $categories; ?>"> |
|
| 539 | 539 | </div> |
| 540 | 540 | |
| 541 | 541 | <div class="lasso--postsettings__option story-tags-option"> |
| 542 | - <label><?php _e( 'Tags', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Type a tag name and press enter.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 543 | - <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags;?>"> |
|
| 542 | + <label><?php _e('Tags', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Type a tag name and press enter.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 543 | + <input id="lasso--tag-select" class="lasso--modal__trigger-footer" type="hidden" name="story_tags" value="<?php echo $tags; ?>"> |
|
| 544 | 544 | </div> |
| 545 | 545 | <?php |
| 546 | 546 | if ($allow_edit_excerpt) { |
| 547 | 547 | ?> |
| 548 | 548 | <div class="lasso--postsettings__option story-excerpt-option"> |
| 549 | - <label><?php _e( 'Excerpt', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Edit excerpt', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 550 | - <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt;?>" style="width:100%"> |
|
| 549 | + <label><?php _e('Excerpt', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Edit excerpt', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 550 | + <input id="lasso--excerpt" class="lasso--modal__trigger-footer" type="text" name="excerpt" value="<?php echo $excerpt; ?>" style="width:100%"> |
|
| 551 | 551 | </div> |
| 552 | 552 | <?php |
| 553 | 553 | }?> |
| 554 | 554 | <?php |
| 555 | 555 | if ($allow_change_date) { |
| 556 | - $dateformat = get_option( 'date_format' ); |
|
| 556 | + $dateformat = get_option('date_format'); |
|
| 557 | 557 | ?> |
| 558 | - <label><?php _e( 'Post Date', 'lasso' ); ?></label> |
|
| 559 | - <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid);?>"/> |
|
| 560 | - <a href="#" id="lasso--postsettings-setnow"><?php _e( 'Set to Now', 'lasso' ); ?></a> |
|
| 558 | + <label><?php _e('Post Date', 'lasso'); ?></label> |
|
| 559 | + <input type="text" class="editus_custom_date" name="post_date" value="<?php echo get_the_time($dateformat, $postid); ?>"/> |
|
| 560 | + <a href="#" id="lasso--postsettings-setnow"><?php _e('Set to Now', 'lasso'); ?></a> |
|
| 561 | 561 | <?php |
| 562 | 562 | }?> |
| 563 | 563 | |
@@ -579,23 +579,23 @@ discard block |
||
| 579 | 579 | ?> |
| 580 | 580 | <!--/div--> |
| 581 | 581 | |
| 582 | - <?php do_action( 'lasso_modal_post_form' ); // action ?> |
|
| 582 | + <?php do_action('lasso_modal_post_form'); // action ?> |
|
| 583 | 583 | |
| 584 | 584 | <div class="lasso--postsettings__footer" > |
| 585 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
| 585 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
| 586 | 586 | <input type="hidden" name="status" value=""> |
| 587 | 587 | <input type="hidden" name="categories" value=""> |
| 588 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
| 588 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
| 589 | 589 | <input type="hidden" name="action" value="process_update-object_post"> |
| 590 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
| 591 | - <?php do_action( 'lasso_modal_post_form_footer' ); // action ?> |
|
| 592 | - <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e( 'Save', 'lasso' );?>"> |
|
| 590 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
| 591 | + <?php do_action('lasso_modal_post_form_footer'); // action ?> |
|
| 592 | + <input type="submit" id="lasso--postsettings-submit" value="<?php esc_attr_e('Save', 'lasso'); ?>"> |
|
| 593 | 593 | </div> |
| 594 | 594 | |
| 595 | 595 | </form> |
| 596 | 596 | </div> |
| 597 | 597 | |
| 598 | - <?php if( $tabs ) { echo $content; } ?> |
|
| 598 | + <?php if ($tabs) { echo $content; } ?> |
|
| 599 | 599 | |
| 600 | 600 | </div> |
| 601 | 601 | |
@@ -617,43 +617,43 @@ discard block |
||
| 617 | 617 | ob_start(); |
| 618 | 618 | |
| 619 | 619 | |
| 620 | - $status = get_post_status( get_the_ID() ); |
|
| 620 | + $status = get_post_status(get_the_ID()); |
|
| 621 | 621 | |
| 622 | - $nonce = wp_create_nonce( 'lasso-editor-new-post' ); |
|
| 622 | + $nonce = wp_create_nonce('lasso-editor-new-post'); |
|
| 623 | 623 | |
| 624 | 624 | // let users add custom css classes |
| 625 | - $custom_classes = apply_filters( 'lasso_modal_post_classes', '' ); |
|
| 625 | + $custom_classes = apply_filters('lasso_modal_post_classes', ''); |
|
| 626 | 626 | |
| 627 | 627 | // return the post type |
| 628 | - $type = get_post_type( get_the_ID() ); |
|
| 628 | + $type = get_post_type(get_the_ID()); |
|
| 629 | 629 | |
| 630 | 630 | $mobile_style = ""; |
| 631 | 631 | if (wp_is_mobile()) { |
| 632 | 632 | //$mobile_style = 'style="top:140px !important;"'; |
| 633 | 633 | } |
| 634 | 634 | ?> |
| 635 | - <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" <?php echo $mobile_style;?>"> |
|
| 635 | + <div id="lasso--post-new__modal" class="lasso--modal lasso--modal__med lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" <?php echo $mobile_style; ?>"> |
|
| 636 | 636 | <div class="lasso--modal__inner lasso--hasnewform"> |
| 637 | 637 | |
| 638 | 638 | <form id="lasso--postnew__form" enctype="multipart/form-data" class="lasso--post-form"> |
| 639 | 639 | |
| 640 | 640 | <div class="lasso--postsettings__option story-slug-option lasso--last-option"> |
| 641 | - <label><?php esc_attr_e( 'New <span>post</span> title', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Specify title for new post, then save to edit.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 642 | - <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e( 'Type Your Title Here', 'lasso' );?>"> |
|
| 641 | + <label><?php esc_attr_e('New <span>post</span> title', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Specify title for new post, then save to edit.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 642 | + <input class="lasso--modal__trigger-footer" type="text" required name="story_title" value="" placeholder="<?php esc_attr_e('Type Your Title Here', 'lasso'); ?>"> |
|
| 643 | 643 | <div class="lasso--select-wrap" style="width:90px"> |
| 644 | 644 | <select id="lasso--select-type" name="story_type"> |
| 645 | 645 | |
| 646 | 646 | <?php |
| 647 | 647 | $types = lasso_post_types_names(); |
| 648 | - if ( !empty( $types ) ) { |
|
| 649 | - foreach( $types as $name => $label ) |
|
| 648 | + if (!empty($types)) { |
|
| 649 | + foreach ($types as $name => $label) |
|
| 650 | 650 | { |
| 651 | 651 | $type = $name; |
| 652 | 652 | //$type = preg_replace( '/s\b/','', $name ); |
| 653 | 653 | if ($type == 'page' && !current_user_can('edit_pages')) { |
| 654 | 654 | continue; |
| 655 | 655 | } |
| 656 | - printf( '<option value="%s">%s</option>', lcfirst( esc_attr( $type ) ) , ucfirst( esc_attr( $label ) ) ); |
|
| 656 | + printf('<option value="%s">%s</option>', lcfirst(esc_attr($type)), ucfirst(esc_attr($label))); |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | } |
@@ -664,19 +664,19 @@ discard block |
||
| 664 | 664 | </div> |
| 665 | 665 | |
| 666 | 666 | <div class="lasso--postsettings__footer"> |
| 667 | - <a href="#" class="lasso--postsettings-cancel"><?php _e( 'Cancel', 'lasso' );?></a> |
|
| 667 | + <a href="#" class="lasso--postsettings-cancel"><?php _e('Cancel', 'lasso'); ?></a> |
|
| 668 | 668 | <input type="hidden" name="action" value="process_new-object_post"> |
| 669 | 669 | <?php |
| 670 | - if ( !empty( $types ) ) { |
|
| 670 | + if (!empty($types)) { |
|
| 671 | 671 | // get the first element |
| 672 | 672 | $keys = array_keys($types); |
| 673 | - $type =$keys[0]; |
|
| 674 | - $type = preg_replace( '/s\b/','', $type ); |
|
| 675 | - printf( '<input type="hidden" name="object" value="%s">', lcfirst( esc_attr( $type ) ) ); |
|
| 673 | + $type = $keys[0]; |
|
| 674 | + $type = preg_replace('/s\b/', '', $type); |
|
| 675 | + printf('<input type="hidden" name="object" value="%s">', lcfirst(esc_attr($type))); |
|
| 676 | 676 | } |
| 677 | 677 | ?> |
| 678 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
| 679 | - <input type="submit" value="<?php esc_attr_e( 'Create', 'lasso' );?>"> |
|
| 678 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
| 679 | + <input type="submit" value="<?php esc_attr_e('Create', 'lasso'); ?>"> |
|
| 680 | 680 | </div> |
| 681 | 681 | |
| 682 | 682 | </form> |
@@ -704,18 +704,18 @@ discard block |
||
| 704 | 704 | ob_start(); |
| 705 | 705 | |
| 706 | 706 | // post status |
| 707 | - $status = get_post_status( get_the_ID() ); |
|
| 707 | + $status = get_post_status(get_the_ID()); |
|
| 708 | 708 | |
| 709 | 709 | // let users add custom css classes |
| 710 | - $custom_classes = apply_filters( 'lasso_modal_all_post_classes', '' ); |
|
| 710 | + $custom_classes = apply_filters('lasso_modal_all_post_classes', ''); |
|
| 711 | 711 | |
| 712 | 712 | ?> |
| 713 | - <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class( $custom_classes );?>" style="max-height:100%"> |
|
| 713 | + <div id="lasso--all-posts__modal" class="lasso--modal lasso--modal__full lassoShowAnimate <?php echo sanitize_html_class($custom_classes); ?>" style="max-height:100%"> |
|
| 714 | 714 | <div class="lasso--modal__inner"> |
| 715 | 715 | |
| 716 | 716 | <div class="lasso--post-filtering not-visible"> |
| 717 | 717 | <div class="lasso--search__results"> |
| 718 | - <span id="lasso--results-found"></span><?php _e('results found','lasso');?> |
|
| 718 | + <span id="lasso--results-found"></span><?php _e('results found', 'lasso'); ?> |
|
| 719 | 719 | </div> |
| 720 | 720 | <div class="lasso--search"> |
| 721 | 721 | <i id="lasso--search__toggle" class="dashicons dashicons-search"></i> |
@@ -729,18 +729,18 @@ discard block |
||
| 729 | 729 | $post_types = lasso_post_types_names(); |
| 730 | 730 | $rest_bases = lasso_post_types_rest_base(); |
| 731 | 731 | |
| 732 | - if ( ! empty( $post_types ) ) { |
|
| 732 | + if (!empty($post_types)) { |
|
| 733 | 733 | $first = 'active'; |
| 734 | - foreach( $post_types as $name => $label ) { |
|
| 734 | + foreach ($post_types as $name => $label) { |
|
| 735 | 735 | if (array_key_exists($name, $rest_bases)) { |
| 736 | - printf( '<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr( $first), esc_attr( $rest_bases[$name] ), esc_attr( $label ) ); |
|
| 736 | + printf('<li class="%1s lasso--show-objects" data-post-type="%2s">%3s</li>', esc_attr($first), esc_attr($rest_bases[$name]), esc_attr($label)); |
|
| 737 | 737 | } |
| 738 | 738 | $first = ''; |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - do_action('lasso_modal_post_objects');?> |
|
| 743 | + do_action('lasso_modal_post_objects'); ?> |
|
| 744 | 744 | |
| 745 | 745 | </ul> |
| 746 | 746 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
@@ -759,21 +759,21 @@ discard block |
||
| 759 | 759 | ob_start(); |
| 760 | 760 | |
| 761 | 761 | |
| 762 | - $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor','off'); |
|
| 762 | + $use_old_wpimg = lasso_editor_get_option('use_old_wpimg', 'lasso_editor', 'off'); |
|
| 763 | 763 | |
| 764 | 764 | // let users add custom css classes |
| 765 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
| 765 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
| 766 | 766 | |
| 767 | 767 | ?> |
| 768 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
| 769 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
| 770 | - <?php if ($use_old_wpimg=='on') {?> |
|
| 771 | - <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
| 768 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
| 769 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
| 770 | + <?php if ($use_old_wpimg == 'on') {?> |
|
| 771 | + <li class="lasso--wpimg-edit lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
| 772 | 772 | <?php } else {?> |
| 773 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
| 773 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
| 774 | 774 | <?php } ?> |
| 775 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
| 776 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
| 775 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
| 776 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
| 777 | 777 | </ul> |
| 778 | 778 | |
| 779 | 779 | <?php return ob_get_clean(); |
@@ -784,10 +784,10 @@ discard block |
||
| 784 | 784 | |
| 785 | 785 | ?> |
| 786 | 786 | <ul class="lasso-component--controls editus-center" contenteditable="false"> |
| 787 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
| 788 | - <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
| 789 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
| 790 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
| 787 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
| 788 | + <li class="lasso-component--settings__trigger lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
| 789 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
| 790 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
| 791 | 791 | </ul> |
| 792 | 792 | |
| 793 | 793 | <?php return ob_get_clean(); |
@@ -799,14 +799,14 @@ discard block |
||
| 799 | 799 | |
| 800 | 800 | |
| 801 | 801 | // let users add custom css classes |
| 802 | - $custom_classes = apply_filters( 'lasso_wpimg_classes', '' ); |
|
| 802 | + $custom_classes = apply_filters('lasso_wpimg_classes', ''); |
|
| 803 | 803 | |
| 804 | 804 | ?> |
| 805 | - <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class( $custom_classes );?>" contenteditable="false"> |
|
| 806 | - <li class="lasso-drag" title="<?php esc_attr_e( 'Move', 'lasso' );?>"></li> |
|
| 807 | - <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e( 'Settings', 'lasso' );?>"></li> |
|
| 808 | - <li class="lasso-clone" title="<?php esc_attr_e( 'Clone', 'lasso' );?>"></li> |
|
| 809 | - <li class="lasso-delete" title="<?php esc_attr_e( 'Delete', 'lasso' );?>"></li> |
|
| 805 | + <ul class="lasso-component--controls editus-center <?php echo sanitize_html_class($custom_classes); ?>" contenteditable="false"> |
|
| 806 | + <li class="lasso-drag" title="<?php esc_attr_e('Move', 'lasso'); ?>"></li> |
|
| 807 | + <li id="lasso--wpvideo-edit" class="lasso-settings" title="<?php esc_attr_e('Settings', 'lasso'); ?>"></li> |
|
| 808 | + <li class="lasso-clone" title="<?php esc_attr_e('Clone', 'lasso'); ?>"></li> |
|
| 809 | + <li class="lasso-delete" title="<?php esc_attr_e('Delete', 'lasso'); ?>"></li> |
|
| 810 | 810 | </ul> |
| 811 | 811 | |
| 812 | 812 | <?php return ob_get_clean(); |
@@ -819,16 +819,16 @@ discard block |
||
| 819 | 819 | */ |
| 820 | 820 | function lasso_map_form_footer() { |
| 821 | 821 | |
| 822 | - $nonce = wp_create_nonce( 'lasso-process-map' ); |
|
| 822 | + $nonce = wp_create_nonce('lasso-process-map'); |
|
| 823 | 823 | |
| 824 | 824 | ob_start(); |
| 825 | 825 | |
| 826 | 826 | ?> |
| 827 | 827 | <div class="lasso--map-form__footer"> |
| 828 | - <input type="hidden" name="postid" value="<?php echo get_the_ID();?>"> |
|
| 829 | - <input type="hidden" name="nonce" value="<?php echo $nonce;?>"> |
|
| 828 | + <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>"> |
|
| 829 | + <input type="hidden" name="nonce" value="<?php echo $nonce; ?>"> |
|
| 830 | 830 | <input type="hidden" name="action" value="process_map_save"> |
| 831 | - <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e( 'Save Locations', 'lasso' );?>"> |
|
| 831 | + <input type="submit" class="lasso--map-form__submit" value="<?php esc_attr_e('Save Locations', 'lasso'); ?>"> |
|
| 832 | 832 | </div> |
| 833 | 833 | |
| 834 | 834 | <?php return ob_get_clean(); |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | |
| 847 | 847 | ?> |
| 848 | 848 | <div id="lasso--pagerefresh" class="visible"> |
| 849 | - <?php _e( 'Save this post and refesh the page to see these changes.', 'lasso' );?> |
|
| 849 | + <?php _e('Save this post and refesh the page to see these changes.', 'lasso'); ?> |
|
| 850 | 850 | </div> |
| 851 | 851 | |
| 852 | 852 | <?php return ob_get_clean(); |
@@ -860,46 +860,46 @@ discard block |
||
| 860 | 860 | */ |
| 861 | 861 | function lasso_editor_options_blob() { |
| 862 | 862 | |
| 863 | - $codes = function_exists( 'aesop_shortcodes' ) ? aesop_shortcodes() : array(); |
|
| 864 | - $codes = add_wpimg_options( $codes ); |
|
| 865 | - $codes = add_wpimg_block_options( $codes ); |
|
| 866 | - $codes = apply_filters( 'lasso_custom_options', $codes ); |
|
| 867 | - $galleries = function_exists( 'lasso_editor_galleries_exist' ) && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
| 863 | + $codes = function_exists('aesop_shortcodes') ? aesop_shortcodes() : array(); |
|
| 864 | + $codes = add_wpimg_options($codes); |
|
| 865 | + $codes = add_wpimg_block_options($codes); |
|
| 866 | + $codes = apply_filters('lasso_custom_options', $codes); |
|
| 867 | + $galleries = function_exists('lasso_editor_galleries_exist') && lasso_editor_galleries_exist() ? 'has-galleries' : 'creating-gallery'; |
|
| 868 | 868 | |
| 869 | - $nonce = wp_create_nonce( 'lasso_gallery' ); |
|
| 869 | + $nonce = wp_create_nonce('lasso_gallery'); |
|
| 870 | 870 | |
| 871 | 871 | $blob = array(); |
| 872 | 872 | |
| 873 | - if ( empty( $codes ) ) |
|
| 873 | + if (empty($codes)) |
|
| 874 | 874 | return; |
| 875 | 875 | |
| 876 | - foreach ( $codes as $slug => $shortcode ) { |
|
| 876 | + foreach ($codes as $slug => $shortcode) { |
|
| 877 | 877 | $return = ''; |
| 878 | 878 | // Shortcode has atts |
| 879 | 879 | |
| 880 | - if ( count( $shortcode['atts'] ) && $shortcode['atts'] ) { |
|
| 880 | + if (count($shortcode['atts']) && $shortcode['atts']) { |
|
| 881 | 881 | |
| 882 | - foreach ( $shortcode['atts'] as $attr_name => $attr_info ) { |
|
| 882 | + foreach ($shortcode['atts'] as $attr_name => $attr_info) { |
|
| 883 | 883 | |
| 884 | 884 | |
| 885 | - $prefix = isset( $attr_info['prefix'] ) ? sprintf( '<span class="lasso-option-prefix">%s</span>', $attr_info['prefix'] ) : null; |
|
| 885 | + $prefix = isset($attr_info['prefix']) ? sprintf('<span class="lasso-option-prefix">%s</span>', $attr_info['prefix']) : null; |
|
| 886 | 886 | |
| 887 | 887 | $return .= '<form id="aesop-generator-settings" class="lasso--component-settings-form" class="'.$galleries.'" method="post">'; |
| 888 | 888 | $return .= '<p data-option="'.$attr_name.'" class="lasso-option aesop-'.$slug.'-'.$attr_name.'">'; |
| 889 | - $return .= '<label for="aesop-generator-attr-' . $attr_name . '">' . $attr_info['desc'] . '</label>'; |
|
| 889 | + $return .= '<label for="aesop-generator-attr-'.$attr_name.'">'.$attr_info['desc'].'</label>'; |
|
| 890 | 890 | $return .= '<small class="lasso-option-desc">'.$attr_info['tip'].'</small>'; |
| 891 | 891 | // Select |
| 892 | 892 | |
| 893 | - if ( isset( $attr_info['values'] ) ) { |
|
| 893 | + if (isset($attr_info['values'])) { |
|
| 894 | 894 | |
| 895 | - $return .= '<select name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr">'; |
|
| 895 | + $return .= '<select name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr">'; |
|
| 896 | 896 | |
| 897 | - $i=0; |
|
| 897 | + $i = 0; |
|
| 898 | 898 | |
| 899 | - foreach ( $attr_info['values'] as $attr_value ) { |
|
| 899 | + foreach ($attr_info['values'] as $attr_value) { |
|
| 900 | 900 | $attr_value_selected = $attr_info['default'] == $attr_value ? ' selected="selected"' : ''; |
| 901 | 901 | |
| 902 | - $return .= '<option value="'.$attr_info['values'][$i]['value'].'" ' . $attr_value_selected . '>'.$attr_info['values'][$i]['name'].'</option>'; |
|
| 902 | + $return .= '<option value="'.$attr_info['values'][$i]['value'].'" '.$attr_value_selected.'>'.$attr_info['values'][$i]['name'].'</option>'; |
|
| 903 | 903 | |
| 904 | 904 | $i++; |
| 905 | 905 | } |
@@ -908,24 +908,24 @@ discard block |
||
| 908 | 908 | |
| 909 | 909 | } else { |
| 910 | 910 | |
| 911 | - $attr_field_type = isset( $attr_info['type'] ) ? $attr_info['type'] : 'text'; |
|
| 911 | + $attr_field_type = isset($attr_info['type']) ? $attr_info['type'] : 'text'; |
|
| 912 | 912 | |
| 913 | 913 | // image upload |
| 914 | - if ( 'media_upload' == $attr_info['type'] ) { |
|
| 914 | + if ('media_upload' == $attr_info['type']) { |
|
| 915 | 915 | |
| 916 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
| 916 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
| 917 | 917 | $return .= '<a href="#" id="lasso-upload-img" class="lasso-option-button" /></a>'; |
| 918 | 918 | |
| 919 | - } elseif ( 'color' == $attr_info['type'] ) { |
|
| 919 | + } elseif ('color' == $attr_info['type']) { |
|
| 920 | 920 | |
| 921 | - $return .= '<input type="color" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
| 921 | + $return .= '<input type="color" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'; |
|
| 922 | 922 | |
| 923 | - } elseif ( 'text_area' == $attr_info['type'] ) { |
|
| 923 | + } elseif ('text_area' == $attr_info['type']) { |
|
| 924 | 924 | |
| 925 | - $return .= '<textarea name="' . $attr_name . '" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
| 925 | + $return .= '<textarea name="'.$attr_name.'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" placeholder="'.$attr_info['default'].'" /></textarea>'.$prefix.''; |
|
| 926 | 926 | |
| 927 | 927 | } else { |
| 928 | - $return .= '<input type="' . $attr_field_type . '" name="' . $attr_name . '" value="'.$attr_info['default'].'" id="aesop-generator-attr-' . $attr_name . '" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
| 928 | + $return .= '<input type="'.$attr_field_type.'" name="'.$attr_name.'" value="'.$attr_info['default'].'" id="aesop-generator-attr-'.$attr_name.'" class="lasso-generator-attr aesop-generator-attr-'.$attr_field_type.'" />'.$prefix.''; |
|
| 929 | 929 | } |
| 930 | 930 | } |
| 931 | 931 | $return .= '</p>'; |
@@ -936,9 +936,9 @@ discard block |
||
| 936 | 936 | /////////////////////////// |
| 937 | 937 | // START GALLERY AND MAP FRONT END STUFFS |
| 938 | 938 | /////////////////////////// |
| 939 | - if ( isset( $shortcode['front'] ) && true == $shortcode['front'] ) { |
|
| 939 | + if (isset($shortcode['front']) && true == $shortcode['front']) { |
|
| 940 | 940 | |
| 941 | - if ( 'gallery' == $shortcode['front_type'] ) { |
|
| 941 | + if ('gallery' == $shortcode['front_type']) { |
|
| 942 | 942 | |
| 943 | 943 | $return .= lasso_gallery_editor_module(); |
| 944 | 944 | |
@@ -949,13 +949,13 @@ discard block |
||
| 949 | 949 | /////////////////////////// |
| 950 | 950 | |
| 951 | 951 | // Single shortcode (not closed) |
| 952 | - if ( 'single' == $shortcode['type'] ) { |
|
| 952 | + if ('single' == $shortcode['type']) { |
|
| 953 | 953 | |
| 954 | 954 | $return .= '<input type="hidden" name="lasso-generator-content" id="lasso-generator-content" value="false" />'; |
| 955 | 955 | |
| 956 | 956 | } else { |
| 957 | 957 | |
| 958 | - $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>' . __( 'Content', 'lasso' ) . '</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="' . $shortcode['content'] . '" /></textarea></p>'; |
|
| 958 | + $return .= '<p data-option="content" class="lasso-option lasso-c-comp-text"><label>'.__('Content', 'lasso').'</label><textarea type="text" name="lasso-generator-content" id="lasso-generator-content" value="'.$shortcode['content'].'" /></textarea></p>'; |
|
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | $return .= '<p class="lasso-buttoninsert-wrap"><a href="#" class="lasso-generator-cancel" id="lasso--sidebar__close">Cancel</a><input type="submit" id="lasso-generator-insert" value="Save Settings"></p>'; |
@@ -975,95 +975,95 @@ discard block |
||
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | |
| 978 | -function add_wpimg_options( $shortcodes ) { |
|
| 978 | +function add_wpimg_options($shortcodes) { |
|
| 979 | 979 | $custom = array( |
| 980 | 980 | 'wpimg' => array( |
| 981 | - 'name' => __( 'Image', 'lasso' ), |
|
| 981 | + 'name' => __('Image', 'lasso'), |
|
| 982 | 982 | 'type' => 'single', |
| 983 | 983 | 'atts' => array( |
| 984 | 984 | 'img' => array( |
| 985 | 985 | 'type' => 'media_upload', |
| 986 | 986 | 'default' => '', |
| 987 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 988 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 987 | + 'desc' => __('Image URL', 'lasso'), |
|
| 988 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
| 989 | 989 | ), |
| 990 | 990 | 'align' => array( |
| 991 | 991 | 'type' => 'select', |
| 992 | 992 | 'values' => array( |
| 993 | 993 | array( |
| 994 | 994 | 'value' => 'center', |
| 995 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 995 | + 'name' => __('Center', 'aesop-core') |
|
| 996 | 996 | ), |
| 997 | 997 | array( |
| 998 | 998 | 'value' => 'left', |
| 999 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 999 | + 'name' => __('Left', 'aesop-core') |
|
| 1000 | 1000 | ), |
| 1001 | 1001 | array( |
| 1002 | 1002 | 'value' => 'right', |
| 1003 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1003 | + 'name' => __('Right', 'aesop-core') |
|
| 1004 | 1004 | ), |
| 1005 | 1005 | ), |
| 1006 | 1006 | 'default' => 'center', |
| 1007 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1007 | + 'desc' => __('Alignment', 'lasso'), |
|
| 1008 | 1008 | 'tip'=>'' |
| 1009 | 1009 | ), |
| 1010 | 1010 | |
| 1011 | 1011 | 'imgwidth' => array( |
| 1012 | 1012 | 'type' => 'text_small', |
| 1013 | 1013 | 'default' => '300px', |
| 1014 | - 'desc' => __( 'Image Width', 'lasso' ), |
|
| 1015 | - 'tip' => __( 'Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core' ) |
|
| 1014 | + 'desc' => __('Image Width', 'lasso'), |
|
| 1015 | + 'tip' => __('Width of the image. You can enter the size in pixels or percentage such as <code>40%</code> or <code>500px</code>.', 'aesop-core') |
|
| 1016 | 1016 | ), |
| 1017 | 1017 | 'imgheight' => array( |
| 1018 | 1018 | 'type' => 'text_small', |
| 1019 | 1019 | 'default' => '', |
| 1020 | - 'desc' => __( 'Image Height', 'lasso' ), |
|
| 1021 | - 'tip' => __( 'Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core' ) |
|
| 1020 | + 'desc' => __('Image Height', 'lasso'), |
|
| 1021 | + 'tip' => __('Used only for the Panorama mode. Can be set using pixel values such as <code>500px</code>. If unspecified, the original height would be used. ', 'aesop-core') |
|
| 1022 | 1022 | ), |
| 1023 | 1023 | 'linkoption' => array( |
| 1024 | 1024 | 'type' => 'select', |
| 1025 | 1025 | 'values' => array( |
| 1026 | 1026 | array( |
| 1027 | 1027 | 'value' => 'none', |
| 1028 | - 'name' => __( 'None', 'aesop-core' ) |
|
| 1028 | + 'name' => __('None', 'aesop-core') |
|
| 1029 | 1029 | ), |
| 1030 | 1030 | array( |
| 1031 | 1031 | 'value' => 'img', |
| 1032 | - 'name' => __( 'Image', 'aesop-core' ) |
|
| 1032 | + 'name' => __('Image', 'aesop-core') |
|
| 1033 | 1033 | ), |
| 1034 | 1034 | array( |
| 1035 | 1035 | 'value' => 'url', |
| 1036 | - 'name' => __( 'URL', 'aesop-core' ) |
|
| 1036 | + 'name' => __('URL', 'aesop-core') |
|
| 1037 | 1037 | ), |
| 1038 | 1038 | ), |
| 1039 | 1039 | 'default' => 'none', |
| 1040 | - 'desc' => __( 'Link', 'lasso' ), |
|
| 1041 | - 'tip' => __( 'Click leads to:', 'lasso' ) |
|
| 1040 | + 'desc' => __('Link', 'lasso'), |
|
| 1041 | + 'tip' => __('Click leads to:', 'lasso') |
|
| 1042 | 1042 | ), |
| 1043 | 1043 | |
| 1044 | 1044 | 'link' => array( |
| 1045 | 1045 | 'type' => 'text', |
| 1046 | 1046 | 'default' => '', |
| 1047 | - 'desc' => __( 'URL Link', 'lasso' ), |
|
| 1048 | - 'tip' => __( 'URL link', 'lasso' ) |
|
| 1047 | + 'desc' => __('URL Link', 'lasso'), |
|
| 1048 | + 'tip' => __('URL link', 'lasso') |
|
| 1049 | 1049 | ), |
| 1050 | 1050 | 'alt' => array( |
| 1051 | 1051 | 'type' => 'text', |
| 1052 | 1052 | 'default' => '', |
| 1053 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1054 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1053 | + 'desc' => __('Image ALT', 'lasso'), |
|
| 1054 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
| 1055 | 1055 | ), |
| 1056 | 1056 | |
| 1057 | 1057 | 'caption' => array( |
| 1058 | 1058 | 'type' => 'text_area', |
| 1059 | 1059 | 'default' => '', |
| 1060 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1061 | - 'tip' => __( 'Optional caption for the image.', 'lasso' ) |
|
| 1060 | + 'desc' => __('Caption', 'lasso'), |
|
| 1061 | + 'tip' => __('Optional caption for the image.', 'lasso') |
|
| 1062 | 1062 | ), |
| 1063 | 1063 | |
| 1064 | 1064 | |
| 1065 | 1065 | ), |
| 1066 | - 'desc' => __( 'An image.', 'aesop-core' ), |
|
| 1066 | + 'desc' => __('An image.', 'aesop-core'), |
|
| 1067 | 1067 | 'codes' => '<script> |
| 1068 | 1068 | jQuery(document).ready(function($){ |
| 1069 | 1069 | function linkSetting(l){ |
@@ -1087,57 +1087,57 @@ discard block |
||
| 1087 | 1087 | ) |
| 1088 | 1088 | ); |
| 1089 | 1089 | |
| 1090 | - return array_merge( $shortcodes, $custom ); |
|
| 1090 | + return array_merge($shortcodes, $custom); |
|
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | -function add_wpimg_block_options( $shortcodes ) { |
|
| 1093 | +function add_wpimg_block_options($shortcodes) { |
|
| 1094 | 1094 | $custom = array( |
| 1095 | 1095 | 'wpimg-block' => array( |
| 1096 | - 'name' => __( 'Image', 'lasso' ), |
|
| 1096 | + 'name' => __('Image', 'lasso'), |
|
| 1097 | 1097 | 'type' => 'single', |
| 1098 | 1098 | 'atts' => array( |
| 1099 | 1099 | 'img' => array( |
| 1100 | 1100 | 'type' => 'media_upload', |
| 1101 | 1101 | 'default' => '', |
| 1102 | - 'desc' => __( 'Image URL', 'lasso' ), |
|
| 1103 | - 'tip' => __( 'URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core' ) |
|
| 1102 | + 'desc' => __('Image URL', 'lasso'), |
|
| 1103 | + 'tip' => __('URL for the image. Click <em>Select Media</em> to open the WordPress Media Library.', 'aesop-core') |
|
| 1104 | 1104 | ), |
| 1105 | 1105 | 'align' => array( |
| 1106 | 1106 | 'type' => 'select', |
| 1107 | 1107 | 'values' => array( |
| 1108 | 1108 | array( |
| 1109 | 1109 | 'value' => 'center', |
| 1110 | - 'name' => __( 'Center', 'aesop-core' ) |
|
| 1110 | + 'name' => __('Center', 'aesop-core') |
|
| 1111 | 1111 | ), |
| 1112 | 1112 | array( |
| 1113 | 1113 | 'value' => 'left', |
| 1114 | - 'name' => __( 'Left', 'aesop-core' ) |
|
| 1114 | + 'name' => __('Left', 'aesop-core') |
|
| 1115 | 1115 | ), |
| 1116 | 1116 | array( |
| 1117 | 1117 | 'value' => 'right', |
| 1118 | - 'name' => __( 'Right', 'aesop-core' ) |
|
| 1118 | + 'name' => __('Right', 'aesop-core') |
|
| 1119 | 1119 | ), |
| 1120 | 1120 | ), |
| 1121 | 1121 | 'default' => 'center', |
| 1122 | - 'desc' => __( 'Alignment', 'lasso' ), |
|
| 1122 | + 'desc' => __('Alignment', 'lasso'), |
|
| 1123 | 1123 | 'tip'=>'' |
| 1124 | 1124 | ), |
| 1125 | 1125 | 'alt' => array( |
| 1126 | 1126 | 'type' => 'text', |
| 1127 | 1127 | 'default' => '', |
| 1128 | - 'desc' => __( 'Image ALT', 'lasso' ), |
|
| 1129 | - 'tip' => __( 'ALT tag used for the image. Primarily used for SEO purposes.', 'lasso' ) |
|
| 1128 | + 'desc' => __('Image ALT', 'lasso'), |
|
| 1129 | + 'tip' => __('ALT tag used for the image. Primarily used for SEO purposes.', 'lasso') |
|
| 1130 | 1130 | ), |
| 1131 | 1131 | 'caption' => array( |
| 1132 | 1132 | 'type' => 'text', |
| 1133 | 1133 | 'default' => '', |
| 1134 | - 'desc' => __( 'Caption', 'lasso' ), |
|
| 1135 | - 'tip' => __( 'Caption for the image.', 'lasso' ) |
|
| 1134 | + 'desc' => __('Caption', 'lasso'), |
|
| 1135 | + 'tip' => __('Caption for the image.', 'lasso') |
|
| 1136 | 1136 | ), |
| 1137 | 1137 | |
| 1138 | 1138 | |
| 1139 | 1139 | ), |
| 1140 | - 'desc' => __( 'A WP Image Block.', 'aesop-core' ), |
|
| 1140 | + 'desc' => __('A WP Image Block.', 'aesop-core'), |
|
| 1141 | 1141 | 'codes' => '<script> |
| 1142 | 1142 | jQuery(document).ready(function($){ |
| 1143 | 1143 | |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | ) |
| 1147 | 1147 | ); |
| 1148 | 1148 | |
| 1149 | - return array_merge( $shortcodes, $custom ); |
|
| 1149 | + return array_merge($shortcodes, $custom); |
|
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | 1152 | /** |
@@ -1166,14 +1166,14 @@ discard block |
||
| 1166 | 1166 | <div id="lasso--loading" class="lasso--loading"><div class="lasso--loader"></div></div> |
| 1167 | 1167 | <div id="lasso--hide" style="display:none;" class="lasso--post-form"> |
| 1168 | 1168 | <i class="lasso-icon lasso-icon-move"></i> |
| 1169 | - <label><?php _e( 'Revisions', 'lasso' );?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e( 'Use the slider to view the revision live on the page.', 'lasso' );?>"><i class="lasso-icon-help"></i></span></label> |
|
| 1169 | + <label><?php _e('Revisions', 'lasso'); ?><span class="lasso-util--help lasso-util--help-top" data-tooltip="<?php esc_attr_e('Use the slider to view the revision live on the page.', 'lasso'); ?>"><i class="lasso-icon-help"></i></span></label> |
|
| 1170 | 1170 | <div class="lasso--slider_wrap"> |
| 1171 | 1171 | <div id="lasso--slider"></div> |
| 1172 | 1172 | </div> |
| 1173 | 1173 | <ul id="lasso--revision-list"></ul> |
| 1174 | 1174 | <div class="lasso--btn-group lasso--btn-group-small"> |
| 1175 | - <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e( 'Cancel', 'lasso' );?></a> |
|
| 1176 | - <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e( 'Select', 'lasso' );?></a> |
|
| 1175 | + <a href="#" class="lasso--btn-secondary" id="lasso--close-modal"><?php _e('Cancel', 'lasso'); ?></a> |
|
| 1176 | + <a href="#" class="lasso--btn-primary" id="lasso--select-revision"><?php _e('Select', 'lasso'); ?></a> |
|
| 1177 | 1177 | </div> |
| 1178 | 1178 | </div> |
| 1179 | 1179 | |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | // Normalize into a six character long hex string |
| 1197 | 1197 | $hex = str_replace('#', '', $hex); |
| 1198 | 1198 | if (strlen($hex) == 3) { |
| 1199 | - $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); |
|
| 1199 | + $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2); |
|
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | // Split into three parts: R, G and B |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | |
| 1206 | 1206 | foreach ($color_parts as $color) { |
| 1207 | 1207 | $color = hexdec($color); // Convert to decimal |
| 1208 | - $color = max(0,min(255,$color + $steps)); // Adjust color |
|
| 1208 | + $color = max(0, min(255, $color + $steps)); // Adjust color |
|
| 1209 | 1209 | $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code |
| 1210 | 1210 | } |
| 1211 | 1211 | |
@@ -18,27 +18,27 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | // If this file is called directly, abort. |
| 21 | -if ( ! defined( 'WPINC' ) ) { |
|
| 21 | +if (!defined('WPINC')) { |
|
| 22 | 22 | die; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Set some constants |
| 26 | -define( 'LASSO_VERSION', '1.3.8' ); |
|
| 27 | -define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
|
| 28 | -define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
|
| 29 | -define( 'LASSO_FILE', __FILE__ ); |
|
| 26 | +define('LASSO_VERSION', '1.3.8'); |
|
| 27 | +define('LASSO_DIR', plugin_dir_path(__FILE__)); |
|
| 28 | +define('LASSO_URL', plugins_url('', __FILE__)); |
|
| 29 | +define('LASSO_FILE', __FILE__); |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Load plugin if PHP version is 5.4 or later. |
| 33 | 33 | */ |
| 34 | -if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
|
| 34 | +if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
|
| 35 | 35 | |
| 36 | - include_once( LASSO_DIR . '/bootstrap.php' ); |
|
| 36 | + include_once(LASSO_DIR.'/bootstrap.php'); |
|
| 37 | 37 | |
| 38 | 38 | } else { |
| 39 | 39 | |
| 40 | 40 | add_action('admin_head', 'lasso_fail_notice'); |
| 41 | - function lasso_fail_notice(){ |
|
| 41 | + function lasso_fail_notice() { |
|
| 42 | 42 | |
| 43 | 43 | printf('<div class="error"><p>Editus requires PHP 5.4 or higher.</p></div>'); |
| 44 | 44 | |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | add_filter('register_post_type_args', 'lasso_show_in_rest', 10, 2); |
| 49 | -function lasso_show_in_rest($args, $post_type){ |
|
| 49 | +function lasso_show_in_rest($args, $post_type) { |
|
| 50 | 50 | |
| 51 | - $allowed_post_types = lasso_editor_get_option( 'allowed_post_types', 'lasso_editor', array( ) ); |
|
| 52 | - $allowed_post_types = apply_filters( 'lasso_allowed_post_types', $allowed_post_types ); |
|
| 53 | - if (in_array( $post_type,$allowed_post_types)) { |
|
| 51 | + $allowed_post_types = lasso_editor_get_option('allowed_post_types', 'lasso_editor', array( )); |
|
| 52 | + $allowed_post_types = apply_filters('lasso_allowed_post_types', $allowed_post_types); |
|
| 53 | + if (in_array($post_type, $allowed_post_types)) { |
|
| 54 | 54 | $args['show_in_rest'] = true; |
| 55 | 55 | if ($post_type != 'post' && $post_type != 'page') { |
| 56 | 56 | $args['rest_base'] = $post_type; |
@@ -61,21 +61,21 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | -function lasso_editor_get_option( $option, $section, $default = '' ) { |
|
| 64 | +function lasso_editor_get_option($option, $section, $default = '') { |
|
| 65 | 65 | |
| 66 | - if ( empty( $option ) ) |
|
| 66 | + if (empty($option)) |
|
| 67 | 67 | return; |
| 68 | 68 | |
| 69 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 69 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 70 | 70 | |
| 71 | - $options = get_site_option( $section ); |
|
| 71 | + $options = get_site_option($section); |
|
| 72 | 72 | |
| 73 | 73 | } else { |
| 74 | 74 | |
| 75 | - $options = get_option( $section ); |
|
| 75 | + $options = get_option($section); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if ( isset( $options[$option] ) ) { |
|
| 78 | + if (isset($options[$option])) { |
|
| 79 | 79 | return $options[$option]; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -88,17 +88,17 @@ discard block |
||
| 88 | 88 | )); |
| 89 | 89 | |
| 90 | 90 | // Gutenberg |
| 91 | -if( function_exists( 'is_gutenberg_page' ) ) { |
|
| 92 | - function add_raw_to_post( $response, $post, $request ) { |
|
| 91 | +if (function_exists('is_gutenberg_page')) { |
|
| 92 | + function add_raw_to_post($response, $post, $request) { |
|
| 93 | 93 | $response_data = $response->get_data(); |
| 94 | - if ( is_array( $response_data['content'] )) { |
|
| 95 | - $response_data['content']['raw'] = $post->post_content ; |
|
| 96 | - $response->set_data( $response_data ); |
|
| 94 | + if (is_array($response_data['content'])) { |
|
| 95 | + $response_data['content']['raw'] = $post->post_content; |
|
| 96 | + $response->set_data($response_data); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return $response; |
| 100 | 100 | } |
| 101 | - add_filter( "rest_prepare_post", 'add_raw_to_post', 10, 3 ); |
|
| 101 | + add_filter("rest_prepare_post", 'add_raw_to_post', 10, 3); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -106,32 +106,32 @@ discard block |
||
| 106 | 106 | //table codes to be added |
| 107 | 107 | class editus_table { |
| 108 | 108 | |
| 109 | - public function __construct(){ |
|
| 109 | + public function __construct() { |
|
| 110 | 110 | $add_table = lasso_editor_get_option('add_table', 'lasso_editor', false); |
| 111 | 111 | if ($add_table) { |
| 112 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
| 112 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
| 113 | 113 | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | function scripts() |
| 118 | 118 | { |
| 119 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_table_edit_menu')); |
|
| 120 | - add_filter('lasso_components',array($this,'editus_components_add_table'),10,1); |
|
| 121 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_table'), 10 ); |
|
| 122 | - wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
|
| 123 | - wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
|
| 119 | + add_action('lasso_editor_controls_after_outside', array($this, 'editus_table_edit_menu')); |
|
| 120 | + add_filter('lasso_components', array($this, 'editus_components_add_table'), 10, 1); |
|
| 121 | + add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_table'), 10); |
|
| 122 | + wp_enqueue_style('editus-table-style', LASSO_URL.'/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true); |
|
| 123 | + wp_enqueue_script('editus_table', LASSO_URL.'/public/assets/js/editus-table-edit-public.js', array('jquery'), LASSO_VERSION, true); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | function editus_table_edit_menu() |
| 127 | 127 | { ?> |
| 128 | 128 | |
| 129 | 129 | <ul class='editus-table-menu'> |
| 130 | - <li data-action="insertcol"><?php echo __('Insert Column','lasso')?></li> |
|
| 131 | - <li data-action="insertrow"><?php echo __('Insert Row','lasso')?></li> |
|
| 132 | - <li data-action="delcol"><?php echo __('Delete Column','lasso')?></li> |
|
| 133 | - <li data-action="delrow"><?php echo __('Delete Row','lasso')?></li> |
|
| 134 | - <li data-action="deltable"><?php echo __('Delete Table','lasso')?></li |
|
| 130 | + <li data-action="insertcol"><?php echo __('Insert Column', 'lasso')?></li> |
|
| 131 | + <li data-action="insertrow"><?php echo __('Insert Row', 'lasso')?></li> |
|
| 132 | + <li data-action="delcol"><?php echo __('Delete Column', 'lasso')?></li> |
|
| 133 | + <li data-action="delrow"><?php echo __('Delete Row', 'lasso')?></li> |
|
| 134 | + <li data-action="deltable"><?php echo __('Delete Table', 'lasso')?></li |
|
| 135 | 135 | </ul> |
| 136 | 136 | <?php |
| 137 | 137 | } |
@@ -143,20 +143,20 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| 146 | - function editus_components_add_table( $array ){ |
|
| 146 | + function editus_components_add_table($array) { |
|
| 147 | 147 | $custom = array( |
| 148 | 148 | 'htmltable' => array( |
| 149 | - 'name' => __('HTML Table','lasso'), |
|
| 149 | + 'name' => __('HTML Table', 'lasso'), |
|
| 150 | 150 | 'content' => self::editus_html_table(), |
| 151 | 151 | ) |
| 152 | 152 | ); |
| 153 | - return array_merge( $array, $custom ); |
|
| 153 | + return array_merge($array, $custom); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | function editus_toolbar_components_add_table( ) { |
| 158 | 158 | ?> |
| 159 | - <li data-type="htmltable" title="<?php esc_attr_e( 'HTML Table', 'lasso' );?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
|
| 159 | + <li data-type="htmltable" title="<?php esc_attr_e('HTML Table', 'lasso'); ?>" class="quote lasso-toolbar--component__htmltable dashicons dashicons-grid-view"></li> |
|
| 160 | 160 | <?php |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -169,27 +169,27 @@ discard block |
||
| 169 | 169 | //table codes to be added |
| 170 | 170 | class editus_paragraph { |
| 171 | 171 | |
| 172 | - public function __construct(){ |
|
| 173 | - add_action('wp_enqueue_scripts', array($this,'scripts')); |
|
| 172 | + public function __construct() { |
|
| 173 | + add_action('wp_enqueue_scripts', array($this, 'scripts')); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | function scripts() |
| 177 | 177 | { |
| 178 | - add_action('lasso_editor_controls_after_outside', array($this,'editus_paragraph_style')); |
|
| 179 | - add_filter('lasso_components',array($this,'editus_components_add_paragraph'),10,1); |
|
| 180 | - add_action( 'lasso_toolbar_components', array($this,'editus_toolbar_components_add_paragraph'), 10 ); |
|
| 178 | + add_action('lasso_editor_controls_after_outside', array($this, 'editus_paragraph_style')); |
|
| 179 | + add_filter('lasso_components', array($this, 'editus_components_add_paragraph'), 10, 1); |
|
| 180 | + add_action('lasso_toolbar_components', array($this, 'editus_toolbar_components_add_paragraph'), 10); |
|
| 181 | 181 | //wp_enqueue_style( 'editus-table-style', LASSO_URL. '/public/assets/css/editus-table-edit-public.css', LASSO_VERSION, true ); |
| 182 | 182 | //wp_enqueue_script( 'editus_table', LASSO_URL. '/public/assets/js/editus-table-edit-public.js', array( 'jquery' ), LASSO_VERSION, true ); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - function editus_components_add_paragraph( $array ){ |
|
| 185 | + function editus_components_add_paragraph($array) { |
|
| 186 | 186 | $custom = array( |
| 187 | 187 | 'htmlparagraph' => array( |
| 188 | - 'name' => __('HTML Paragraph','lasso'), |
|
| 188 | + 'name' => __('HTML Paragraph', 'lasso'), |
|
| 189 | 189 | 'content' => self::editus_html_paragraph(), |
| 190 | 190 | ) |
| 191 | 191 | ); |
| 192 | - return array_merge( $array, $custom ); |
|
| 192 | + return array_merge($array, $custom); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | function editus_toolbar_components_add_paragraph( ) { |
| 215 | 215 | ?> |
| 216 | - <li data-type="htmlparagraph" title="<?php esc_attr_e( 'HTML Paragraph', 'lasso' );?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
| 216 | + <li data-type="htmlparagraph" title="<?php esc_attr_e('HTML Paragraph', 'lasso'); ?>" class="quote lasso-toolbar--component__htmlparagraph dashicons dashicons-editor-paragraph"></li> |
|
| 217 | 217 | <?php |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -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,19 +40,19 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @param array $allowed_fields The fields |
| 42 | 42 | */ |
| 43 | - $allowed_fields = apply_filters( 'lasso_meta_fields', array() ); |
|
| 43 | + $allowed_fields = apply_filters('lasso_meta_fields', array()); |
|
| 44 | 44 | |
| 45 | - if ( ! empty( $allowed_fields ) ) { |
|
| 46 | - foreach( $allowed_fields as $field ) { |
|
| 47 | - if ( isset( $data[ $field ] ) ) { |
|
| 45 | + if (!empty($allowed_fields)) { |
|
| 46 | + foreach ($allowed_fields as $field) { |
|
| 47 | + if (isset($data[$field])) { |
|
| 48 | 48 | //this original line changed dash to underscore |
| 49 | 49 | //update_post_meta( $post_id, lasso_unclean_string( $field ), $data[ $field ] ); |
| 50 | - update_post_meta( $post_id, $field, $data[ $field ] ); |
|
| 50 | + update_post_meta($post_id, $field, $data[$field]); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - do_action( 'editus_after_meta_update', $post_id, $data ); |
|
| 55 | + do_action('editus_after_meta_update', $post_id, $data); |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | return true; |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @return array Array of keys to pull from $data per action and their sanitization callback |
| 68 | 68 | */ |
| 69 | - public static function params(){ |
|
| 70 | - $params[ 'process_meta_update' ] = array( |
|
| 69 | + public static function params() { |
|
| 70 | + $params['process_meta_update'] = array( |
|
| 71 | 71 | 'post_id' => 'absint', |
| 72 | 72 | 'tab_name' => 'trim' |
| 73 | 73 | ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @return array Array of additional functions to use to authorize action. |
| 85 | 85 | */ |
| 86 | 86 | public static function auth_callbacks() { |
| 87 | - $params[ 'process_meta_update' ] = array( |
|
| 87 | + $params['process_meta_update'] = array( |
|
| 88 | 88 | 'lasso_user_can' |
| 89 | 89 | ); |
| 90 | 90 | |