diff --git wp-includes/class-wp-editor.php wp-includes/class-wp-editor.php
index 38ab7c2..4622db8 100644
|
|
final class _WP_Editors { |
395 | 395 | } |
396 | 396 | |
397 | 397 | $body_class = $editor_id; |
398 | | |
399 | | if ( $post = get_post() ) |
400 | | $body_class .= ' post-type-' . $post->post_type; |
| 398 | $post = get_post(); |
| 399 | |
| 400 | if ( $post ) { |
| 401 | $body_class .= ' post-type-' . $post->post_type . ' post-status-' . $post->post_status; |
| 402 | if ( post_type_supports( $post->post_type, 'post-formats' ) ) { |
| 403 | $post_format = get_post_format( $post ); |
| 404 | if ( $post_format && ! is_wp_error( $post_format ) ) |
| 405 | $body_class .= ' post-format-' . sanitize_html_class( $post_format ); |
| 406 | else |
| 407 | $body_class .= ' post-format-standard'; |
| 408 | } |
| 409 | } |
401 | 410 | |
402 | 411 | if ( !empty($set['tinymce']['body_class']) ) { |
403 | 412 | $body_class .= ' ' . $set['tinymce']['body_class']; |
diff --git wp-includes/post-template.php wp-includes/post-template.php
index 21620b4..c1b0535 100644
|
|
function get_body_class( $class = '' ) { |
437 | 437 | if ( post_type_supports( $post->post_type, 'post-formats' ) ) { |
438 | 438 | $post_format = get_post_format( $post->ID ); |
439 | 439 | |
440 | | if ( $post_format && !is_wp_error($post_format) ) |
| 440 | if ( $post_format && ! is_wp_error( $post_format ) ) |
441 | 441 | $classes[] = 'single-format-' . sanitize_html_class( $post_format ); |
442 | 442 | else |
443 | 443 | $classes[] = 'single-format-standard'; |
diff --git wp-includes/post.php wp-includes/post.php
index 716447f..f8c1f44 100644
|
|
function get_post_mime_type($ID = '') { |
758 | 758 | * |
759 | 759 | * @since 3.1.0 |
760 | 760 | * |
761 | | * @param int|object $post A post |
| 761 | * @param int|object $post Post ID or post object. Optional, default is the current post from the loop. |
762 | 762 | * |
763 | 763 | * @return mixed The format if successful. False if no format is set. WP_Error if errors. |
764 | 764 | */ |
765 | 765 | function get_post_format( $post = null ) { |
766 | | $post = get_post($post); |
| 766 | $post = get_post( $post ); |
| 767 | |
| 768 | if ( empty( $post ) ) |
| 769 | return new WP_Error( 'invalid_post', __( 'Invalid post' ) ); |
767 | 770 | |
768 | 771 | if ( ! post_type_supports( $post->post_type, 'post-formats' ) ) |
769 | 772 | return false; |