Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15882 closed enhancement (fixed)

Allow a default post format to be specified

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.1 Priority: lowest
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

This is something we are losing with categories. Currently, you can specify "Asides" to be your default category. (Matt does this on ma.tt for example.)

You can't do this with post formats.

Attached is a very simple patch that adds selecting a default to options-writing, and enforces the default. I have omitted the changes required to press-this for this (it's also just one line of code there) as that requires #15795 first.

(Would require a DB bump on commit.)

Attachments (2)

15882.diff (3.3 KB) - added by nacin 13 years ago.
15882.2.diff (1.3 KB) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (9)

@nacin
13 years ago

#1 @nacin
13 years ago

It should be noted that this is enforced at a completely different level than default categories. The default category is enforced all the way down to wp_insert_post.

In this case, this patch would only affect the admin UI. It would not affect XML-RPC, which would need to query the default post format themselves if they wished to leverage that. I think this is okay; mobile and desktop apps might prefer to keep their own default based on the various, usually more-specific use cases of remote publishing clients.

#2 @ryan
13 years ago

Looks good.

#3 @nacin
13 years ago

  • Keywords commit added

#4 @nacin
13 years ago

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

(In [17056]) Allow dfault post format selections. fixes #15882.

#5 @markjaquith
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This implementation doesn't allow you to select the Standard format if you've specified a non-Standard default! That includes for all pre-3.1 posts, as we have no distinction between no format and standard format. You can't go to default every time post format is blank.

Maybe you should hook into post-new.php and set the default there, like we talked about.

@nacin
13 years ago

#6 @nacin
13 years ago

  • Keywords commit removed

Completely forgot how I had first wanted to implement this.

New patch attached.

#7 @markjaquith
13 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [17062]) Only set default post format on new posts – not old ones. props nacin. fixes #15882

Note: See TracTickets for help on using tickets.