Changeset 12351
- Timestamp:
- 12/10/2009 06:14:36 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r12343 r12351 1411 1411 if ( $thumbnail_id == '-1' ) { 1412 1412 delete_post_meta( $post_id, '_thumbnail_id' ); 1413 die( _wp_post_ image_html() );1413 die( _wp_post_thumbnail_html() ); 1414 1414 } 1415 1415 … … 1418 1418 if ( !empty( $thumbnail_html ) ) { 1419 1419 update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); 1420 die( _wp_post_ image_html( $thumbnail_id ) );1420 die( _wp_post_thumbnail_html( $thumbnail_id ) ); 1421 1421 } 1422 1422 } -
trunk/wp-admin/edit-form-advanced.php
r12350 r12351 99 99 100 100 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core'); 101 if ( current_theme_supports( 'post- images', 'post' ) )102 add_meta_box('postimagediv', __('Post Image'), 'post_image_meta_box', 'post', 'side', 'low');101 if ( current_theme_supports( 'post-thumbnails', 'post' ) ) 102 add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low'); 103 103 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core'); 104 104 add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core'); -
trunk/wp-admin/edit-page-form.php
r12350 r12351 81 81 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core'); 82 82 add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core'); 83 if ( current_theme_supports( 'post- images', 'page' ) )84 add_meta_box('postimagediv', __('Page Image'), 'post_ image_meta_box', 'page', 'side', 'low');83 if ( current_theme_supports( 'post-thumbnails', 'page' ) ) 84 add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); 85 85 86 86 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM -
trunk/wp-admin/includes/image.php
r12346 r12351 76 76 77 77 /** 78 * Generate post imageattachment meta data.78 * Generate post thumbnail attachment meta data. 79 79 * 80 80 * @since 2.1.0 -
trunk/wp-admin/includes/media.php
r12350 r12351 1240 1240 1241 1241 $thumbnail = ''; 1242 if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post- images', get_post_type($_GET['post_id']) ) && get_post_image_id($_GET['post_id']) != $attachment_id )1243 $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as post image" ) . "</a>";1242 if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post-thumbnails', get_post_type($_GET['post_id']) ) && get_post_thumbnail_id($_GET['post_id']) != $attachment_id ) 1243 $thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>"; 1244 1244 1245 1245 if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) -
trunk/wp-admin/includes/meta-boxes.php
r12343 r12351 816 816 817 817 /** 818 * Display post imagemeta box.818 * Display post thumbnail meta box. 819 819 * 820 820 * @since 2.9.0 821 821 */ 822 function post_ image_meta_box() {822 function post_thumbnail_meta_box() { 823 823 global $post; 824 824 $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); 825 echo _wp_post_ image_html( $thumbnail_id );826 } 825 echo _wp_post_thumbnail_html( $thumbnail_id ); 826 } -
trunk/wp-admin/includes/post.php
r12343 r12351 1063 1063 1064 1064 /** 1065 * Output HTML for the post imagemeta-box.1065 * Output HTML for the post thumbnail meta-box. 1066 1066 * 1067 1067 * @since 2.9.0 … … 1070 1070 * @return string html 1071 1071 */ 1072 function _wp_post_ image_html( $thumbnail_id = NULL ) {1072 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { 1073 1073 global $content_width, $_wp_additional_image_sizes; 1074 $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set image' ) . '</a></p>';1074 $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>'; 1075 1075 1076 1076 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { 1077 1077 $old_content_width = $content_width; 1078 1078 $content_width = 266; 1079 if ( !isset( $_wp_additional_image_sizes['post- image'] ) )1079 if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) ) 1080 1080 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) ); 1081 1081 else 1082 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post- image' );1082 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); 1083 1083 if ( !empty( $thumbnail_html ) ) { 1084 1084 $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>'; 1085 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove image' ) . '</a></p>';1085 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>'; 1086 1086 } 1087 1087 $content_width = $old_content_width; 1088 1088 } 1089 1089 1090 return apply_filters( 'admin_post_ image_html', $content );1090 return apply_filters( 'admin_post_thumbnail_html', $content ); 1091 1091 } 1092 1092 -
trunk/wp-includes/default-filters.php
r12302 r12351 214 214 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); 215 215 216 // Post ImageCSS class filtering217 add_action( 'begin_fetch_post_ image_html', '_wp_post_image_class_filter_add' );218 add_action( 'end_fetch_post_ image_html', '_wp_post_image_class_filter_remove' );216 // Post Thumbnail CSS class filtering 217 add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); 218 add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); 219 219 220 220 // Redirect Old Slugs -
trunk/wp-includes/media.php
r12342 r12351 184 184 185 185 /** 186 * Registers an image size for the post image187 */ 188 function set_post_ image_size( $width = 0, $height = 0, $crop = FALSE ) {189 add_image_size( 'post- image', $width, $height, $crop );186 * Registers an image size for the post thumbnail 187 */ 188 function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) { 189 add_image_size( 'post-thumbnail', $width, $height, $crop ); 190 190 } 191 191 … … 579 579 580 580 /** 581 * Adds a 'wp-post-image' class to post imagethumbnails582 * Uses the begin_fetch_post_ image_html and end_fetch_post_image_html action hooks to583 * dynamically add/remove itself so as to only filter post imagethumbnails581 * Adds a 'wp-post-image' class to post thumbnail thumbnails 582 * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to 583 * dynamically add/remove itself so as to only filter post thumbnail thumbnails 584 584 * 585 585 * @author Mark Jaquith … … 588 588 * @return array 589 589 */ 590 function _wp_post_ image_class_filter( $attr ) {590 function _wp_post_thumbnail_class_filter( $attr ) { 591 591 $attr['class'] .= ' wp-post-image'; 592 592 return $attr; … … 594 594 595 595 /** 596 * Adds _wp_post_ image_class_filter to the wp_get_attachment_image_attributes filter596 * Adds _wp_post_thumbnail_class_filter to the wp_get_attachment_image_attributes filter 597 597 * 598 598 * @author Mark Jaquith 599 599 * @since 2.9.0 600 600 */ 601 function _wp_post_ image_class_filter_add( $attr ) {602 add_filter( 'wp_get_attachment_image_attributes', '_wp_post_ image_class_filter' );603 } 604 605 /** 606 * Removes _wp_post_ image_class_filter from the wp_get_attachment_image_attributes filter601 function _wp_post_thumbnail_class_filter_add( $attr ) { 602 add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' ); 603 } 604 605 /** 606 * Removes _wp_post_thumbnail_class_filter from the wp_get_attachment_image_attributes filter 607 607 * 608 608 * @author Mark Jaquith 609 609 * @since 2.9.0 610 610 */ 611 function _wp_post_ image_class_filter_remove( $attr ) {612 remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_ image_class_filter' );611 function _wp_post_thumbnail_class_filter_remove( $attr ) { 612 remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' ); 613 613 } 614 614 -
trunk/wp-includes/script-loader.php
r12349 r12351 386 386 $scripts->add_data( 'set-post-thumbnail', 'group', 1 ); 387 387 $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 388 'setThumbnail' => __( 'Use as post image' ),388 'setThumbnail' => __( 'Use as thumbnail' ), 389 389 'saving' => __( 'Saving...' ), 390 390 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ) -
trunk/wp-includes/theme.php
r12350 r12351 1322 1322 global $_wp_theme_features; 1323 1323 1324 if ( 'post-thumbnails' == $feature ) // This was changed during 2.9 beta. I'll be nice and not break things.1325 $feature = 'post-images';1326 1327 1324 if ( func_num_args() == 1 ) 1328 1325 $_wp_theme_features[$feature] = true; … … 1354 1351 // @todo Allow pluggable arg checking 1355 1352 switch ( $feature ) { 1356 case 'post- images':1353 case 'post-thumbnails': 1357 1354 // post-thumbnails can be registered for only certain content/post types by passing 1358 1355 // an array of types to add_theme_support(). If no array was passed, then -
trunk/wp-settings.php
r12339 r12351 693 693 694 694 // Load in support for template functions which the theme supports 695 require_if_theme_supports( 'post- images', ABSPATH . WPINC . '/post-image-template.php' );695 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); 696 696 697 697 /**
Note: See TracChangeset
for help on using the changeset viewer.