| 618 | | $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_page_template_slug( $page_id ) ) ); |
| | 618 | |
| | 619 | $template_slug = get_page_template_slug( $page_id ); |
| | 620 | $template_parts = explode( '/', $template_slug ); |
| | 621 | |
| | 622 | foreach ( $template_parts as $part ) { |
| | 623 | $classes[] = 'page-template-' . sanitize_html_class( str_replace( array( '.', '/' ), '-', basename( $part, '.php' ) ) ); |
| | 624 | } |
| | 625 | $classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', $template_slug ) ); |