diff --git a/src/js/_enqueues/admin/inline-edit-post.js b/src/js/_enqueues/admin/inline-edit-post.js index 9d6f66c3b0034..5963a2211e6fd 100644 --- a/src/js/_enqueues/admin/inline-edit-post.js +++ b/src/js/_enqueues/admin/inline-edit-post.js @@ -250,7 +250,7 @@ window.wp = window.wp || {}; if ( ! $( this ).parent().find( 'input[name="indeterminate_post_category[]"]' ).length ) { // Get the term label text. var label = $( this ).parent().text(); - // Set indeterminate states for the backend. Add accessible text for indeterminate inputs. + // Set indeterminate states for the backend. Add accessible text for indeterminate inputs. $( this ).after( '' ).attr( 'aria-label', label.trim() + ': ' + wp.i18n.__( 'Some selected posts have this category' ) ); } } @@ -603,9 +603,9 @@ $( function() { inlineEditPost.init(); } ); // Show/hide locks on posts. $( function() { - // Set the heartbeat interval to 15 seconds. + // Set the heartbeat interval to 10 seconds. if ( typeof wp !== 'undefined' && wp.heartbeat ) { - wp.heartbeat.interval( 15 ); + wp.heartbeat.interval( 10 ); } }).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) { var locked = data['wp-check-locked-posts'] || {}; diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js index 557465bb2794e..e0b4f117dc9f0 100644 --- a/src/js/_enqueues/admin/post.js +++ b/src/js/_enqueues/admin/post.js @@ -343,9 +343,9 @@ jQuery( function($) { } }).filter(':visible').find('.wp-tab-first').trigger( 'focus' ); - // Set the heartbeat interval to 15 seconds if post lock dialogs are enabled. + // Set the heartbeat interval to 10 seconds if post lock dialogs are enabled. if ( wp.heartbeat && $('#post-lock-dialog').length ) { - wp.heartbeat.interval( 15 ); + wp.heartbeat.interval( 10 ); } // The form is being submitted by the user. diff --git a/src/js/_enqueues/wp/heartbeat.js b/src/js/_enqueues/wp/heartbeat.js index f3a92b0a1f78e..65635177d9f66 100644 --- a/src/js/_enqueues/wp/heartbeat.js +++ b/src/js/_enqueues/wp/heartbeat.js @@ -132,16 +132,17 @@ } /* - * The interval can be from 15 to 120 seconds and can be set temporarily to 5 seconds. - * It can be set in the initial options or changed later through JS and/or through PHP. + * Logic check: the interval can be from 1 to 3600 seconds and can be set temporarily + * to 5 seconds. It can be set in the initial options or changed later from JS + * or from PHP through the AJAX responses. */ if ( options.interval ) { settings.mainInterval = options.interval; - if ( settings.mainInterval < 15 ) { - settings.mainInterval = 15; - } else if ( settings.mainInterval > 120 ) { - settings.mainInterval = 120; + if ( settings.mainInterval < 1 ) { + settings.mainInterval = 1; + } else if ( settings.mainInterval > 3600 ) { + settings.mainInterval = 3600; } } @@ -721,10 +722,10 @@ * * @memberOf wp.heartbeat.prototype * - * @param {string|number} speed Interval: 'fast' or 5, 15, 30, 60, 120. + * @param {string|number} speed Interval: 'fast' or integer between 1 and 3600 (seconds). * Fast equals 5. - * @param {string} ticks Tells how many ticks before the interval reverts - * back. Used with speed = 'fast' or 5. + * @param {number} ticks Tells how many ticks before the interval reverts back. + * Value must be between 1 and 30. Used with speed = 'fast' or 5. * * @return {number} Current interval in seconds. */ @@ -733,35 +734,28 @@ oldInterval = settings.tempInterval ? settings.tempInterval : settings.mainInterval; if ( speed ) { - switch ( speed ) { - case 'fast': - case 5: - newInterval = 5000; - break; - case 15: - newInterval = 15000; - break; - case 30: - newInterval = 30000; - break; - case 60: - newInterval = 60000; - break; - case 120: - newInterval = 120000; - break; - case 'long-polling': - // Allow long polling (experimental). - settings.mainInterval = 0; - return 0; - default: + if ( 'fast' === speed ) { + // Special case, see below. + newInterval = 5000; + } else if ( 'long-polling' === speed ) { + // Allow long polling (experimental). + settings.mainInterval = 0; + return 0; + } else { + speed = parseInt( speed, 10 ); + + if ( speed >= 1 && speed <= 3600 ) { + newInterval = speed * 1000; + } else { newInterval = settings.originalInterval; + } } if ( settings.minimalInterval && newInterval < settings.minimalInterval ) { newInterval = settings.minimalInterval; } + // Special case, runs for a number of ticks then reverts to the previous interval. if ( 5000 === newInterval ) { ticks = parseInt( ticks, 10 ) || 30; ticks = ticks < 1 || ticks > 30 ? 30 : ticks; diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 17d9493161386..287f2ee7b4958 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -1180,6 +1180,17 @@ th.action-links { overflow: hidden; } +.wp-filter .favorites-form .favorites-username { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.5rem; +} + +.wp-filter .favorites-form .favorites-username input { + margin: 0; +} + .show-filters .filter-drawer, .show-favorites-form .favorites-form { display: block; @@ -1288,11 +1299,13 @@ th.action-links { } .filtered-by .tags { - display: inline; + display: flex; + align-items: flex-start; + flex-wrap: wrap; + gap: 8px; } .filtered-by .tag { - margin: 0 5px; padding: 4px 8px; border: 1px solid #dcdcde; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); @@ -1307,7 +1320,10 @@ th.action-links { } .filters-applied .filtered-by { - display: block; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 10px; } .filters-applied .filter-drawer { diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 91e4b1e37df62..e6abe9998028f 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -123,6 +123,14 @@ static function ( $classes ) { 'before' ); +// Set Heartbeat interval to 10 seconds, used to refresh post locks. +wp_add_inline_script( + 'heartbeat', + 'if ( window.wp && window.wp.heartbeat ) { + window.wp.heartbeat.interval( 10 ); + }' +); + /* * Get all available templates for the post/page attributes meta-box. * The "Default template" array element should only be added if the array is diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 1cebf3405f117..bfd962d4fdb1c 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -230,7 +230,7 @@ ?>
-+
diff --git a/src/wp-includes/block-patterns.php b/src/wp-includes/block-patterns.php
index d672ffd900d15..851898d006a98 100644
--- a/src/wp-includes/block-patterns.php
+++ b/src/wp-includes/block-patterns.php
@@ -26,7 +26,6 @@ function _register_core_block_patterns_and_categories() {
'query-grid-posts',
'query-large-title-posts',
'query-offset-posts',
- 'social-links-shared-background-color',
);
foreach ( $core_block_patterns as $core_block_pattern ) {
diff --git a/src/wp-includes/block-patterns/social-links-shared-background-color.php b/src/wp-includes/block-patterns/social-links-shared-background-color.php
index 2ed16071b733d..37aac3f4e4eb9 100644
--- a/src/wp-includes/block-patterns/social-links-shared-background-color.php
+++ b/src/wp-includes/block-patterns/social-links-shared-background-color.php
@@ -3,6 +3,8 @@
* Social links with a shared background color.
*
* @package WordPress
+ * @since 5.8.0
+ * @deprecated 6.7.0 This pattern is deprecated. Please use the Social Links block instead.
*/
return array(
diff --git a/src/wp-includes/class-wp-network.php b/src/wp-includes/class-wp-network.php
index d835765c6bd05..5bb745d79633b 100644
--- a/src/wp-includes/class-wp-network.php
+++ b/src/wp-includes/class-wp-network.php
@@ -131,7 +131,7 @@ public static function get_instance( $network_id ) {
*/
public function __construct( $network ) {
foreach ( get_object_vars( $network ) as $key => $value ) {
- $this->$key = $value;
+ $this->__set( $key, $value );
}
$this->_set_site_name();
diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php
index eaaf2e77a5115..93b25a8dc89c4 100644
--- a/src/wp-includes/html-api/class-wp-html-processor.php
+++ b/src/wp-includes/html-api/class-wp-html-processor.php
@@ -4943,7 +4943,7 @@ private function step_in_foreign_content(): bool {
$this->state->stack_of_open_elements->pop();
}
- return $this->step( self::REPROCESS_CURRENT_NODE );
+ goto in_foreign_content_process_in_current_insertion_mode;
}
/*
@@ -5019,6 +5019,7 @@ private function step_in_foreign_content(): bool {
goto in_foreign_content_end_tag_loop;
}
+ in_foreign_content_process_in_current_insertion_mode:
switch ( $this->state->insertion_mode ) {
case WP_HTML_Processor_State::INSERTION_MODE_INITIAL:
return $this->step_initial();
@@ -5169,17 +5170,13 @@ public function get_tag(): ?string {
$tag_name = parent::get_tag();
- switch ( $tag_name ) {
- case 'IMAGE':
- /*
- * > A start tag whose tag name is "image"
- * > Change the token's tag name to "img" and reprocess it. (Don't ask.)
- */
- return 'IMG';
-
- default:
- return $tag_name;
- }
+ /*
+ * > A start tag whose tag name is "image"
+ * > Change the token's tag name to "img" and reprocess it. (Don't ask.)
+ */
+ return ( 'IMAGE' === $tag_name && 'html' === $this->get_namespace() )
+ ? 'IMG'
+ : $tag_name;
}
/**
diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php
index 4cfc47f83ec05..08320dc792f4d 100644
--- a/src/wp-includes/link-template.php
+++ b/src/wp-includes/link-template.php
@@ -1618,14 +1618,18 @@ function get_edit_comment_link( $comment_id = 0, $context = 'display' ) {
$location = admin_url( $action ) . $comment->comment_ID;
+ // Ensure the $comment_id variable passed to the filter is always an ID.
+ $comment_id = (int) $comment->comment_ID;
+
/**
* Filters the comment edit link.
*
+ * @since 2.3.0
* @since 6.7.0 The $comment_id and $context parameters are now being passed to the filter.
*
- * @param string $location The edit link.
- * @param int $comment_id Optional. Unique ID of the comment to generate an edit link.
- * @param int $context Optional. Context to include HTML entities in link. Default 'display'.
+ * @param string $location The edit link.
+ * @param int $comment_id Unique ID of the comment to generate an edit link.
+ * @param string $context Context to include HTML entities in link. Default 'display'.
*/
return apply_filters( 'get_edit_comment_link', $location, $comment_id, $context );
}
diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php
index 32838b135dd34..6f6dd928e0498 100644
--- a/src/wp-includes/meta.php
+++ b/src/wp-includes/meta.php
@@ -1369,6 +1369,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype =
* @since 5.3.0 Valid meta types expanded to include "array" and "object".
* @since 5.5.0 The `$default` argument was added to the arguments array.
* @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array.
+ * @since 6.7.0 The `label` argument was added to the arguments array.
*
* @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
* or any other object type with an associated meta table.
@@ -1380,6 +1381,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype =
* the meta key will be registered on the entire object type. Default empty.
* @type string $type The type of data associated with this meta key.
* Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'.
+ * @type string $label A human-readable label of the data attached to this meta key.
* @type string $description A description of the data attached to this meta key.
* @type bool $single Whether the meta key has one value per object, or an array of values per object.
* @type mixed $default The default value returned from get_metadata() if no value has been set yet.
@@ -1412,6 +1414,7 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) {
$defaults = array(
'object_subtype' => '',
'type' => 'string',
+ 'label' => '',
'description' => '',
'default' => '',
'single' => false,
diff --git a/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
index 5f3b55843e23a..aa0bc644bc1ce 100644
--- a/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
+++ b/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
@@ -478,6 +478,7 @@ protected function get_registered_fields() {
$default_schema = array(
'type' => $default_args['type'],
+ 'title' => empty( $args['label'] ) ? '' : $args['label'],
'description' => empty( $args['description'] ) ? '' : $args['description'],
'default' => isset( $args['default'] ) ? $args['default'] : null,
);
diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php
index c623b248b9308..79ed9cd5743c8 100644
--- a/src/wp-includes/update.php
+++ b/src/wp-includes/update.php
@@ -115,24 +115,26 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
// Filter to supported values.
$gd_info = array_filter( $gd_info );
- // Add data for GD WebP and AVIF support.
+ // Add data for GD WebP, AVIF and HEIC support.
$query['image_support']['gd'] = array_keys(
array_filter(
array(
'webp' => isset( $gd_info['WebP Support'] ),
'avif' => isset( $gd_info['AVIF Support'] ),
+ 'heic' => isset( $gd_info['HEIC Support'] ),
)
)
);
}
if ( class_exists( 'Imagick' ) ) {
- // Add data for Imagick WebP and AVIF support.
+ // Add data for Imagick WebP, AVIF and HEIC support.
$query['image_support']['imagick'] = array_keys(
array_filter(
array(
'webp' => ! empty( Imagick::queryFormats( 'WEBP' ) ),
'avif' => ! empty( Imagick::queryFormats( 'AVIF' ) ),
+ 'heic' => ! empty( Imagick::queryFormats( 'HEIC' ) ),
)
)
);
diff --git a/tests/phpunit/tests/canonical.php b/tests/phpunit/tests/canonical.php
index b83e9563d1fa0..886b09312910e 100644
--- a/tests/phpunit/tests/canonical.php
+++ b/tests/phpunit/tests/canonical.php
@@ -430,10 +430,11 @@ public function test_utf8_query_keys_canonical() {
$this->go_to( get_permalink( $p ) );
- $url = redirect_canonical( add_query_arg( '%D0%BA%D0%BE%D0%BA%D0%BE%D0%BA%D0%BE', 1, site_url( '/' ) ), false );
- $this->assertNull( $url );
+ $redirect = redirect_canonical( add_query_arg( '%D0%BA%D0%BE%D0%BA%D0%BE%D0%BA%D0%BE', 1, site_url( '/' ) ), false );
delete_option( 'page_on_front' );
+
+ $this->assertNull( $redirect );
}
/**
@@ -456,11 +457,12 @@ public function test_feed_canonical_with_not_exists_query() {
)
);
- $url = redirect_canonical( get_term_feed_link( self::$terms['/category/parent/'] ), false );
+ $redirect = redirect_canonical( get_term_feed_link( self::$terms['/category/parent/'] ), false );
+
// Restore original global.
$GLOBALS['wp_query'] = $global_query;
- $this->assertNull( $url );
+ $this->assertNull( $redirect );
}
/**
diff --git a/tests/phpunit/tests/canonical/https.php b/tests/phpunit/tests/canonical/https.php
index 4b02f087651f2..11152e8d3c30e 100644
--- a/tests/phpunit/tests/canonical/https.php
+++ b/tests/phpunit/tests/canonical/https.php
@@ -61,8 +61,8 @@ public function test_https_request_with_https_home() {
$redirect = redirect_canonical( $this->https, false );
- $this->assertNull( $redirect );
-
remove_filter( 'home_url', array( $this, 'set_https' ) );
+
+ $this->assertNull( $redirect );
}
}
diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessor.php b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
index 17dd2ff7fbd68..bd6607935d220 100644
--- a/tests/phpunit/tests/html-api/wpHtmlProcessor.php
+++ b/tests/phpunit/tests/html-api/wpHtmlProcessor.php
@@ -54,6 +54,57 @@ public function test_get_tag_is_null_once_document_is_finished() {
$this->assertNull( $processor->get_tag() );
}
+ /**
+ * Ensures that the proper tag-name remapping happens for the `IMAGE` tag.
+ *
+ * An HTML parser should treat an IMAGE tag as if it were an IMG tag, but
+ * only when found in the HTML namespace. As part of this rule, IMAGE tags
+ * in the HTML namespace are also void elements, while those in foreign
+ * content are not, making the self-closing flag significant.
+ *
+ * Example:
+ *
+ * // This input...
+ *