Make WordPress Core

Ticket #28006: 28006.2.diff

File 28006.2.diff, 1.2 KB (added by hlashbrooke, 10 years ago)

Removes 'draft' suffixes and adds 'draft' prefix to post title

  • wp-includes/post-template.php

     
    134134                         */
    135135                        $private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ) );
    136136                        $title = sprintf( $private_title_format, $title );
     137                } else if ( isset( $post->post_status ) && 'draft' == $post->post_status ) {
     138
     139                        /**
     140                         * Filter the text prepended to the post title of draft posts.
     141                         *
     142                         * The filter is only applied on the front end.
     143                         *
     144                         * @since 4.0.0
     145                         *
     146                         * @param string $prepend Text displayed before the post title.
     147                         *                        Default 'Draft: %s'.
     148                         */
     149                        $draft_title_format = apply_filters( 'draft_title_format', __( 'Draft: %s' ) );
     150                        $title = sprintf( $draft_title_format, $title );
    137151                }
    138152        }
    139153
     
    521535                if ( isset( $post->post_type ) ) {
    522536                        $classes[] = 'single-' . sanitize_html_class($post->post_type, $post_id);
    523537                        $classes[] = 'postid-' . $post_id;
     538                        $classes[] = 'single-status-' . $post->post_status;
    524539
    525540                        // Post Format
    526541                        if ( post_type_supports( $post->post_type, 'post-formats' ) ) {