Only say we accept a raw video/audio embed code for unfiltered_html users.

props wonderboymusic. see #23961

git-svn-id: http://core.svn.wordpress.org/trunk@23985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-04-14 01:21:47 +00:00
parent 697bf3d70e
commit 21bb61466a
2 changed files with 18 additions and 4 deletions

View File

@ -69,7 +69,12 @@ $format_meta = get_post_format_meta( $post_ID );
?>
</div>
<?php endif; ?>
<label for="wp_format_video"><?php _e( 'Video embed code or URL' ); ?></label>
<label for="wp_format_video"><?php
if ( current_user_can( 'unfiltered_html' ) )
_e( 'Video embed code or URL' );
else
_e( 'Video URL' );
?></label>
<textarea id="wp_format_video" type="text" name="_wp_format_video" class="widefat"><?php esc_html_e( $format_meta['video'] ); ?></textarea>
<div data-format="video" class="wp-format-media-holder hide-if-no-js<?php if ( ! $image ) echo ' empty'; ?>">
<a href="#" class="wp-format-media-select"
@ -103,7 +108,12 @@ $format_meta = get_post_format_meta( $post_ID );
?>
</div>
<?php endif; ?>
<label for="wp_format_audio"><?php _e( 'Audio embed code or URL' ); ?></label>
<label for="wp_format_audio"><?php
if ( current_user_can( 'unfiltered_html' ) )
_e( 'Audio embed code or URL' );
else
_e( 'Audio URL' );
?></label>
<textarea id="wp_format_audio" name="_wp_format_audio" class="widefat"><?php esc_html_e( $format_meta['audio'] );
?></textarea>
<div data-format="audio" class="wp-format-media-holder hide-if-no-js<?php if ( empty( $format_meta['audio'] ) ) echo ' empty'; ?>">

View File

@ -203,8 +203,12 @@ function edit_post( $post_data = null ) {
$format_keys = array( 'quote', 'quote_source', 'image', 'gallery', 'audio', 'video' );
foreach ( $format_keys as $key ) {
if ( isset( $post_data[ '_wp_format_' . $key ] ) )
update_post_meta( $post_ID, '_wp_format_' . $key, wp_filter_post_kses( $post_data[ '_wp_format_' . $key ] ) );
if ( isset( $post_data[ '_wp_format_' . $key ] ) ) {
if ( current_user_can( 'unfiltered_html' ) )
update_post_meta( $post_ID, '_wp_format_' . $key, $post_data[ '_wp_format_' . $key ] );
else
update_post_meta( $post_ID, '_wp_format_' . $key, wp_filter_post_kses( $post_data[ '_wp_format_' . $key ] ) );
}
}
// Meta Stuff