diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php
index c565817914..f273c4df6f 100644
--- a/wp-admin/includes/ajax-actions.php
+++ b/wp-admin/includes/ajax-actions.php
@@ -1464,7 +1464,7 @@ function wp_ajax_add_meta() {
$post_data['post_ID'] = $pid;
$post_data['post_type'] = $post->post_type;
$post_data['post_status'] = 'draft';
- $now = current_time( 'timestamp', 1 );
+ $now = time();
/* translators: 1: Post creation date, 2: Post creation time */
$post_data['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( __( 'F j, Y' ), $now ), date( __( 'g:i a' ), $now ) );
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index 7bebe3ff20..e3e8cca9a7 100644
--- a/wp-admin/includes/dashboard.php
+++ b/wp-admin/includes/dashboard.php
@@ -858,8 +858,9 @@ function wp_dashboard_recent_posts( $args ) {
echo '
';
- $today = date( 'Y-m-d', current_time( 'timestamp' ) );
- $tomorrow = date( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );
+ $today = current_time( 'Y-m-d' );
+ $tomorrow = gmdate( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );
+ $year = current_time( 'Y' );
while ( $posts->have_posts() ) {
$posts->the_post();
@@ -869,7 +870,7 @@ function wp_dashboard_recent_posts( $args ) {
$relative = __( 'Today' );
} elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
$relative = __( 'Tomorrow' );
- } elseif ( date( 'Y', $time ) !== date( 'Y', current_time( 'timestamp' ) ) ) {
+ } elseif ( date( 'Y', $time ) !== $year ) {
/* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
$relative = date_i18n( __( 'M jS Y' ), $time );
} else {
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 6336ee3d2d..a06f9228aa 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -774,20 +774,19 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
// todo: Remove this?
// echo '
';
- $time_adj = current_time( 'timestamp' );
$post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date;
- $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj );
- $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj );
- $aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj );
- $hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : gmdate( 'H', $time_adj );
- $mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : gmdate( 'i', $time_adj );
- $ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : gmdate( 's', $time_adj );
+ $jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' );
+ $mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' );
+ $aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' );
+ $hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' );
+ $mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' );
+ $ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' );
- $cur_jj = gmdate( 'd', $time_adj );
- $cur_mm = gmdate( 'm', $time_adj );
- $cur_aa = gmdate( 'Y', $time_adj );
- $cur_hh = gmdate( 'H', $time_adj );
- $cur_mn = gmdate( 'i', $time_adj );
+ $cur_jj = current_time( 'd' );
+ $cur_mm = current_time( 'm' );
+ $cur_aa = current_time( 'Y' );
+ $cur_hh = current_time( 'H' );
+ $cur_mn = current_time( 'i' );
$month = '',
+ $input_id,
+ $attributes['label']
+ );
+ }
+
+ $input_markup = sprintf(
+ '',
+ $input_id,
+ esc_attr( get_search_query() ),
+ esc_attr( $attributes['placeholder'] )
+ );
+
+ if ( ! empty( $attributes['buttonText'] ) ) {
+ $button_markup = sprintf(
+ '',
+ $attributes['buttonText']
+ );
+ }
+
+ $class = 'wp-block-search';
+ if ( isset( $attributes['className'] ) ) {
+ $class .= ' ' . $attributes['className'];
+ }
+
+ return sprintf(
+ '
',
+ $class,
+ esc_url( home_url( '/' ) ),
+ $label_markup . $input_markup . $button_markup
+ );
+}
+
+/**
+ * Registers the `core/search` block on the server.
+ */
+function register_block_core_search() {
+ register_block_type(
+ 'core/search',
+ array(
+ 'attributes' => array(
+ 'label' => array(
+ 'type' => 'string',
+ 'default' => __( 'Search' ),
+ ),
+ 'placeholder' => array(
+ 'type' => 'string',
+ 'default' => '',
+ ),
+ 'buttonText' => array(
+ 'type' => 'string',
+ 'default' => __( 'Search' ),
+ ),
+ ),
+
+ 'render_callback' => 'render_block_core_search',
+ )
+ );
+}
+
+add_action( 'init', 'register_block_core_search' );
diff --git a/wp-includes/blocks/tag-cloud.php b/wp-includes/blocks/tag-cloud.php
new file mode 100644
index 0000000000..c60f8a1dd6
--- /dev/null
+++ b/wp-includes/blocks/tag-cloud.php
@@ -0,0 +1,71 @@
+ false,
+ 'taxonomy' => $attributes['taxonomy'],
+ 'show_count' => $attributes['showTagCounts'],
+ );
+
+ $tag_cloud = wp_tag_cloud( $args );
+
+ if ( ! $tag_cloud ) {
+ $tag_cloud = esc_html( __( 'No terms to show.' ) );
+ }
+
+ return sprintf(
+ '%2$s
',
+ esc_attr( $class ),
+ $tag_cloud
+ );
+}
+
+/**
+ * Registers the `core/tag-cloud` block on server.
+ */
+function register_block_core_tag_cloud() {
+ register_block_type(
+ 'core/tag-cloud',
+ array(
+ 'attributes' => array(
+ 'taxonomy' => array(
+ 'type' => 'string',
+ 'default' => 'post_tag',
+ ),
+ 'className' => array(
+ 'type' => 'string',
+ ),
+ 'showTagCounts' => array(
+ 'type' => 'boolean',
+ 'default' => false,
+ ),
+ 'align' => array(
+ 'type' => 'string',
+ ),
+ ),
+ 'render_callback' => 'render_block_core_tag_cloud',
+ )
+ );
+}
+
+add_action( 'init', 'register_block_core_tag_cloud' );
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 11d4b77ff4..f63bafb406 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -2005,7 +2005,6 @@ function get_calendar( $initial = true, $echo = true ) {
}
// week_begins = 0 stands for Sunday
$week_begins = (int) get_option( 'start_of_week' );
- $ts = current_time( 'timestamp' );
// Let's figure out when we are
if ( ! empty( $monthnum ) && ! empty( $year ) ) {
@@ -2025,8 +2024,8 @@ function get_calendar( $initial = true, $echo = true ) {
$thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 );
}
} else {
- $thisyear = gmdate( 'Y', $ts );
- $thismonth = gmdate( 'm', $ts );
+ $thisyear = current_time( 'Y' );
+ $thismonth = current_time( 'm' );
}
$unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );
@@ -2136,9 +2135,9 @@ function get_calendar( $initial = true, $echo = true ) {
}
$newrow = false;
- if ( $day == gmdate( 'j', $ts ) &&
- $thismonth == gmdate( 'm', $ts ) &&
- $thisyear == gmdate( 'Y', $ts ) ) {
+ if ( $day == current_time( 'j' ) &&
+ $thismonth == current_time( 'm' ) &&
+ $thisyear == current_time( 'Y' ) ) {
$calendar_output .= '';
} else {
$calendar_output .= ' | ';
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index be39e36279..ef604dcc7d 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -470,7 +470,7 @@ function get_attachment_link( $post = null, $leavename = false ) {
function get_year_link( $year ) {
global $wp_rewrite;
if ( ! $year ) {
- $year = gmdate( 'Y', current_time( 'timestamp' ) );
+ $year = current_time( 'Y' );
}
$yearlink = $wp_rewrite->get_year_permastruct();
if ( ! empty( $yearlink ) ) {
@@ -505,10 +505,10 @@ function get_year_link( $year ) {
function get_month_link( $year, $month ) {
global $wp_rewrite;
if ( ! $year ) {
- $year = gmdate( 'Y', current_time( 'timestamp' ) );
+ $year = current_time( 'Y' );
}
if ( ! $month ) {
- $month = gmdate( 'm', current_time( 'timestamp' ) );
+ $month = current_time( 'm' );
}
$monthlink = $wp_rewrite->get_month_permastruct();
if ( ! empty( $monthlink ) ) {
@@ -546,13 +546,13 @@ function get_month_link( $year, $month ) {
function get_day_link( $year, $month, $day ) {
global $wp_rewrite;
if ( ! $year ) {
- $year = gmdate( 'Y', current_time( 'timestamp' ) );
+ $year = current_time( 'Y' );
}
if ( ! $month ) {
- $month = gmdate( 'm', current_time( 'timestamp' ) );
+ $month = current_time( 'm' );
}
if ( ! $day ) {
- $day = gmdate( 'j', current_time( 'timestamp' ) );
+ $day = current_time( 'j' );
}
$daylink = $wp_rewrite->get_day_permastruct();
diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php
index 620e9c9194..75dab9e09c 100644
--- a/wp-includes/ms-functions.php
+++ b/wp-includes/ms-functions.php
@@ -518,7 +518,7 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name ) );
if ( $signup != null ) {
$registered_at = mysql2date( 'U', $signup->registered );
- $now = current_time( 'timestamp', true );
+ $now = time();
$diff = $now - $registered_at;
// If registered more than two days ago, cancel registration and let this signup go through.
if ( $diff > 2 * DAY_IN_SECONDS ) {
@@ -530,7 +530,7 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email ) );
if ( $signup != null ) {
- $diff = current_time( 'timestamp', true ) - mysql2date( 'U', $signup->registered );
+ $diff = time() - mysql2date( 'U', $signup->registered );
// If registered more than two days ago, cancel registration and let this signup go through.
if ( $diff > 2 * DAY_IN_SECONDS ) {
$wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) );
@@ -688,7 +688,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
// Has someone already signed up for this domain?
$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path ) ); // TODO: Check email too?
if ( ! empty( $signup ) ) {
- $diff = current_time( 'timestamp', true ) - mysql2date( 'U', $signup->registered );
+ $diff = time() - mysql2date( 'U', $signup->registered );
// If registered more than two days ago, cancel registration and let this signup go through.
if ( $diff > 2 * DAY_IN_SECONDS ) {
$wpdb->delete(
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 54e23561d4..c1043d473b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.2-alpha-44808';
+$wp_version = '5.2-alpha-44809';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|