Commit 6b4c4c3
committed
Feeds: Address review feedback on get_feed_build_date() empty array fix.
- Replace `! empty( $modified_times )` with truthy check `if ( $modified_times )`,
aligning with the ongoing effort to avoid empty() in new core code.
- Rewrite the test setup to use the real query codepath: self::factory()->post->create()
+ query_posts( [ 'posts__in' => [ $id ], 'fields' => 'ids' ] ). 'fields' => 'ids'
makes WP_Query->posts an array of integer IDs, which causes wp_list_pluck() to
emit _doing_it_wrong and return an empty array naturally — no more manual $wp_query
property mutation.
- Add $this->assertIsString( $result ) to narrow the string|false return type before
it flows into strtotime(), keeping PHPStan happy at higher analysis levels.
Addresses review feedback from @westonruter.
Props westonruter.
See #59956.1 parent c0fe548 commit 6b4c4c3
2 files changed
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | | - | |
57 | | - | |
| 54 | + | |
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
| 60 | + | |
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments