Ticket #21508: 21508.diff
File 21508.diff, 7.1 KB (added by , 13 years ago) |
---|
-
wp-admin/options-media.php
15 15 $title = __('Media Settings'); 16 16 $parent_file = 'options-general.php'; 17 17 18 $media_options_help = '<p>' . __('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.') . '</p>' . 19 '<p>' . __('The Embed option allows you embed a video, image, or other media content into your content automatically by typing the URL (of the web page where the file lives) on its own line when you create your content.'); 20 21 if ( ! empty( $content_width ) ) 22 $media_options_help .= ' ' . __( 'If you do not set the maximum embed size, it will be automatically sized to fit into your content area.' ); 23 24 $media_options_help .= '</p>'; 18 $media_options_help = '<p>' . __('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.') . '</p>'; 25 19 26 20 if ( ! is_multisite() ) { 27 21 $media_options_help .= '<p>' . __('Uploading Files allows you to choose the folder and path for storing your uploaded files.') . '</p>'; … … 91 85 <?php do_settings_fields('media', 'default'); ?> 92 86 </table> 93 87 94 <h3><?php _e('Embeds') ?></h3>95 96 <table class="form-table">97 98 <tr valign="top">99 <th scope="row"><?php _e('Auto-embeds'); ?></th>100 <td><fieldset><legend class="screen-reader-text"><span><?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></span></legend>101 <label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></label>102 </fieldset></td>103 </tr>104 105 <tr valign="top">106 <th scope="row"><?php _e('Maximum embed size') ?></th>107 <td>108 <label for="embed_size_w"><?php _e('Width'); ?></label>109 <input name="embed_size_w" type="number" step="1" min="0" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />110 <label for="embed_size_h"><?php _e('Height'); ?></label>111 <input name="embed_size_h" type="number" step="1" min="0" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />112 <?php if ( ! empty( $content_width ) )113 echo '<p class="description">' . __( 'If the width value is left blank, embeds will default to the max width of your theme.' ) . '</p>';114 ?>115 </td>116 </tr>117 118 <?php do_settings_fields('media', 'embeds'); ?>119 </table>120 121 88 <?php if ( !is_multisite() ) : ?> 122 89 <h3><?php _e('Uploading Files'); ?></h3> 123 90 <table class="form-table"> -
wp-admin/includes/schema.php
469 469 470 470 // 2.8 471 471 'timezone_string' => $timezone_string, 472 473 // 2.9 474 'embed_autourls' => 1, 475 'embed_size_w' => '', 476 'embed_size_h' => 600, 477 472 478 473 // 3.0 479 474 'page_for_posts' => 0, 480 475 'page_on_front' => 0, -
wp-admin/options.php
61 61 $whitelist_options = array( 62 62 'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ), 63 63 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), 64 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' , 'embed_autourls', 'embed_size_w', 'embed_size_h'),64 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), 65 65 'privacy' => array( 'blog_public' ), 66 66 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ), 67 67 'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app', 'enable_xmlrpc' ), -
wp-includes/media.php
1054 1054 add_shortcode( 'embed', '__return_false' ); 1055 1055 1056 1056 // Attempts to embed all URLs in a post 1057 if ( get_option('embed_autourls') ) 1058 add_filter( 'the_content', array(&$this, 'autoembed'), 8 ); 1057 add_filter( 'the_content', array(&$this, 'autoembed'), 8 ); 1059 1058 1060 1059 // After a post is saved, invalidate the oEmbed cache 1061 1060 add_action( 'save_post', array(&$this, 'delete_oembed_caches') ); … … 1259 1258 $this->post_ID = $post->ID; 1260 1259 $this->usecache = false; 1261 1260 1262 $content = $this->run_shortcode( $post->post_content ); 1263 if ( get_option('embed_autourls') ) 1264 $this->autoembed( $content ); 1261 $this->autoembed( $this->run_shortcode( $post->post_content ) ); 1265 1262 1266 1263 $this->usecache = true; 1267 1264 } … … 1339 1336 * @return array Default embed parameters. 1340 1337 */ 1341 1338 function wp_embed_defaults() { 1342 if ( !empty($GLOBALS['content_width']) ) 1343 $theme_width = (int) $GLOBALS['content_width']; 1344 1345 $width = get_option('embed_size_w'); 1346 1347 if ( empty($width) && !empty($theme_width) ) 1348 $width = $theme_width; 1349 1350 if ( empty($width) ) 1351 $width = 500; 1352 1353 $height = get_option('embed_size_h'); 1354 1355 if ( empty($height) ) 1356 $height = 700; 1357 1339 global $content_width; 1358 1340 return apply_filters( 'embed_defaults', array( 1359 'width' => $width,1360 'height' => $height,1341 'width' => ( !empty( $content_width ) ) ? (int) $content_width : 500, 1342 'height' => 600, 1361 1343 ) ); 1362 1344 } 1363 1345 -
wp-includes/formatting.php
2737 2737 case 'medium_size_h': 2738 2738 case 'large_size_w': 2739 2739 case 'large_size_h': 2740 case 'embed_size_h':2741 2740 case 'default_post_edit_rows': 2742 2741 case 'mailserver_port': 2743 2742 case 'comment_max_links': … … 2755 2754 $value = absint( $value ); 2756 2755 break; 2757 2756 2758 case 'embed_size_w':2759 if ( '' !== $value )2760 $value = absint( $value );2761 break;2762 2763 2757 case 'posts_per_page': 2764 2758 case 'posts_per_rss': 2765 2759 $value = (int) $value;