Ticket #20194: 20194_metadescription.diff
File 20194_metadescription.diff, 9.5 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/schema.php
364 364 'blogname' => __('My Site'), 365 365 /* translators: blog tagline */ 366 366 'blogdescription' => __('Just another WordPress site'), 367 /* translators: default meta description of the site */ 368 'metadescription' => __(''), 367 369 'users_can_register' => 0, 368 370 'admin_email' => 'you@example.com', 369 371 /* translators: default start of the week. 0 = Sunday, 1 = Monday */ -
wp-admin/options-general.php
59 59 add_action('admin_head', 'add_js'); 60 60 61 61 $options_help = '<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' . 62 '<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes. ') . '</p>';62 '<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes. The description is used by themes to provide information about the site to search engines.') . '</p>'; 63 63 64 64 if ( ! is_multisite() ) { 65 65 $options_help .= '<p>' . __('The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.') . '</p>' . … … 101 101 <td><input name="blogdescription" type="text" id="blogdescription" value="<?php form_option('blogdescription'); ?>" class="regular-text" /> 102 102 <span class="description"><?php _e('In a few words, explain what this site is about.') ?></span></td> 103 103 </tr> 104 <tr valign="top"> 105 <th scope="row"><label for="metadescription"><?php _e('Description') ?></label></th> 106 <td><input name="metadescription" type="text" id="metadescription" value="<?php form_option('metadescription'); ?>" class="regular-text" /> 107 <span class="description"><?php _e('In short plain language, describe this blog for search engines.') ?></span></td> 108 </tr> 104 109 <?php if ( !is_multisite() ) { ?> 105 110 <tr valign="top"> 106 111 <th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th> … … 326 331 327 332 </div> 328 333 329 <?php include('./admin-footer.php') ?> 334 <?php include('./admin-footer.php') ?> 335 No newline at end of file -
wp-admin/options.php
59 59 wp_die(__('Cheatin’ uh?')); 60 60 61 61 $whitelist_options = array( 62 'general' => array( 'blogname', 'blogdescription', ' gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),62 'general' => array( 'blogname', 'blogdescription', 'metadescription', '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 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' ), 65 65 'privacy' => array( 'blog_public' ), -
wp-includes/class-wp-customize.php
599 599 'capability' => 'manage_options' 600 600 ) ); 601 601 602 /* Site Title & Tagline*/602 /* Site Title, Tagline & Description*/ 603 603 604 604 $this->add_section( 'strings', array( 605 'title' => __( 'Site Title & Tagline' ),605 'title' => __( 'Site Title, Tagline & Description' ), 606 606 'description' => __( 'Customize some strings.' ), 607 607 ) ); 608 608 … … 621 621 'type' => 'option', 622 622 'capability' => 'manage_options' 623 623 ) ); 624 625 $this->add_setting( 'metadescription', array( 626 'label' => __( 'Description' ), 627 'section' => 'strings', 628 'default' => get_option( 'metadescription' ), 629 'type' => 'option', 630 'capability' => 'manage_options' 631 ) ); 624 632 } 625 633 }; 626 634 -
wp-includes/class-wp-xmlrpc-server.php
359 359 'readonly' => false, 360 360 'option' => 'blogdescription' 361 361 ), 362 'blog_description' => array( 363 'desc' => __( 'Site Description' ), 364 'readonly' => false, 365 'option' => 'metadescription' 366 ), 362 367 'date_format' => array( 363 368 'desc' => __( 'Date Format' ), 364 369 'readonly' => false, -
wp-includes/default-filters.php
208 208 add_action( 'wp_head', 'wp_print_styles', 8 ); 209 209 add_action( 'wp_head', 'wp_print_head_scripts', 9 ); 210 210 add_action( 'wp_head', 'wp_generator' ); 211 add_action( 'wp_head', 'wp_meta_description' ); 211 212 add_action( 'wp_head', 'rel_canonical' ); 212 213 add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); 213 214 add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); -
wp-includes/formatting.php
2675 2675 $value = 'closed'; 2676 2676 break; 2677 2677 2678 case 'metadescription': 2678 2679 case 'blogdescription': 2679 2680 case 'blogname': 2680 2681 $value = addslashes($value); -
wp-includes/general-template.php
412 412 case 'description': 413 413 $output = get_option('blogdescription'); 414 414 break; 415 case 'metadescription': 416 $output = get_option('metadescription'); 417 break; 415 418 case 'rdf_url': 416 419 $output = get_feed_link('rdf'); 417 420 break; … … 2212 2215 } 2213 2216 2214 2217 /** 2218 * Display the XHTML description that is generated on the wp_head hook. 2219 * 2220 * @since 2.5.0 2221 */ 2222 function wp_meta_description() { 2223 the_meta_description( apply_filters( 'wp_meta_description_type', 'xhtml' ) ); 2224 } 2225 2226 /** 2227 * Display the description XML or Comment 2228 * 2229 * Returns the description supplied in the general settings 2230 * 2231 * @since 3.4.0 2232 * @uses apply_filters() Calls 'the_meta_description' hook. 2233 * 2234 * @param string $type The type of generator to output - (html|xhtml|comment). 2235 */ 2236 function the_meta_description( $type ) { 2237 echo apply_filters('the_meta_description', get_the_meta_description($type), $type) . "\n"; 2238 } 2239 2240 /** 2241 * Creates the description XML or Comment 2242 * 2243 * Returns the description supplied in the general settings. Allows 2244 * for a plugin to filter generators on an individual basis using the 2245 * 'get_the_meta_description_{$type}' filter. 2246 * 2247 * @since 2.5.0 2248 * @uses apply_filters() Calls 'get_the_meta_description_$type' hook. 2249 * 2250 * @param string $type The type of generator to return - (html|xhtml|comment). 2251 * @return string The metadescription option value in the form requested 2252 */ 2253 function get_the_meta_description( $type = '' ) { 2254 if ( empty( $type ) ) { 2255 2256 $current_filter = current_filter(); 2257 if ( empty( $current_filter ) ) 2258 return; 2259 2260 switch ( $current_filter ) { 2261 case 'rss2_head' : 2262 case 'commentsrss2_head' : 2263 $type = 'rss2'; 2264 break; 2265 case 'rss_head' : 2266 case 'opml_head' : 2267 $type = 'comment'; 2268 break; 2269 case 'rdf_header' : 2270 $type = 'rdf'; 2271 break; 2272 case 'atom_head' : 2273 case 'comments_atom_head' : 2274 case 'app_head' : 2275 $type = 'atom'; 2276 break; 2277 } 2278 } 2279 2280 $rawdescription = get_bloginfo( 'metadescription' ); 2281 2282 if ( $rawdescription > '' ) { 2283 switch ( $type ) { 2284 case 'html': 2285 $desc = '<meta name="description" content="' . esc_attr( $rawdescription ) . '">'; 2286 break; 2287 case 'xhtml': 2288 $desc = '<meta name="description" content="' . esc_attr( $rawdescription ) . '">'; 2289 break; 2290 case 'comment': 2291 $desc = '<!-- description="' . esc_attr( $rawdescription ). '" -->'; 2292 break; 2293 } 2294 } else { 2295 $desc = ''; 2296 } 2297 2298 return apply_filters( "get_the_meta_description_{$type}", $desc, $type ); 2299 } 2300 2301 /** 2215 2302 * Outputs the html checked attribute. 2216 2303 * 2217 2304 * Compares the first two arguments and if identical marks as checked