WordPress.org

Make WordPress Core

#24116 closed task (blessed) (invalid)

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

Reported by: markjaquith Owned by: 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 15 months ago.
24116.2.diff (690 bytes) - added by wonderboymusic 15 months ago.
24116.3.diff (529 bytes) - added by kovshenin 15 months ago.
24116.4.diff (1.5 KB) - added by kovshenin 15 months ago.

Download all attachments as: .zip

Change History (17)

wonderboymusic15 months ago

comment:1 wonderboymusic15 months ago

  • Keywords has-patch added

wonderboymusic15 months ago

kovshenin15 months ago

comment:2 kovshenin15 months 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.

comment:3 SergeyBiryukov15 months ago

  • Keywords commit added

24116.3.diff looks good to me.

comment:4 follow-up: nacin15 months 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.

comment:5 in reply to: ↑ 4 ; follow-up: kovshenin15 months 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.

comment:6 in reply to: ↑ 5 nacin15 months 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).

comment:7 nacin15 months ago

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

comment:8 nacin15 months ago

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

kovshenin15 months ago

comment:9 kovshenin15 months 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

comment:10 markjaquith15 months 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.

comment:11 nacin12 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:12 nacin12 months ago

In 24692:

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

comment:13 nacin12 months ago

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