@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | add_action( 'wp_ajax_editus_featured_img', array( $this, 'set_featured_img' ) ); |
| 69 | 69 | add_action( 'wp_ajax_editus_del_featured_img', array( $this, 'del_featured_img' ) ); |
| 70 | 70 | |
| 71 | - add_action( 'wp_ajax_editus_publish_post', array( $this, 'publish_post' ) ); |
|
| 71 | + add_action( 'wp_ajax_editus_publish_post', array( $this, 'publish_post' ) ); |
|
| 72 | 72 | |
| 73 | 73 | // enable saving custom fields through REST API |
| 74 | 74 | self::enable_metasave('post'); |
@@ -268,14 +268,14 @@ discard block |
||
| 268 | 268 | $out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' ); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - // new ajax function to lock post for editing |
|
| 271 | + // new ajax function to lock post for editing |
|
| 272 | 272 | public function editus_lock_post() |
| 273 | 273 | { |
| 274 | 274 | $post_id= $_POST["postid"]; |
| 275 | 275 | $locked = wp_check_post_lock($post_id); |
| 276 | 276 | |
| 277 | 277 | if (!$locked) { |
| 278 | - wp_set_post_lock($post_id); |
|
| 278 | + wp_set_post_lock($post_id); |
|
| 279 | 279 | echo "true"; |
| 280 | 280 | } else { |
| 281 | 281 | $user_info = get_userdata($locked); |
@@ -400,59 +400,59 @@ discard block |
||
| 400 | 400 | ); |
| 401 | 401 | foreach ($_POST as $key => $value) { |
| 402 | 402 | if ($key !="code" && $key !="action") { |
| 403 | - //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
| 403 | + //$shortcode = $shortcode.$key.'="'.$value.'" '; |
|
| 404 | 404 | $atts[$key] = $value; |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | if ($code == "aesop_video") { |
| 408 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 409 | - echo aesop_video_shortcode($atts); |
|
| 408 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
|
| 409 | + echo aesop_video_shortcode($atts); |
|
| 410 | 410 | } |
| 411 | 411 | else if ($code == "aesop_image") { |
| 412 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 413 | - echo aesop_image_shortcode($atts); |
|
| 412 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
|
| 413 | + echo aesop_image_shortcode($atts); |
|
| 414 | 414 | } |
| 415 | 415 | else if ($code == "aesop_quote") { |
| 416 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 417 | - echo aesop_quote_shortcode($atts); |
|
| 416 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
|
| 417 | + echo aesop_quote_shortcode($atts); |
|
| 418 | 418 | } |
| 419 | 419 | else if ($code == "aesop_parallax") { |
| 420 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 421 | - echo aesop_parallax_shortcode($atts); |
|
| 420 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
|
| 421 | + echo aesop_parallax_shortcode($atts); |
|
| 422 | 422 | } |
| 423 | 423 | else if ($code == "aesop_character") { |
| 424 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 425 | - echo aesop_character_shortcode($atts); |
|
| 424 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
|
| 425 | + echo aesop_character_shortcode($atts); |
|
| 426 | 426 | } |
| 427 | 427 | else if ($code == "aesop_collection") { |
| 428 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 429 | - echo aesop_collection_shortcode($atts); |
|
| 428 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
|
| 429 | + echo aesop_collection_shortcode($atts); |
|
| 430 | 430 | } |
| 431 | 431 | else if ($code == "aesop_chapter") { |
| 432 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 433 | - echo aesop_chapter_shortcode($atts); |
|
| 432 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
|
| 433 | + echo aesop_chapter_shortcode($atts); |
|
| 434 | 434 | } |
| 435 | 435 | else if ($code == "aesop_content") { |
| 436 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 437 | - echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 436 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
|
| 437 | + echo aesop_content_shortcode($atts, $atts['content_data']); |
|
| 438 | 438 | } |
| 439 | 439 | else if ($code == "aesop_gallery") { |
| 440 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 441 | - echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 440 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
|
| 441 | + echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
|
| 442 | 442 | } |
| 443 | 443 | else if ($code == "aesop_audio") { |
| 444 | - require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 445 | - echo aesop_audio_shortcode($atts); |
|
| 444 | + require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
|
| 445 | + echo aesop_audio_shortcode($atts); |
|
| 446 | 446 | } |
| 447 | 447 | else { |
| 448 | 448 | $code = '['.$code.' '; |
| 449 | 449 | foreach ($atts as $key => $value) { |
| 450 | - $code = ''.$key.'="'.$value.'" '; |
|
| 450 | + $code = ''.$key.'="'.$value.'" '; |
|
| 451 | 451 | } |
| 452 | 452 | $code = $code.']'; |
| 453 | 453 | echo do_shortcode($code); |
| 454 | - //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
| 455 | - //echo aesop_audio_shortcode($atts); |
|
| 454 | + //require_once( ABSPATH . '/wp-content/plugins/aesop-events/public/includes/shortcode.php'); |
|
| 455 | + //echo aesop_audio_shortcode($atts); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | exit; |
@@ -492,12 +492,12 @@ discard block |
||
| 492 | 492 | exit; |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 496 | - public function publish_post( ) { |
|
| 495 | + /* This function doesn't actually publish post, but should be called when a post is published */ |
|
| 496 | + public function publish_post( ) { |
|
| 497 | 497 | |
| 498 | 498 | $post_id = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 499 | 499 | |
| 500 | - do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 500 | + do_action( 'transition_post_status', 'publish', 'draft', get_post( $post_id ) ); |
|
| 501 | 501 | |
| 502 | 502 | exit; |
| 503 | 503 | } |
@@ -555,14 +555,14 @@ discard block |
||
| 555 | 555 | $allow_new_category = lasso_editor_get_option( 'allow_new_category', 'lasso_editor' ); |
| 556 | 556 | |
| 557 | 557 | if ($taxonomy =='category') { |
| 558 | - // convert from names to category ids |
|
| 558 | + // convert from names to category ids |
|
| 559 | 559 | $cats = array(); |
| 560 | 560 | foreach ($value as $cat) { |
| 561 | 561 | $cat_id = get_cat_ID($cat); |
| 562 | 562 | if ($cat_id !=0) { |
| 563 | 563 | $cats [] = $cat_id; |
| 564 | 564 | } else if ($allow_new_category) { |
| 565 | - $cats [] = wp_create_category($cat); |
|
| 565 | + $cats [] = wp_create_category($cat); |
|
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | $value = $cats; |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | public function set_date( $postid, $value) { |
| 605 | 605 | if( $value ) { |
| 606 | 606 | $value = self::getEnglishMonthName($value)." ".date("H:i:s", current_time( 'timestamp', 1 )); |
| 607 | - wp_update_post( |
|
| 607 | + wp_update_post( |
|
| 608 | 608 | array ( |
| 609 | 609 | 'ID' => $postid, // ID of the post to update |
| 610 | 610 | 'post_date' => date( 'Y-m-d H:i:s', strtotime($value) ), |
@@ -407,44 +407,34 @@ discard block |
||
| 407 | 407 | if ($code == "aesop_video") { |
| 408 | 408 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-video.php'); |
| 409 | 409 | echo aesop_video_shortcode($atts); |
| 410 | - } |
|
| 411 | - else if ($code == "aesop_image") { |
|
| 410 | + } else if ($code == "aesop_image") { |
|
| 412 | 411 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-image.php'); |
| 413 | 412 | echo aesop_image_shortcode($atts); |
| 414 | - } |
|
| 415 | - else if ($code == "aesop_quote") { |
|
| 413 | + } else if ($code == "aesop_quote") { |
|
| 416 | 414 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-quote.php'); |
| 417 | 415 | echo aesop_quote_shortcode($atts); |
| 418 | - } |
|
| 419 | - else if ($code == "aesop_parallax") { |
|
| 416 | + } else if ($code == "aesop_parallax") { |
|
| 420 | 417 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-parallax.php'); |
| 421 | 418 | echo aesop_parallax_shortcode($atts); |
| 422 | - } |
|
| 423 | - else if ($code == "aesop_character") { |
|
| 419 | + } else if ($code == "aesop_character") { |
|
| 424 | 420 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-character.php'); |
| 425 | 421 | echo aesop_character_shortcode($atts); |
| 426 | - } |
|
| 427 | - else if ($code == "aesop_collection") { |
|
| 422 | + } else if ($code == "aesop_collection") { |
|
| 428 | 423 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-collections.php'); |
| 429 | 424 | echo aesop_collection_shortcode($atts); |
| 430 | - } |
|
| 431 | - else if ($code == "aesop_chapter") { |
|
| 425 | + } else if ($code == "aesop_chapter") { |
|
| 432 | 426 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-heading.php'); |
| 433 | 427 | echo aesop_chapter_shortcode($atts); |
| 434 | - } |
|
| 435 | - else if ($code == "aesop_content") { |
|
| 428 | + } else if ($code == "aesop_content") { |
|
| 436 | 429 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-cbox.php'); |
| 437 | 430 | echo aesop_content_shortcode($atts, $atts['content_data']); |
| 438 | - } |
|
| 439 | - else if ($code == "aesop_gallery") { |
|
| 431 | + } else if ($code == "aesop_gallery") { |
|
| 440 | 432 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-gallery.php'); |
| 441 | 433 | echo do_shortcode( '[aesop_gallery id="'.$atts["id"].'"]'); |
| 442 | - } |
|
| 443 | - else if ($code == "aesop_audio") { |
|
| 434 | + } else if ($code == "aesop_audio") { |
|
| 444 | 435 | require_once( ABSPATH . '/wp-content/plugins/aesop-story-engine/public/includes/components/component-audio.php'); |
| 445 | 436 | echo aesop_audio_shortcode($atts); |
| 446 | - } |
|
| 447 | - else { |
|
| 437 | + } else { |
|
| 448 | 438 | $code = '['.$code.' '; |
| 449 | 439 | foreach ($atts as $key => $value) { |
| 450 | 440 | $code = ''.$key.'="'.$value.'" '; |
@@ -472,8 +462,9 @@ discard block |
||
| 472 | 462 | $postid = isset( $_POST['postid'] ) ? $_POST['postid'] : false; |
| 473 | 463 | |
| 474 | 464 | // bail out if the current user can't publish posts |
| 475 | - if ( !lasso_user_can( 'delete_post', $postid ) ) |
|
| 476 | - return; |
|
| 465 | + if ( !lasso_user_can( 'delete_post', $postid ) ) { |
|
| 466 | + return; |
|
| 467 | + } |
|
| 477 | 468 | |
| 478 | 469 | if (!wp_verify_nonce( $_POST[ 'nonce' ], 'lasso_delete_post' )) { |
| 479 | 470 | wp_send_json_error(); |
@@ -569,15 +560,14 @@ discard block |
||
| 569 | 560 | } |
| 570 | 561 | |
| 571 | 562 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
| 572 | - } |
|
| 573 | - else { |
|
| 563 | + } else { |
|
| 574 | 564 | //remove all terms from post |
| 575 | 565 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
| 576 | 566 | } |
| 577 | 567 | |
| 578 | 568 | if ( ! is_wp_error( $result ) ) { |
| 579 | 569 | return true; |
| 580 | - }else{ |
|
| 570 | + } else{ |
|
| 581 | 571 | return false; |
| 582 | 572 | } |
| 583 | 573 | } |
@@ -588,13 +578,15 @@ discard block |
||
| 588 | 578 | |
| 589 | 579 | $month_numbers = range(1,12); |
| 590 | 580 | |
| 591 | - foreach($month_numbers as $month) |
|
| 592 | - $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
| 581 | + foreach($month_numbers as $month) { |
|
| 582 | + $english_months[] = strftime('%B',mktime(0,0,0,$month,1,2011)); |
|
| 583 | + } |
|
| 593 | 584 | |
| 594 | 585 | setlocale(LC_ALL, get_locale()); |
| 595 | 586 | |
| 596 | - foreach($month_numbers as $month) |
|
| 597 | - $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
| 587 | + foreach($month_numbers as $month) { |
|
| 588 | + $foreign_months[] = utf8_encode(strftime('%B',mktime(0,0,0,$month,1,2011))); |
|
| 589 | + } |
|
| 598 | 590 | |
| 599 | 591 | return str_replace($foreign_months, $english_months, $foreignMonthName); |
| 600 | 592 | } |