WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/14/2018 05:42:20 AM (18 months ago)
Author:
pento
Message:

Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.

Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/includes/upgrade.php

    r44151 r44168  
    193193
    194194            if ( ! $first_post ) {
    195                 /* translators: %s: site link */
    196                 $first_post = __( 'Welcome to %s. This is your first post. Edit or delete it, then start blogging!' );
     195                $first_post = "<!-- wp:paragraph -->\n<p>" .
     196                /* translators: first post content, %s: site link */
     197                __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
     198                "</p>\n<!-- /wp:paragraph -->";
    197199            }
    198200
     
    206208            $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
    207209        } else {
    208             $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
     210            $first_post = "<!-- wp:paragraph -->\n<p>" .
     211            /* translators: first post content, %s: site link */
     212            __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' ) .
     213            "</p>\n<!-- /wp:paragraph -->";
    209214        }
    210215
     
    271276        }
    272277
    273         $first_page = ! empty( $first_page ) ? $first_page : sprintf(
    274             __(
    275                 "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
    276 
    277 <blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)</blockquote>
    278 
    279 ...or something like this:
    280 
    281 <blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
    282 
    283 As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!"
    284             ),
    285             admin_url()
    286         );
     278        if ( empty( $first_page ) ) {
     279            $first_page = "<!-- wp:paragraph -->\n<p>";
     280            /* translators: first page content */
     281            $first_page .= __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:" );
     282            $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     283
     284            $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     285            /* translators: first page content */
     286            $first_page .= __( "Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like pi&#241;a coladas. (And gettin' caught in the rain.)" );
     287            $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     288
     289            $first_page .= "<!-- wp:paragraph -->\n<p>";
     290            /* translators: first page content */
     291            $first_page .= __( '...or something like this:' );
     292            $first_page .= "</p>\n<!-- /wp:paragraph -->\n\n";
     293
     294            $first_page .= "<!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><p>";
     295            /* translators: first page content */
     296            $first_page .= __( 'The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.' );
     297            $first_page .= "</p></blockquote>\n<!-- /wp:quote -->\n\n";
     298
     299            $first_page .= "<!-- wp:paragraph -->\n<p>";
     300            $first_page .= sprintf(
     301                /* translators: first page content, %s: site admin URL */
     302                __( 'As a new WordPress user, you should go to <a href="%s">your dashboard</a> to delete this page and create new pages for your content. Have fun!' ),
     303                admin_url()
     304            );
     305            $first_page .= "</p>\n<!-- /wp:paragraph -->";
     306        }
    287307
    288308        $first_post_guid = get_option( 'home' ) . '/?page_id=2';
     
    11891209                }
    11901210
    1191                             $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID ) );
     1211                $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID ) );
    11921212            }
    11931213        }
     
    22352255    }
    22362256
    2237     // 5.0
     2257    // 5.1
    22382258    if ( $wp_current_db_version < 42836 ) {
    22392259        $network_id = get_main_network_id();
Note: See TracChangeset for help on using the changeset viewer.