WordPress.org

Make WordPress Core

Ticket #26764: 26764.diff

File 26764.diff, 2.1 KB (added by rohan013, 7 years ago)

The sum of publish and trash should be 1 for new installations( accounting for sample page and the 'hello world' post )

  • src/wp-admin/includes/dashboard.php

     
    12741274 * @since 3.3.0
    12751275 */
    12761276function wp_welcome_panel() {
     1277        $posts = wp_count_posts();
     1278        $pages = wp_count_posts( 'page' );
    12771279        ?>
    12781280        <div class="welcome-panel-content">
    12791281        <h3><?php _e( 'Welcome to WordPress!' ); ?></h3>
     
    13001302                        <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
    13011303                        <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
    13021304                <?php else : ?>
    1303                         <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
    1304                         <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1305                        <?php if ( $posts->publish + $posts->trash == 1 ) : ?>
     1306                                <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
     1307                        <?php else : ?>
     1308                                <li><?php printf( '<a href="%s" class="welcome-icon welcome-write-blog">' . __( 'Write another blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
     1309                        <?php endif; ?>
     1310                        <?php if ( $pages->publish + $pages->trash == 1 ) : ?>
     1311                                <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1312                        <?php else : ?>
     1313                                <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add another page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1314                        <?php endif; ?>
    13051315                <?php endif; ?>
    13061316                        <li><?php printf( '<a href="%s" class="welcome-icon welcome-view-site">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>
    13071317                </ul>