@@ 802-807 (lines=6) @@ | ||
799 | /** This action is documented in modules/carousel/jetpack-carousel.php */ |
|
800 | do_action( 'jp_carousel_check_blog_user_privileges' ); |
|
801 | ||
802 | if ( ! comments_open( $_post_id ) ) { |
|
803 | if ( $switched ) { |
|
804 | restore_current_blog(); |
|
805 | } |
|
806 | die( json_encode( array( 'error' => __( 'Comments on this post are closed.', 'jetpack' ) ) ) ); |
|
807 | } |
|
808 | ||
809 | if ( is_user_logged_in() ) { |
|
810 | $user = wp_get_current_user(); |
|
@@ 816-821 (lines=6) @@ | ||
813 | $email = $user->user_email; |
|
814 | $url = $user->user_url; |
|
815 | ||
816 | if ( empty( $user_id ) ) { |
|
817 | if ( $switched ) { |
|
818 | restore_current_blog(); |
|
819 | } |
|
820 | die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', 'jetpack' ) ) ) ); |
|
821 | } |
|
822 | } else { |
|
823 | $user_id = 0; |
|
824 | $display_name = $_POST['author']; |
|
@@ 829-834 (lines=6) @@ | ||
826 | $url = $_POST['url']; |
|
827 | ||
828 | if ( get_option( 'require_name_email' ) ) { |
|
829 | if ( empty( $display_name ) ) { |
|
830 | if ( $switched ) { |
|
831 | restore_current_blog(); |
|
832 | } |
|
833 | die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); |
|
834 | } |
|
835 | ||
836 | if ( empty( $email ) ) { |
|
837 | if ( $switched ) { |
|
@@ 836-841 (lines=6) @@ | ||
833 | die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); |
|
834 | } |
|
835 | ||
836 | if ( empty( $email ) ) { |
|
837 | if ( $switched ) { |
|
838 | restore_current_blog(); |
|
839 | } |
|
840 | die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); |
|
841 | } |
|
842 | ||
843 | if ( ! is_email( $email ) ) { |
|
844 | if ( $switched ) { |
|
@@ 843-848 (lines=6) @@ | ||
840 | die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); |
|
841 | } |
|
842 | ||
843 | if ( ! is_email( $email ) ) { |
|
844 | if ( $switched ) { |
|
845 | restore_current_blog(); |
|
846 | } |
|
847 | die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) ); |
|
848 | } |
|
849 | } |
|
850 | } |
|
851 |