関数 locate_template()
2014/12/17
関数 locate_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 | function locate_template($template_names, $load = false, $require_once = true ) { $located = ''; foreach ( (array) $template_names as $template_name ) { if ( !$template_name ) continue; if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { $located = STYLESHEETPATH . '/' . $template_name; break; } else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { $located = TEMPLATEPATH . '/' . $template_name; break; } } if ( $load && '' != $located ) load_template( $located, $require_once ); return $located; } |