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

props wonderboymusic. see #23961

git-svn-id: https://develop.svn.wordpress.org/trunk@23985 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-04-14 01:21:47 +00:00
parent 74319333ed
commit 1df1727e55
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,9 +203,13 @@ 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 ] ) )
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
if ( isset($post_data['meta']) && $post_data['meta'] ) {