関数 get_attachment_template()
2014/12/17
関数 get_attachment_template()
定義ファイル :/blog/wp-includes/template.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function get_attachment_template() { global $posts; if ( ! empty( $posts ) && isset( $posts[0]->post_mime_type ) ) { $type = explode( '/', $posts[0]->post_mime_type ); if ( ! empty( $type ) ) { if ( $template = get_query_template( $type[0] ) ) return $template; elseif ( ! empty( $type[1] ) ) { if ( $template = get_query_template( $type[1] ) ) return $template; elseif ( $template = get_query_template( "$type[0]_$type[1]" ) ) return $template; } } } return get_query_template( 'attachment' ); } |