Comments: Improve author and content of the default comment.

The new comment:

> A WordPress Commenter <!wapuu@wordpress.example>:
>
> Hi, this is a comment.
> To moderate comments, just log in. There you will have the option to edit or delete them.
> Commenter avatars come from <a href="!https://gravatar.com">Gravatar</a>.

Also introduces a network setting to set the email address of the first comment author on a new site.

Props Ipstenu, rachelbaker, jorbin, jeremyfelt.
Fixes #36702, #14268.
Built from https://develop.svn.wordpress.org/trunk@37888


git-svn-id: http://core.svn.wordpress.org/trunk@37829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-06-28 10:03:27 +00:00
parent db05059ca0
commit 4b9a726c5a
3 changed files with 18 additions and 5 deletions

View File

@ -191,19 +191,22 @@ function wp_install_defaults( $user_id ) {
$wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $cat_tt_id, 'object_id' => 1) ); $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $cat_tt_id, 'object_id' => 1) );
// Default comment // Default comment
$first_comment_author = __('Mr WordPress'); $first_comment_author = __( 'A WordPress Commenter' );
$first_comment_email = 'wapuu@wordpress.example';
$first_comment_url = 'https://wordpress.org/'; $first_comment_url = 'https://wordpress.org/';
$first_comment = __( 'Hi, this is a comment. $first_comment = __( 'Hi, this is a comment.
To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.'); To moderate comments, just log in. There you will have the option to edit or delete them.
Commenter avatars come from <a href="https://gravatar.com">Gravatar</a>.' );
if ( is_multisite() ) { if ( is_multisite() ) {
$first_comment_author = get_site_option( 'first_comment_author', $first_comment_author ); $first_comment_author = get_site_option( 'first_comment_author', $first_comment_author );
$first_comment_email = get_site_option( 'first_comment_email', $first_comment_email );
$first_comment_url = get_site_option( 'first_comment_url', network_home_url() ); $first_comment_url = get_site_option( 'first_comment_url', network_home_url() );
$first_comment = get_site_option( 'first_comment', $first_comment ); $first_comment = get_site_option( 'first_comment', $first_comment );
} }
$wpdb->insert( $wpdb->comments, array( $wpdb->insert( $wpdb->comments, array(
'comment_post_ID' => 1, 'comment_post_ID' => 1,
'comment_author' => $first_comment_author, 'comment_author' => $first_comment_author,
'comment_author_email' => '', 'comment_author_email' => $first_comment_email,
'comment_author_url' => $first_comment_url, 'comment_author_url' => $first_comment_url,
'comment_date' => $now, 'comment_date' => $now,
'comment_date_gmt' => $now_gmt, 'comment_date_gmt' => $now_gmt,

View File

@ -62,6 +62,7 @@ if ( $_POST ) {
'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author',
'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled',
'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'admin_email', 'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'admin_email',
'first_comment_email',
); );
// Handle translation install. // Handle translation install.
@ -264,6 +265,15 @@ if ( isset( $_GET['updated'] ) ) {
</p> </p>
</td> </td>
</tr> </tr>
<tr>
<th scope="row"><label for="first_comment_email"><?php _e( 'First Comment Email' ) ?></label></th>
<td>
<input type="text" size="40" name="first_comment_email" id="first_comment_email" aria-describedby="first-comment-email-desc" value="<?php echo esc_attr( get_site_option( 'first_comment_email' ) ); ?>" />
<p class="description" id="first-comment-email-desc">
<?php _e( 'The email address of the first comment author on a new site.' ) ?>
</p>
</td>
</tr>
<tr> <tr>
<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th> <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
<td> <td>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37887'; $wp_version = '4.6-alpha-37888';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.