WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#18083 closed enhancement (fixed)

Enable Post formats in Quick Edit

Reported by: mfields Owned by: duck_
Milestone: 3.3 Priority: normal
Severity: normal Version:
Component: Quick/Bulk Edit Keywords: dev-feedback has-patch
Focuses: Cc:

Description

I think that it would be great to be able to modify a post's format via bulk/quick edit. It appears that there is room for a select box under "Post Status".

Attachments (3)

18083.diff (3.9 KB) - added by duck_ 9 years ago.
18083.unsupported-formats.diff (2.1 KB) - added by duck_ 9 years ago.
18083.2.diff (2.2 KB) - added by nacin 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 @jane
9 years ago

  • Keywords needs-patch added; ui-feedback removed
  • Milestone changed from Awaiting Review to 3.3

Fine with this addition to Quick Edit. Needs patch. If someone does it within the next week I see no reason not to include in 3.3.

@duck_
9 years ago

#2 @duck_
9 years ago

  • Keywords has-patch added; needs-patch removed

Quick stab at a first patch attached. I [and anybody else who wants to] need to review it again later.

#3 @duck_
9 years ago

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

In [18722]:

Add post formats to quick edit and bulk edit. Fixes #18083.

#4 @duck_
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The issue of what to do about posts with a format that is not supported by the current theme returns. See #15393.

Fixing this has to be done in Javascript, like it's done for authors who no longer have edit caps [12046], for example:

if ( !$(':input[name="post_format"] option[value="' + $('.post_format', rowData).text() + '"]', editRow).val() ) {
    // post format not supported by current theme, so we need to add it back to the list of formats
    $(':input[name="post_format"]', editRow).append('<option value="' + $('.post_format', rowData).text() + '">' + $('.post_format', rowData).text() + '</option>');
}

Unfortunately the display string isn't available so this would show "chat", for example, in the select box instead of "Chat".

#5 @duck_
9 years ago

18083.unsupported-formats.diff following suggestion by nacin: "What if we added all post format strings (supported or not) to the select box, then hide them dynamically if they're A) not supported and B) not the current one?"

Needs a bit of clean up and testing when I'm not as tired :)

@nacin
9 years ago

#6 @nacin
9 years ago

18083.2.diff uses .remove() instead of .hide(), which doesn't work on option elements on Chrome and possibly other browsers. Since we clone the edit row and then modify that, this will work for multiple quick edits on the page. Patch also removes the id on the select, as it would introduce duplicate ids. We don't use the id in the JS so we're good there.

#7 @duck_
9 years ago

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

In [19011]:

Show the current post format in quick edit even if it's not supported. Props nacin, fixes #18083.

Note: See TracTickets for help on using tickets.