[wp-trac] [WordPress Trac] #39022: Invalid query parameters in `WP_Customize_Manager`

WordPress Trac noreply at wordpress.org
Fri Dec 2 03:16:01 UTC 2016


#39022: Invalid query parameters in `WP_Customize_Manager`
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 `WP_Customize_Manager` passes the `number` parameter to some `WP_Query`
 instances, but, as far as I can tell, `WP_Query` doesn't accept `number`.

 For instance, in trunk running Twenty Seventeen, after this query:
 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-
 customize-manager.php#L1015

 The value of `$existing_posts_query->request` is: `"SELECT
 SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND
 wp_posts.post_name IN [...] ORDER BY wp_posts.post_date DESC LIMIT 0, 10"`

 I assume the `LIMIT` wasn't supposed to be there, so the attached patch
 would replace `number` with `posts_per_page`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39022>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list