Ticket #23470: 23470.2.diff
File 23470.2.diff, 1.1 KB (added by , 11 years ago) |
---|
-
src/wp-includes/post-template.php
592 592 $classes[] = 'parent-pageid-' . $post->post_parent; 593 593 } 594 594 if ( is_page_template() ) { 595 $template_slug = get_page_template_slug( $page_id ); 596 $template_parts = explode( '/', $template_slug ); 597 $template_dir = array_shift( $template_parts ); 598 595 599 $classes[] = 'page-template'; 596 $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_page_template_slug( $page_id ) ) ); 600 601 if ( ! empty( $template_dir ) ) { 602 $classes[] = 'page-template-' . sanitize_html_class( str_replace( array( '.', '/' ), '-', $template_dir ) ); 603 } 604 605 $classes[] = 'page-template-' . sanitize_html_class( str_replace( array( '.', '/' ), '-', $template_slug ) ); 606 $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', $template_slug ) ); 597 607 } else { 598 608 $classes[] = 'page-template-default'; 599 609 }