Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15882 closed enhancement (fixed)

Allow a default post format to be specified

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


This is something we are losing with categories. Currently, you can specify "Asides" to be your default category. (Matt does this on 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 11 years ago.
15882.2.diff (1.3 KB) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (9)

11 years ago

#1 @nacin
11 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
11 years ago

Looks good.

#3 @nacin
11 years ago

  • Keywords commit added

#4 @nacin
11 years ago

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

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

#5 @markjaquith
11 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.

11 years ago

#6 @nacin
11 years ago

  • Keywords commit removed

Completely forgot how I had first wanted to implement this.

New patch attached.

#7 @markjaquith
11 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.