Make WordPress Core

Ticket #23198: 23198-4.diff

File 23198-4.diff, 2.4 KB (added by adamsilverstein, 11 years ago)

cleared up phpdoc

  • wp-includes/post-template.php

    Property changes on: .
    ___________________________________________________________________
    Added: svn:ignore
       + wp-config.php
    
    
     
    437437                        if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
    438438                                $post_format = get_post_format( $post->ID );
    439439
    440                                 if ( $post_format && !is_wp_error($post_format) )
     440                                if ( $post_format && !is_wp_error( $post_format ) )
    441441                                        $classes[] = 'single-format-' . sanitize_html_class( $post_format );
    442442                                else
    443443                                        $classes[] = 'single-format-standard';
  • wp-includes/post.php

     
    758758 *
    759759 * @since 3.1.0
    760760 *
    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.
    762762 *
    763763 * @return mixed The format if successful. False if no format is set. WP_Error if errors.
    764764 */
    765765function get_post_format( $post = null ) {
    766766        $post = get_post($post);
    767767
     768        if ( empty($post) )
     769                return new WP_Error('invalid_post', __('Invalid post'));
     770
    768771        if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
    769772                return false;
    770773
  • wp-includes/class-wp-editor.php

     
    395395                        }
    396396
    397397                        $body_class = $editor_id;
     398                        $post = get_post();
    398399
    399                         if ( $post = get_post() )
    400                                 $body_class .= ' post-type-' . $post->post_type;
     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                        }
    401410
    402411                        if ( !empty($set['tinymce']['body_class']) ) {
    403412                                $body_class .= ' ' . $set['tinymce']['body_class'];