Changeset 13468 for trunk/wp-includes/post-template.php
- Timestamp:
- 02/27/2010 08:06:35 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post-template.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-template.php
r13462 r13468 373 373 $classes = array(); 374 374 375 if ( 'rtl' == get_bloginfo( 'text_direction') )375 if ( 'rtl' == get_bloginfo( 'text_direction' ) ) 376 376 $classes[] = 'rtl'; 377 377 … … 405 405 $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' ); 406 406 $classes[] = 'attachmentid-' . $post_id; 407 $classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type);407 $classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type ); 408 408 } 409 409 } elseif ( is_archive() ) { … … 411 411 $author = $wp_query->get_queried_object(); 412 412 $classes[] = 'author'; 413 $classes[] = 'author-' . sanitize_html_class( $author->user_nicename , $author->ID);413 $classes[] = 'author-' . sanitize_html_class( $author->user_nicename , $author->ID ); 414 414 } elseif ( is_category() ) { 415 415 $cat = $wp_query->get_queried_object(); 416 416 $classes[] = 'category'; 417 $classes[] = 'category-' . sanitize_html_class( $cat->slug, $cat->cat_ID);417 $classes[] = 'category-' . sanitize_html_class( $cat->slug, $cat->cat_ID ); 418 418 } elseif ( is_tag() ) { 419 419 $tags = $wp_query->get_queried_object(); 420 420 $classes[] = 'tag'; 421 $classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id);421 $classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id ); 422 422 } 423 423 } elseif ( is_page() ) { … … 442 442 } 443 443 } elseif ( is_search() ) { 444 if ( !empty( $wp_query->posts) )444 if ( !empty( $wp_query->posts ) ) 445 445 $classes[] = 'search-results'; 446 446 else … … 451 451 $classes[] = 'logged-in'; 452 452 453 $page = $wp_query->get( 'page');453 $page = $wp_query->get( 'page' ); 454 454 455 455 if ( !$page || $page < 2) 456 $page = $wp_query->get( 'paged');456 $page = $wp_query->get( 'paged' ); 457 457 458 458 if ( $page && $page > 1 ) { … … 475 475 } 476 476 477 if ( !empty( $class) ) {477 if ( !empty( $class ) ) { 478 478 if ( !is_array( $class ) ) 479 $class = preg_split( '#\s+#', $class);480 $classes = array_merge( $classes, $class);481 } 482 483 $classes = array_map( 'esc_attr', $classes);484 485 return apply_filters( 'body_class', $classes, $class);479 $class = preg_split( '#\s+#', $class ); 480 $classes = array_merge( $classes, $class ); 481 } 482 483 $classes = array_map( 'esc_attr', $classes ); 484 485 return apply_filters( 'body_class', $classes, $class ); 486 486 } 487 487
Note: See TracChangeset
for help on using the changeset viewer.