Changeset 13032 for trunk/wp-includes/post-template.php
- Timestamp:
- 02/08/2010 10:05:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r13025 r13032 393 393 394 394 if ( is_single() ) { 395 $postID = $wp_query->get_queried_object_id(); 396 397 $classes[] = 'single postid-' . $postID; 395 $post_id = $wp_query->get_queried_object_id(); 396 $post = $wp_query->get_queried_object(); 397 398 $classes[] = 'single'; 399 $classes[] = 'single-' . sanitize_html_class($post->post_type, $post_id); 400 $classes[] = 'postid-' . $post_id; 398 401 399 402 if ( is_attachment() ) { 400 $mime_type = get_post_mime_type($post ID);403 $mime_type = get_post_mime_type($post_id); 401 404 $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' ); 402 $classes[] = 'attachmentid-' . $post ID;405 $classes[] = 'attachmentid-' . $post_id; 403 406 $classes[] = 'attachment-' . str_replace($mime_prefix, '', $mime_type); 404 407 } … … 420 423 $classes[] = 'page'; 421 424 422 $page ID= $wp_query->get_queried_object_id();423 424 $post = get_page($page ID);425 426 $classes[] = 'page-id-' . $page ID;427 428 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status = 'publish' LIMIT 1", $page ID) ) )425 $page_id = $wp_query->get_queried_object_id(); 426 427 $post = get_page($page_id); 428 429 $classes[] = 'page-id-' . $page_id; 430 431 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status = 'publish' LIMIT 1", $page_id) ) ) 429 432 $classes[] = 'page-parent'; 430 433 … … 435 438 if ( is_page_template() ) { 436 439 $classes[] = 'page-template'; 437 $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_post_meta( $page ID, '_wp_page_template', true ) ), '' );440 $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_post_meta( $page_id, '_wp_page_template', true ) ), '' ); 438 441 } 439 442 } elseif ( is_search() ) {
Note: See TracChangeset
for help on using the changeset viewer.