Make WordPress Core

Changeset 35614


Ignore:
Timestamp:
11/11/2015 08:54:20 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Remove non-translatable HTML code from the first post content in populate_network() and wp_install_defaults().

Add translator comment.

Props ramiy.
Fixes #34619.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r35575 r35614  
    984984                'wpmu_upgrade_site' => $wp_db_version,
    985985                'welcome_email' => $welcome_email,
    986                 'first_post' => __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ),
     986                /* translators: %s: site link */
     987                'first_post' => __( 'Welcome to %s. This is your first post. Edit or delete it, then start blogging!' ),
    987988                // @todo - network admins should have a method of editing the network siteurl (used for cookie hash)
    988989                'siteurl' => get_option( 'siteurl' ) . '/',
  • trunk/src/wp-admin/includes/upgrade.php

    r35487 r35614  
    156156                $first_post = get_site_option( 'first_post' );
    157157
    158                 if ( empty($first_post) )
    159                         $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start writing!' );
    160 
    161                 $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
    162                 $first_post = str_replace( "SITE_NAME", get_current_site()->site_name, $first_post );
     158                if ( ! $first_post ) {
     159                        /* translators: %s: site link */
     160                        $first_post = __( 'Welcome to %s. This is your first post. Edit or delete it, then start blogging!' );
     161                }
     162
     163                $first_post = sprintf( $first_post,
     164                        sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_current_site()->site_name )
     165                );
     166
     167                // Back-compat for pre-4.4
     168                $first_post = str_replace( 'SITE_URL', esc_url( network_home_url() ), $first_post );
     169                $first_post = str_replace( 'SITE_NAME', get_current_site()->site_name, $first_post );
    163170        } else {
    164171                $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
Note: See TracChangeset for help on using the changeset viewer.