[wp-trac] [WordPress Trac] #56948: (WordPress 6.1) Trying to access array offset on value of type int in wp-includes/class-wp-list-util.php on line 170

WordPress Trac noreply at wordpress.org
Wed Nov 2 16:44:28 UTC 2022


#56948: (WordPress 6.1) Trying to access array offset on value of type int in wp-
includes/class-wp-list-util.php on line 170
--------------------------+---------------------
 Reporter:  konyoldeath   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.1.1
Component:  Query         |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by TimothyBlynJacobs):

 > At a guess, prior to priming the user cache in WP_Query::the_post()
 there will need to be a check for WP_Post objects, similar to that used in
 WP_Query::setup_postdata().

 I think that action makes sense to me as well. We could probably run an
 `array_map( 'get_post', $posts )` since the post IDs will need to be
 transformed into full `WP_Post` objects anyways by `::setup_postdata`.

 I think we should consider firing a `_doing_it_wrong` when using a
 `WP_Query` with `fields` set to `ids` ''and'' using the loop methods since
 those require fetching a post which defeats any performance optimization
 of making an `ids` query.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56948#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list