Skip to content

Commit

Permalink
Add tag filter to playlist player shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-c authored and zahardev committed Dec 27, 2024
1 parent acf6e91 commit 656722c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions php/classes/repositories/class-episode-repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ public function get_episodes( $atts ) {
}
}

// Limit query to only episodes with specified tag(s)
if ( $atts['tag'] ) {
$query_args['tag'] = $atts['tag'];
}

// Allow dynamic filtering of query args
$query_args = apply_filters( 'ssp_podcast_playlist_query_args', $query_args );

Expand Down
1 change: 1 addition & 0 deletions php/classes/shortcodes/class-podcast-playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ protected function prepare_atts( $params ) {
array(
'type' => 'audio',
'series' => '',
'tag' => '',
'order' => 'ASC',
'orderby' => 'menu_order ID',
'include' => '',
Expand Down

0 comments on commit 656722c

Please sign in to comment.