[wp-trac] [WordPress Trac] #16759: $page is always set

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 20 20:37:24 UTC 2012


#16759: $page is always set
-------------------------------------+-------------------------
 Reporter:  hakre                    |       Owner:
     Type:  defect (bug)             |      Status:  closed
 Priority:  lowest                   |   Milestone:  Unassigned
Component:  AtomPub                  |     Version:  3.0
 Severity:  trivial                  |  Resolution:  invalid
 Keywords:  has-patch needs-refresh  |
-------------------------------------+-------------------------
Changes (by bpetty):

 * cc: bpetty (added)
 * keywords:  has-patch => has-patch needs-refresh
 * status:  new => closed
 * component:  General => AtomPub
 * resolution:   => invalid


Comment:

 There's not really any way to guarantee that $page isn't passed as `null`
 when calling `wp_atom_server::get_feed()`. While I can't immediately see
 any location where it's called that won't result in $page not being set to
 `null`, this single extra check is only run once on any single request, so
 it's not a performance issue. I'm sure the check was added in there for a
 good reason originally, so it's really not worth removing it now and
 possibly breaking something without realizing it.

 I do know that it is possible that a plugin is calling
 `wp_atom_server::get_feed()` with page passed as `null`, and that if a
 plugin wanted to specify a custom post type while relying on the default
 page specified in WP core, they would absolutely be required to pass
 `null`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16759#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list