Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#2363 closed defect (bug) (invalid)

Better access for generic post_status = object and arbitrary post_type

Reported by: mdawaffe Owned by: mdawaffe
Milestone: Priority: normal
Severity: normal Version: 2.0
Component: General Keywords: post_status post_type object WP_Query bg|2nd-opinion bg|has-patch
Focuses: Cc:


Currently WP_Query makes accessing and cotrolling access to post_status = object posts difficult.

Additionally, wp_insert_post() has no access to the useful post_type field.

The following patch addresses both issues, but needs a second opinion.

$is_dingus is the boolean used to determine if the query in question is one associated with a post_status = object post. $is_object was avoided due to the native PHP function is_object().

Attachments (1)

objects.diff (7.0 KB) - added by mdawaffe 15 years ago.
changes to classes.php and functions-post.php

Download all attachments as: .zip

Change History (6)

15 years ago

changes to classes.php and functions-post.php

#1 @ryan
15 years ago

What's an "object"? I think the post_type should be more specific. It should be "post", "page", "attachment", ...

#2 @mdawaffe
15 years ago

I've been using post_status = object, post_type = mb_bit for a plugin I'm playing with that attempts to be somewhat http://backpackit.com/ ish.

The "posts" I'm creating aren't posts or pages or attachments; they're just... generic things. Even though WP allows for the creation of such items, it's not fantastic at accessing them (it can sure be done, though, with some post_where manipulation).

In thinking more, this is really two separate issues. WP_Query accessing objects and wp_insert_post() handling post_type. The fact I want both doesn't mean I should have filed them as the same ticket :)

#3 @mdawaffe
15 years ago

I've been on slient running for a few months and didn't see your comment on hackers.


I'm in.

I might close this ticket and start something more meaningful.

#4 @mdawaffe
15 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#5 @Nazgul
14 years ago

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.