Skip to content

Commit

Permalink
added sanitize_callback on podcast_transcript post meta and removed w…
Browse files Browse the repository at this point in the history
…p_kses_post from transcript template
  • Loading branch information
sksaju committed Sep 14, 2023
1 parent c915845 commit 9264fa4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 8 additions & 3 deletions includes/datatypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,14 @@ function register_meta() {
'post',
'podcast_transcript',
array(
'show_in_rest' => true,
'type' => 'string',
'single' => true,
'show_in_rest' => true,
'type' => 'string',
'single' => true,
'sanitize_callback' => function( $val ) {
return wp_kses_post( $val );
},
)
);

\register_term_meta(
'podcasting_podcasts',
Expand Down
6 changes: 2 additions & 4 deletions templates/transcript.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
$podcast_slug = get_query_var( 'podcasting-episode' );
$post_object = get_page_by_path( $podcast_slug, OBJECT, 'post' );
if ( $post_object instanceof WP_Post ) {
echo wp_kses_post(
tenup_podcasting\transcripts\podcasting_wrap_unwrapped_text_in_paragraph(
get_post_meta( $post_object->ID, 'podcast_transcript', true )
)
echo tenup_podcasting\transcripts\podcasting_wrap_unwrapped_text_in_paragraph( // phpcs:ignore WordPress.Security.EscapeOutput
get_post_meta( $post_object->ID, 'podcast_transcript', true )
);
}
?>
Expand Down

0 comments on commit 9264fa4

Please sign in to comment.