@@ 687-692 (lines=6) @@ | ||
684 | /** This action is documented in modules/carousel/jetpack-carousel.php */ |
|
685 | do_action( 'jp_carousel_check_blog_user_privileges' ); |
|
686 | ||
687 | if ( ! comments_open( $_post_id ) ) { |
|
688 | if ( $switched ) { |
|
689 | restore_current_blog(); |
|
690 | } |
|
691 | die( json_encode( array( 'error' => __( 'Comments on this post are closed.', 'jetpack' ) ) ) ); |
|
692 | } |
|
693 | ||
694 | if ( is_user_logged_in() ) { |
|
695 | $user = wp_get_current_user(); |
|
@@ 701-706 (lines=6) @@ | ||
698 | $email = $user->user_email; |
|
699 | $url = $user->user_url; |
|
700 | ||
701 | if ( empty( $user_id ) ) { |
|
702 | if ( $switched ) { |
|
703 | restore_current_blog(); |
|
704 | } |
|
705 | die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', 'jetpack' ) ) ) ); |
|
706 | } |
|
707 | } else { |
|
708 | $user_id = 0; |
|
709 | $display_name = $_POST['author']; |
|
@@ 714-719 (lines=6) @@ | ||
711 | $url = $_POST['url']; |
|
712 | ||
713 | if ( get_option( 'require_name_email' ) ) { |
|
714 | if ( empty( $display_name ) ) { |
|
715 | if ( $switched ) { |
|
716 | restore_current_blog(); |
|
717 | } |
|
718 | die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); |
|
719 | } |
|
720 | ||
721 | if ( empty( $email ) ) { |
|
722 | if ( $switched ) { |
|
@@ 721-726 (lines=6) @@ | ||
718 | die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); |
|
719 | } |
|
720 | ||
721 | if ( empty( $email ) ) { |
|
722 | if ( $switched ) { |
|
723 | restore_current_blog(); |
|
724 | } |
|
725 | die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); |
|
726 | } |
|
727 | ||
728 | if ( ! is_email( $email ) ) { |
|
729 | if ( $switched ) { |
|
@@ 728-733 (lines=6) @@ | ||
725 | die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); |
|
726 | } |
|
727 | ||
728 | if ( ! is_email( $email ) ) { |
|
729 | if ( $switched ) { |
|
730 | restore_current_blog(); |
|
731 | } |
|
732 | die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) ); |
|
733 | } |
|
734 | } |
|
735 | } |
|
736 |