Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#24116 closed task (blessed) (invalid)

Set post format when arriving to post-new.php?format={post_format}

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Post Formats Keywords: has-patch commit
Focuses: Cc:

Description

So that we (or others) can jump-start people into a specific post format, we should respect format in a query arg for post-new.php.

Attachments (4)

24116.diff (541 bytes) - added by wonderboymusic 12 years ago.
24116.2.diff (690 bytes) - added by wonderboymusic 12 years ago.
24116.3.diff (529 bytes) - added by kovshenin 12 years ago.
24116.4.diff (1.5 KB) - added by kovshenin 12 years ago.

Download all attachments as: .zip

Change History (17)

#1 @wonderboymusic
12 years ago

  • Keywords has-patch added

@kovshenin
12 years ago

#2 @kovshenin
12 years ago

I always found it irritating when I put something in the query string, and then WordPress unsets it somewhere along the way, so it never reaches my plugin. We don't do that in get_default_post_to_edit and I don't think we should do it for post formats either.

Also, format sounds too generic, I think we should use post_format, like we do with post_type.

24116.3.diff addresses the above.

#3 @SergeyBiryukov
12 years ago

  • Keywords commit added

24116.3.diff looks good to me.

#4 follow-up: @nacin
12 years ago

I agree with not unsetting items from superglobals. Sometimes we do it to avoid clashes with the WP class, though.

I'd prefer 'format' over 'post_format'. 'post_format' (and, yes, 'post_type') are crufty. Why not go simple when we have the chance?

This must also only apply (I can't tell looking at just the patch) when the post type supports post formats.

#5 in reply to: ↑ 4 ; follow-up: @kovshenin
12 years ago

I don't think it matters all that much in the URL, but we already use post_format as a query var in edit.php and on the front end, and the taxonomy is also called post_format. Not sure it's really worth stepping away from the convention, for the little benefit that it would bring to this single URL.

This must also only apply when the post type supports post formats.

It does.

#6 in reply to: ↑ 5 @nacin
12 years ago

Replying to kovshenin:

I don't think it matters all that much in the URL, but we already use post_format as a query var in edit.php and on the front end, and the taxonomy is also called post_format. Not sure it's really worth stepping away from the convention, for the little benefit that it would bring to this single URL.

This isn't a query variable we link to; this is a shortcut for jumpstarting a post. The precedent is ?content=&excerpt= (though, oddly, post_title).

#7 @nacin
12 years ago

Should this also only work on post-new.php? Seems like it should be inside the auto-draft branch below it.

#8 @nacin
12 years ago

And what should happen to $post_format_set_class if ?format is provided? So maybe that's an else.

@kovshenin
12 years ago

#9 @kovshenin
12 years ago

In 24116.4.diff:

  • Back to using ?format vs ?post_format
  • Correct handling of $post_format_set_class
  • Set correct screen icon with ?format

#10 @markjaquith
12 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 24081:

post-new.php?format=X will pre-fill the format, to allow for Post-Format-chosen-first editor jump-starting.

props kovshenin, wonderboymusic. fixes #24116.

#11 @nacin
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#12 @nacin
12 years ago

In 24692:

Revert ?format= on post.php. see #24116.

#13 @nacin
12 years ago

  • Milestone 3.6 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.