Skip to content

Commit

Permalink
Additional filters for output of [video] and [audio] WP shortcodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg committed Sep 19, 2024
1 parent 7340a56 commit fbb19ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/abstracts/abstract.llms.post.model.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,14 @@ protected function get_embed( $type = 'video', $prop = '' ) {

if ( ! $ret ) {

$ret = do_shortcode( sprintf( '[%1$s src="%2$s"]', $type, $url ) );
// TODO: Filter on this to add autoplay or other attributes.
$shortcode = "[$type";
foreach ( apply_filters( 'llms_embed_shortcode_attributes', array( 'src' => $url ), $type, $this ) as $key => $value ) {
$shortcode .= " $key=\"$value\"";
}
$shortcode .= ']';

$ret = apply_filters( 'llms_embed_shortcode_output', do_shortcode( $shortcode ), $type, $this );
}
}
/**
Expand Down

0 comments on commit fbb19ea

Please sign in to comment.