Make WordPress Core

Ticket #62366: template.php.patch

File template.php.patch, 3.5 KB (added by akramipro, 3 months ago)
  • src/wp-admin/includes/template.php

     
    22922292                $post_status = '';
    22932293        }
    22942294
    2295         if ( ! empty( $post->post_password ) ) {
    2296                 $post_states['protected'] = _x( 'Password protected', 'post status' );
    2297         }
     2295        if ( $post instanceof WP_Post ) {
     2296                if ( ! empty( $post->post_password ) ) {
     2297                        $post_states['protected'] = _x( 'Password protected', 'post status' );
     2298                }
    22982299
    2299         if ( 'private' === $post->post_status && 'private' !== $post_status ) {
    2300                 $post_states['private'] = _x( 'Private', 'post status' );
    2301         }
     2300                if ( 'private' === $post->post_status && 'private' !== $post_status ) {
     2301                        $post_states['private'] = _x( 'Private', 'post status' );
     2302                }
    23022303
    2303         if ( 'draft' === $post->post_status ) {
    2304                 if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
    2305                         $post_states[] = __( 'Customization Draft' );
    2306                 } elseif ( 'draft' !== $post_status ) {
    2307                         $post_states['draft'] = _x( 'Draft', 'post status' );
     2304                if ( 'draft' === $post->post_status ) {
     2305                        if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
     2306                                $post_states[] = __( 'Customization Draft' );
     2307                        } elseif ( 'draft' !== $post_status ) {
     2308                                $post_states['draft'] = _x( 'Draft', 'post status' );
     2309                        }
     2310                } elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
     2311                        $post_states[] = _x( 'Customization Draft', 'post status' );
    23082312                }
    2309         } elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
    2310                 $post_states[] = _x( 'Customization Draft', 'post status' );
    2311         }
    23122313
    2313         if ( 'pending' === $post->post_status && 'pending' !== $post_status ) {
    2314                 $post_states['pending'] = _x( 'Pending', 'post status' );
    2315         }
     2314                if ( 'pending' === $post->post_status && 'pending' !== $post_status ) {
     2315                        $post_states['pending'] = _x( 'Pending', 'post status' );
     2316                }
    23162317
    2317         if ( is_sticky( $post->ID ) ) {
    2318                 $post_states['sticky'] = _x( 'Sticky', 'post status' );
    2319         }
     2318                if ( is_sticky( $post->ID ) ) {
     2319                        $post_states['sticky'] = _x( 'Sticky', 'post status' );
     2320                }
    23202321
    2321         if ( 'future' === $post->post_status ) {
    2322                 $post_states['scheduled'] = _x( 'Scheduled', 'post status' );
    2323         }
     2322                if ( 'future' === $post->post_status ) {
     2323                        $post_states['scheduled'] = _x( 'Scheduled', 'post status' );
     2324                }
    23242325
    2325         if ( 'page' === get_option( 'show_on_front' ) ) {
    2326                 if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
    2327                         $post_states['page_on_front'] = _x( 'Front Page', 'page label' );
     2326                if ( 'page' === get_option( 'show_on_front' ) ) {
     2327                        if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
     2328                                $post_states['page_on_front'] = _x( 'Front Page', 'page label' );
     2329                        }
     2330
     2331                        if ( (int) get_option( 'page_for_posts' ) === $post->ID ) {
     2332                                $post_states['page_for_posts'] = _x( 'Posts Page', 'page label' );
     2333                        }
    23282334                }
    23292335
    2330                 if ( (int) get_option( 'page_for_posts' ) === $post->ID ) {
    2331                         $post_states['page_for_posts'] = _x( 'Posts Page', 'page label' );
     2336                if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
     2337                        $post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' );
    23322338                }
    23332339        }
    23342340
    2335         if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
    2336                 $post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' );
    2337         }
    2338 
    23392341        /**
    23402342         * Filters the default post display states used in the posts list table.
    23412343         *