Changeset 24021 for trunk/wp-admin/includes/post-formats.php
- Timestamp:
- 04/17/2013 08:57:44 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post-formats.php
r24006 r24021 12 12 <div class="field wp-format-quote"> 13 13 <label for="wp_format_quote"><?php _e( 'Quote' ); ?></label> 14 <textarea id="wp_format_quote" name="_ wp_format_quote" class="widefat"><?php echo esc_textarea( $format_meta['quote'] ); ?></textarea>14 <textarea id="wp_format_quote" name="_format_quote" class="widefat"><?php echo esc_textarea( $format_meta['quote'] ); ?></textarea> 15 15 </div> 16 16 17 17 <div class="field wp-format-quote"> 18 18 <label for="wp_format_quote_source"><?php _e( 'Quote source' ); ?></label> 19 <input type="text" id="wp_format_quote_source" name="_ wp_format_quote_source" value="<?php echo esc_attr( $format_meta['quote_source'] ); ?>" class="widefat" />19 <input type="text" id="wp_format_quote_source" name="_format_quote_source_name" value="<?php echo esc_attr( $format_meta['quote_source_name'] ); ?>" class="widefat" /> 20 20 </div> 21 21 22 22 <div class="field wp-format-image"> 23 <?php if ( ! empty( $format_meta['image'] ) ) : ?> 23 <?php if ( ! empty( $format_meta['image'] ) ) : 24 $value = $format_meta['image']; 25 ?> 24 26 <div id="image-preview" class="wp-format-media-preview"> 25 27 <?php 26 if ( is_numeric( $ format_meta['image']) ) {27 $format_meta['image'] = absint( $ format_meta['image']);28 if ( is_numeric( $value ) ) { 29 $format_meta['image'] = absint( $value ); 28 30 $image = wp_get_attachment_url( $format_meta['image'] ); 29 31 printf( '<img src="%s" alt="%s" />', esc_url( $image ), get_the_title( $format_meta['image'] ) ); 30 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $ format_meta['image']) ) {31 echo do_shortcode( $ format_meta['image']);32 } elseif ( ! preg_match( '#<[^>]+>#', $ format_meta['image']) ) {33 printf( '<img src="%s" alt="" />', esc_url( $ format_meta['image']) );32 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 33 echo do_shortcode( $value ); 34 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) { 35 printf( '<img src="%s" alt="" />', esc_url( $value ) ); 34 36 } else { 35 echo $ format_meta['image'];37 echo $value; 36 38 } 37 39 ?> … … 44 46 _e( 'Image URL' ); 45 47 ?></label> 46 <textarea id="wp_format_image" type="text" name="_ wp_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea>48 <textarea id="wp_format_image" type="text" name="_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea> 47 49 <div data-format="image" class="wp-format-media-holder hide-if-no-js"> 48 50 <a href="#" class="wp-format-media-select" … … 54 56 </div> 55 57 56 <div class="field wp-format-link wp-format-quote wp-format-image"> 57 <label for="wp_format_url"><?php _e( 'Link URL' ); ?></label> 58 <input type="text" id="wp_format_url" name="_wp_format_url" value="<?php echo esc_url( $format_meta['url'] ); ?>" class="widefat" /> 58 <div class="field wp-format-link"> 59 <label for="wp_format_link_url"><?php _e( 'Link URL' ); ?></label> 60 <input type="text" id="wp_format_link_url" name="_format_link_url" value="<?php echo esc_url( $format_meta['link_url'] ); ?>" class="widefat" /> 61 </div> 62 63 <div class="field wp-format-quote"> 64 <label for="wp_format_quote_source_url"><?php _e( 'Link URL' ); ?></label> 65 <input type="text" id="wp_format_quote_source_url" name="_format_quote_source_url" value="<?php echo esc_url( $format_meta['quote_source_url'] ); ?>" class="widefat" /> 66 </div> 67 68 <div class="field wp-format-image"> 69 <label for="wp_format_image_url"><?php _e( 'Link URL' ); ?></label> 70 <input type="text" id="wp_format_image_url" name="_format_url" value="<?php echo esc_url( $format_meta['url'] ); ?>" class="widefat" /> 59 71 </div> 60 72 61 73 <div class="field wp-format-video"> 62 <?php if ( ! empty( $format_meta['video'] ) ): ?> 74 <?php if ( ! empty( $format_meta['video_embed'] ) ): 75 $value = $format_meta['video_embed']; 76 ?> 63 77 <div id="video-preview" class="wp-format-media-preview"> 64 78 <?php 65 if ( is_numeric( $ format_meta['video']) ) {66 $url = wp_get_attachment_url( $ format_meta['video']);79 if ( is_numeric( $value ) ) { 80 $url = wp_get_attachment_url( $value ); 67 81 echo do_shortcode( sprintf( '[video src="%s"]', $url ) ); 68 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $ format_meta['video']) ) {69 echo do_shortcode( $ format_meta['video']);70 } elseif ( ! preg_match( '#<[^>]+>#', $ format_meta['video']) ) {71 if ( strstr( $ format_meta['video'], home_url() ) )72 echo do_shortcode( sprintf( '[video src="%s"]', $ format_meta['video']) );82 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 83 echo do_shortcode( $value ); 84 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) { 85 if ( strstr( $value, home_url() ) ) 86 echo do_shortcode( sprintf( '[video src="%s"]', $value ) ); 73 87 else 74 echo $wp_embed->autoembed( $ format_meta['video']);88 echo $wp_embed->autoembed( $value ); 75 89 } else { 76 echo $ format_meta['video'];90 echo $value; 77 91 } 78 92 ?> … … 85 99 _e( 'Video URL' ); 86 100 ?></label> 87 <textarea id="wp_format_video" type="text" name="_ wp_format_video" class="widefat"><?php esc_html_e( $format_meta['video'] ); ?></textarea>101 <textarea id="wp_format_video" type="text" name="_format_video_embed" class="widefat"><?php esc_html_e( $format_meta['video_embed'] ); ?></textarea> 88 102 <div data-format="video" class="wp-format-media-holder hide-if-no-js"> 89 103 <a href="#" class="wp-format-media-select" … … 96 110 97 111 <div class="field wp-format-audio"> 98 <?php if ( ! empty( $format_meta['audio'] ) ): ?> 112 <?php if ( ! empty( $format_meta['audio_embed'] ) ): 113 $value = $format_meta['audio_embed']; 114 ?> 99 115 <div id="audio-preview" class="wp-format-media-preview"> 100 116 <?php 101 if ( is_numeric( $ format_meta['audio']) ) {102 $url = wp_get_attachment_url( $ format_meta['audio']);117 if ( is_numeric( $value ) ) { 118 $url = wp_get_attachment_url( $value ); 103 119 echo do_shortcode( sprintf( '[audio src="%s"]', $url ) ); 104 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $ format_meta['audio']) ) {105 echo do_shortcode( $ format_meta['audio']);106 } elseif ( ! preg_match( '#<[^>]+>#', $ format_meta['audio']) ) {107 if ( strstr( $ format_meta['audio'], home_url() ) )108 echo do_shortcode( sprintf( '[audio src="%s"]', $ format_meta['audio']) );120 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 121 echo do_shortcode( $value ); 122 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) { 123 if ( strstr( $value, home_url() ) ) 124 echo do_shortcode( sprintf( '[audio src="%s"]', $value ) ); 109 125 else 110 echo $wp_embed->autoembed( $ format_meta['audio']);126 echo $wp_embed->autoembed( $value ); 111 127 } else { 112 echo $ format_meta['audio'];128 echo $value; 113 129 } 114 130 ?> … … 121 137 _e( 'Audio URL' ); 122 138 ?></label> 123 <textarea id="wp_format_audio" name="_ wp_format_audio" class="widefat"><?php esc_html_e( $format_meta['audio'] ); ?></textarea>139 <textarea id="wp_format_audio" name="_format_audio_embed" class="widefat"><?php esc_html_e( $format_meta['audio_embed'] ); ?></textarea> 124 140 <div data-format="audio" class="wp-format-media-holder hide-if-no-js"> 125 141 <a href="#" class="wp-format-media-select" data-choose="<?php esc_attr_e( 'Choose Audio' ); ?>" data-update="<?php esc_attr_e( 'Select Audio' ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.