[wp-trac] [WordPress Trac] #43009: Create Video/Audio Playlist hooks not working as expected

WordPress Trac noreply at wordpress.org
Thu Apr 12 17:21:52 UTC 2018


#43009: Create Video/Audio Playlist hooks not working as expected
--------------------------+------------------------------
 Reporter:  iforrest      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.9.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  administration
--------------------------+------------------------------

Comment (by birgire):

 @adamsilverstein I think I agree with you.

 In versions before 4.8, the previous "Create Audio Playlist" link was
 displayed if the Media Library contained any audio, else it was hidden.
 Same for videos.

 There we had:

 {{{
 'attachmentCounts' => array(
     'audio' => ( $has_audio ) ? 1 : 0,
     'video' => ( $has_video ) ? 1 : 0
 ),

 }}}

 with {{{$has_audio}}} and {{{$has_video}}} from possible very heavy
 database queries.


 So looking at ticket #31071 again, I think the intention there wasn't to
 change the original behavior of the "Create Audio Playlist" links. i.e. to
 hide it in the absence of audios (videos).

 In hindsight I think the previous {{{$has_audio}}} and {{{$has_video}}}
 naming was more clear,
 compared to the changes in 4.8:

 {{{
 'attachmentCounts' => array(
         'audio' => ( $show_audio_playlist ) ? 1 : 0,
         'video' => ( $show_video_playlist ) ? 1 : 0,
 ),

 }}}

 I noticed that if we delete the last audio/video then the create playlist
 menu items are not hidden.

 Maybe there's a way to check {{{this.counts[ attr ].count < 1}}} on
 audio/video delete and if so, hide the menu item with
 {{{this.menuItemVisibility( this.counts[ attr ].state, 'hide' );}}}

 Would that be consistent with the display of the create playlist menu
 items, when the first audio/video are uploaded?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43009#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list