wp/wp-admin/js/inline-edit-post.js
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-admin/js/inline-edit-post.js	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-admin/js/inline-edit-post.js	Fri Sep 05 18:52:52 2025 +0200
@@ -128,8 +128,16 @@
 			inlineEditPost.edit( this );
 		});
 
+		// Clone quick edit categories for the bulk editor.
+		var beCategories = $( '#inline-edit fieldset.inline-edit-categories' ).clone();
+
+		// Make "id" attributes globally unique.
+		beCategories.find( '*[id]' ).each( function() {
+			this.id = 'bulk-edit-' + this.id;
+		});
+
 		$('#bulk-edit').find('fieldset:first').after(
-			$('#inline-edit fieldset.inline-edit-categories').clone()
+			beCategories
 		).siblings( 'fieldset:last' ).prepend(
 			$( '#inline-edit .inline-edit-tags-wrap' ).clone()
 		);
@@ -140,7 +148,12 @@
 		 * Adds onclick events to the apply buttons.
 		 */
 		$('#doaction').on( 'click', function(e){
-			var n;
+			var n,
+				$itemsSelected = $( '#posts-filter .check-column input[type="checkbox"]:checked' );
+
+			if ( $itemsSelected.length < 1 ) {
+				return;
+			}
 
 			t.whichBulkButtonId = $( this ).attr( 'id' );
 			n = t.whichBulkButtonId.substr( 2 );
@@ -242,7 +255,7 @@
 				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( '<input type="hidden" name="indeterminate_post_category[]" value="' + $( this ).val() + '">' ).attr( 'aria-label', label.trim() + ': ' + wp.i18n.__( 'Some selected posts have this category' ) );
 				}
 			}
@@ -595,9 +608,9 @@
 // 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'] || {};