[wp-trac] [WordPress Trac] #35603: Allow `wp_count_posts()` on multisite after switching sites
WordPress Trac
noreply at wordpress.org
Tue Feb 2 03:10:28 UTC 2016
#35603: Allow `wp_count_posts()` on multisite after switching sites
----------------------------------------+------------------------------
Reporter: flixos90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: multisite
----------------------------------------+------------------------------
Comment (by dd32):
FWIW, I'm not sure we should support this (even if we technically can) as
it introduced an inconsistency in the CPT API.
We end up with a situation where some functions work without the post type
registered, whereas others don't.
Many other API's could also technically support querying without
registration, including `WP_Query`, however when a CPT becomes more
complex than a simple copy of the `post` format such as having plugin
conditionals on queries, altering SQL, adding permission checks, etc we
get to a position where we currently are - if the plugin which registers
the CPT isn't active, we effectively can't be sure that the functions will
handle the same.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35603#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list