WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 11 months ago

#36293 new defect (bug)

video/audio object passed to wp_video_shortcode/wp_audio_shortcode is always null

Reported by: gnotaras Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: docs Cc:

Description

Hi,

The following:

apply_filters( 'wp_video_shortcode', $output, $atts, $video, $post_id, $library );

apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );

send the $video and $audio objects respectively to the filtering function.

However, these objects seem to be always null.

By checking the relevant code I notice that these objects are only set when the $primary variable is set to false. The code does not clarify why the audio/video object is bound to that variable. Perhaps someone more familiar with the logic behind these functions should check this please.

Change History (2)

This ticket was mentioned in Slack in #core by noisysocks. View the logs.


11 months ago

#2 @talldanwp
11 months ago

  • Component changed from General to Media
  • Focuses docs added

Thanks for reporting @gnotaras.

We discussed the ticket briefly in a triage session in slack (the link is above the comment and requires slack registration to view).

In the triage session we didn't have time to look into this in depth, but I've moved this to the media component, so hopefully the ticket will get some eyes on it. There is also a shortcodes component, so questionable if it should live there.

Note: See TracTickets for help on using tickets.