WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 20 months ago

#18083 closed enhancement (fixed)

Enable Post formats in Quick Edit

Reported by: mfields Owned by: duck_
Priority: normal Milestone: 3.3
Component: Quick/Bulk Edit Version:
Severity: normal Keywords: dev-feedback has-patch
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_ 22 months ago.
18083.unsupported-formats.diff (2.1 KB) - added by duck_ 20 months ago.
18083.2.diff (2.2 KB) - added by nacin 20 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 jane22 months 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_22 months ago

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

comment:3 duck_21 months 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.

comment:4 duck_21 months 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".

comment:5 duck_20 months 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 :)

nacin20 months ago

comment:6 nacin20 months 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.

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