[wp-trac] [WordPress Trac] #26631: Add a "playlist" shortcode
WordPress Trac
noreply at wordpress.org
Sun Mar 2 04:43:40 UTC 2014
#26631: Add a "playlist" shortcode
------------------------------------------------------+------------------
Reporter: wonderboymusic | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 3.9
Component: Media | Version:
Severity: normal | Resolution:
Keywords: needs-testing has-patch needs-unit-tests | Focuses:
------------------------------------------------------+------------------
Comment (by gcorne):
I worked up a few patches that adjust the code a bit and make one small
visual change.
[attachment:26631.14.patch 26631.14.patch] adds some braces to a couple
if/else statements to make jshint happy.
[attachment:26631.15.patch 26631.15.patch] refactors {{{CollectionEdit}}}
and {{{CollectionAdd}}}.
* Instead of generating new constructors use the {{{initialize}}} method
to set attributes based on the {{{collectionType}}}
* Use the reference to the {{{SettingsView}}} instead of grabbing it from
the namespace. This better matches with existing {{{AttachmentDisplay}}}
attribute.
* Switch from using {{{tag}}} to {{{collectionType}}} to better
communicate the purpose of the attribute.
* Make the design of the {{{CollectionEdit}}} and {{{CollectionAdd}}}
consistent with one another
The refactoring cuts down the lines of code by about 20 lines and also in
my opinion makes the code a little easier to follow. I am curious to know
whether or not others agree.
One small concern I have about this change is that it removes the
{{{GalleryEdit}}} and {{{GalleryAdd}}} constructors, which a plugin may be
manipulating. A search of the .org plugin repository didn't return any
results so removing them is probably not a big deal.
[attachment:26631.16.patch 26631.16.patch] adjusts the priority of the
separator in the Edit Playlist and Edit Video Playlist menus to match the
structure of the Edit Gallery menu.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26631#comment:51>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list