Ticket #11364: 11364.diff
File 11364.diff, 3.7 KB (added by , 15 years ago) |
---|
-
wp-includes/theme.php
1320 1320 */ 1321 1321 function add_theme_support( $feature ) { 1322 1322 global $_wp_theme_features; 1323 $_wp_theme_features[$feature] = true; 1323 1324 if ( func_num_args() == 1 ) 1325 $_wp_theme_features[$feature] = true; 1326 else 1327 $_wp_theme_features[$feature] = array_slice( func_get_args(), 1 ); 1324 1328 } 1325 1329 1326 1330 /** … … 1334 1338 1335 1339 function current_theme_supports( $feature ) { 1336 1340 global $_wp_theme_features; 1337 return ( isset( $_wp_theme_features[$feature] ) && $_wp_theme_features[$feature] ); 1341 1342 if ( !isset( $_wp_theme_features[$feature] ) ) 1343 return false; 1344 1345 // If no args passed then no extra checks need be performed 1346 if ( func_num_args() <= 1 ) 1347 return true; 1348 1349 $args = array_slice( func_get_args(), 1 ); 1350 1351 // @todo Allow pluggable arg checking 1352 switch ( $feature ) { 1353 case 'post-thumbnails': 1354 // post-thumbnails can be registered for only certain content/post types by passing 1355 // an array of types to add_theme_support(). If no array was passed, then 1356 // any type is accepted 1357 if ( true === $_wp_theme_features[$feature] ) // Registered for all types 1358 return true; 1359 $content_type = $args[0]; 1360 if ( in_array($content_type, $_wp_theme_features[$feature][0]) ) 1361 return true; 1362 else 1363 return false; 1364 break; 1365 } 1366 1367 return true; 1338 1368 } 1339 1369 1340 1370 /** -
wp-admin/includes/media.php
1239 1239 } 1240 1240 1241 1241 $thumbnail = ''; 1242 if ( 'image' == $type && current_theme_supports( 'post-thumbnails' ) && get_post_image_id($_GET['post_id']) != $attachment_id )1242 if ( 'image' == $type && current_theme_supports( 'post-thumbnails', 'attachment:image' ) && get_post_image_id($_GET['post_id']) != $attachment_id ) 1243 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']) ) -
wp-admin/edit-page-form.php
80 80 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core'); 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-thumbnails' ) )83 if ( current_theme_supports( 'post-thumbnails', 'page' ) ) 84 84 add_meta_box('postthumbnaildiv', __('Page Thumbnail'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); 85 85 86 86 $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM -
wp-admin/edit-form-advanced.php
98 98 } 99 99 100 100 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core'); 101 if ( current_theme_supports( 'post-thumbnails' ) )101 if ( current_theme_supports( 'post-thumbnails', 'post' ) ) 102 102 add_meta_box('postthumbnaildiv', __('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');