diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index d46e94ff24..3b551db6c0 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1283,7 +1283,7 @@ function wp_ajax_replyto_comment( $action ) { $comment_author_email = wp_slash( $user->user_email ); $comment_author_url = wp_slash( $user->user_url ); $comment_content = trim( $_POST['content'] ); - $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : ''; + $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment'; if ( current_user_can( 'unfiltered_html' ) ) { if ( ! isset( $_POST['_wp_unfiltered_html_comment'] ) ) { diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index 614a37457a..da6c4b13ef 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -111,7 +111,7 @@ CREATE TABLE $wpdb->comments ( comment_karma int(11) NOT NULL default '0', comment_approved varchar(20) NOT NULL default '1', comment_agent varchar(255) NOT NULL default '', - comment_type varchar(20) NOT NULL default '', + comment_type varchar(20) NOT NULL default 'comment', comment_parent bigint(20) unsigned NOT NULL default '0', user_id bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (comment_ID), diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 8e3d78cc62..7bb6452ff0 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -283,6 +283,7 @@ Commenter avatars come from Gravatar.' 'comment_date' => $now, 'comment_date_gmt' => $now_gmt, 'comment_content' => $first_comment, + 'comment_type' => 'comment', ) ); @@ -834,6 +835,10 @@ function upgrade_all() { upgrade_530(); } + if ( $wp_current_db_version < 47597 ) { + upgrade_550(); + } + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -2154,6 +2159,17 @@ function upgrade_530() { } } +/** + * Executes changes made in WordPress 5.5.0. + * + * @ignore + * @since 5.5.0 + */ +function upgrade_550() { + update_option( 'finished_updating_comment_type', 0 ); + wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' ); +} + /** * Executes network-level upgrade routines. * diff --git a/src/wp-content/themes/twentyten/functions.php b/src/wp-content/themes/twentyten/functions.php index 96629d1074..6c092f1074 100644 --- a/src/wp-content/themes/twentyten/functions.php +++ b/src/wp-content/themes/twentyten/functions.php @@ -418,6 +418,7 @@ if ( ! function_exists( 'twentyten_comment' ) ) : $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '': + case 'comment': ?>