Changeset 61183
- Timestamp:
- 11/07/2025 06:54:51 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-admin/includes/class-wp-comments-list-table.php (modified) (1 diff)
-
tests/phpunit/tests/admin/wpCommentsListTable.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r61105 r61183 100 100 } 101 101 102 $comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : ''; 102 $comment_type = ''; 103 104 if ( ! empty( $_REQUEST['comment_type'] ) && 'note' !== $_REQUEST['comment_type'] ) { 105 $comment_type = $_REQUEST['comment_type']; 106 } 103 107 104 108 $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : ''; -
trunk/tests/phpunit/tests/admin/wpCommentsListTable.php
r58097 r61183 214 214 $this->assertSame( $expected, $this->table->get_views() ); 215 215 } 216 217 /** 218 * Verify that the comments table never shows the note comment_type. 219 * 220 * @ticket 64198 221 */ 222 public function test_comments_list_table_does_not_show_note_comment_type() { 223 $post_id = self::factory()->post->create(); 224 $note_id = self::factory()->comment->create( 225 array( 226 'comment_post_ID' => $post_id, 227 'comment_content' => 'This is a note.', 228 'comment_type' => 'note', 229 'comment_approved' => '1', 230 ) 231 ); 232 $comment_id = self::factory()->comment->create( 233 array( 234 'comment_post_ID' => $post_id, 235 'comment_content' => 'This is a regular comment.', 236 'comment_type' => '', 237 'comment_approved' => '1', 238 ) 239 ); 240 // Request the note comment type. 241 $_REQUEST['comment_type'] = 'note'; 242 $this->table->prepare_items(); 243 $items = $this->table->items; 244 $this->assertCount( 1, $items ); 245 $this->assertEquals( $comment_id, $items[0]->comment_ID ); 246 } 216 247 }
Note: See TracChangeset
for help on using the changeset viewer.