2443 | | if ( $wp_error ) |
2444 | | return new WP_Error('empty_content', __('Content, title, and excerpt are empty.')); |
2445 | | else |
| 2443 | if ( $wp_error ) { |
| 2444 | if ( post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ) ) |
| 2445 | $message = __( 'Content, title, and excerpt are empty.' ); |
| 2446 | elseif ( post_type_supports( $post_type, 'title' ) ) |
| 2447 | $message = __( 'Content and title are empty.' ); |
| 2448 | elseif ( post_type_supports( $post_type, 'excerpt' ) ) |
| 2449 | $message = __( 'Content and excerpt are empty.' ); |
| 2450 | else |
| 2451 | $message = __( 'Content is empty.' ); |
| 2452 | |
| 2453 | return new WP_Error( 'empty_content', $message ); |
| 2454 | } else { |