Skip to content

Commit 9264fa4

Browse files
committed
added sanitize_callback on podcast_transcript post meta and removed wp_kses_post from transcript template
1 parent c915845 commit 9264fa4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

includes/datatypes.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,14 @@ function register_meta() {
115115
'post',
116116
'podcast_transcript',
117117
array(
118-
'show_in_rest' => true,
119-
'type' => 'string',
120-
'single' => true,
118+
'show_in_rest' => true,
119+
'type' => 'string',
120+
'single' => true,
121+
'sanitize_callback' => function( $val ) {
122+
return wp_kses_post( $val );
123+
},
124+
)
125+
);
121126

122127
\register_term_meta(
123128
'podcasting_podcasts',

templates/transcript.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525
$podcast_slug = get_query_var( 'podcasting-episode' );
2626
$post_object = get_page_by_path( $podcast_slug, OBJECT, 'post' );
2727
if ( $post_object instanceof WP_Post ) {
28-
echo wp_kses_post(
29-
tenup_podcasting\transcripts\podcasting_wrap_unwrapped_text_in_paragraph(
30-
get_post_meta( $post_object->ID, 'podcast_transcript', true )
31-
)
28+
echo tenup_podcasting\transcripts\podcasting_wrap_unwrapped_text_in_paragraph( // phpcs:ignore WordPress.Security.EscapeOutput
29+
get_post_meta( $post_object->ID, 'podcast_transcript', true )
3230
);
3331
}
3432
?>

0 commit comments

Comments
 (0)