[wp-trac] [WordPress Trac] #46641: Add site_id to WP_Post object (was: Add blog_id to post object)
WordPress Trac
noreply at wordpress.org
Wed Oct 26 13:50:49 UTC 2022
#46641: Add site_id to WP_Post object
--------------------------------+------------------------------
Reporter: Spidlace | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 5.1
Severity: normal | Resolution:
Keywords: | Focuses: multisite
--------------------------------+------------------------------
Old description:
> Hi,
>
> I work on a multisite, where each website can get all posts (from one
> post type or not).
> It seem interesting to add new line in object response (get_post() for
> example) : "blog_id" (where blog_id is an int)
>
> - blog_id is 1 per default (if no multisite)
>
> {{{
> WP_Post Object
> (
> [ID] =>
> [post_author] =>
> [post_date] =>
> [post_date_gmt] =>
> [post_content] =>
> [post_title] =>
> [post_excerpt] =>
> [post_status] =>
> [comment_status] =>
> [ping_status] =>
> [post_password] =>
> [post_name] =>
> [to_ping] =>
> [pinged] =>
> [post_modified] =>
> [post_modified_gmt] =>
> [post_content_filtered] =>
> [post_parent] =>
> [guid] =>
> [menu_order] =>
> [post_type] =>
> [post_mime_type] =>
> [comment_count] =>
> [filter] =>
> [blog_id] =>
> )
> }}}
>
> If this feature is good for some people, I can make this change and
> submit here
New description:
Hi,
I work on a multisite, where each website can get all posts (from one post
type or not).
It seem interesting to add new line in object response (get_post() for
example) : "site_id" (where site_id is an int)
- site_id is 1 per default (if no multisite)
{{{
WP_Post Object
(
[ID] =>
[post_author] =>
[post_date] =>
[post_date_gmt] =>
[post_content] =>
[post_title] =>
[post_excerpt] =>
[post_status] =>
[comment_status] =>
[ping_status] =>
[post_password] =>
[post_name] =>
[to_ping] =>
[pinged] =>
[post_modified] =>
[post_modified_gmt] =>
[post_content_filtered] =>
[post_parent] =>
[guid] =>
[menu_order] =>
[post_type] =>
[post_mime_type] =>
[comment_count] =>
[filter] =>
[site_id] =>
)
}}}
If this feature is good for some people, I can make this change and submit
here
--
Comment (by SergeyBiryukov):
Renaming the ticket per comment:3.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46641#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list