IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 363 | 363 | * @param string|array $template_names Template file(s) to search for, in order. |
| 364 | 364 | * @param bool $load If true the template file will be loaded if it is found. |
| 365 | 365 | * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false. |
| | 366 | * @param array $args An array of arguments to control template handling. |
| 366 | 367 | * @return string The template filename if one is located. |
| 367 | 368 | */ |
| 368 | | function locate_template($template_names, $load = false, $require_once = true ) { |
| | 369 | function locate_template($template_names, $load = false, $require_once = true, $args = array() ) { |
| 369 | 370 | $located = ''; |
| 370 | 371 | foreach ( (array) $template_names as $template_name ) { |
| 371 | 372 | if ( !$template_name ) |
| … |
… |
|
| 380 | 381 | } |
| 381 | 382 | |
| 382 | 383 | if ( $load && '' != $located ) |
| 383 | | load_template( $located, $require_once ); |
| | 384 | load_template( $located, $require_once, $args ); |
| 384 | 385 | |
| 385 | 386 | return $located; |
| 386 | 387 | } |
| … |
… |
|
| 396 | 397 | * |
| 397 | 398 | * @param string $_template_file Path to template file. |
| 398 | 399 | * @param bool $require_once Whether to require_once or require. Default true. |
| | 400 | * @param array $args An array of arguments to control template handling. |
| 399 | 401 | */ |
| 400 | | function load_template( $_template_file, $require_once = true ) { |
| | 402 | function load_template( $_template_file, $require_once = true, $args = array() ) { |
| 401 | 403 | global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; |
| | 404 | |
| | 405 | if ( is_array( $args ) && isset( $args[ 'data' ] ) ) |
| | 406 | extract( $args[ 'data' ], EXTR_SKIP ); |
| 402 | 407 | |
| 403 | 408 | if ( is_array( $wp_query->query_vars ) ) |
| 404 | 409 | extract( $wp_query->query_vars, EXTR_SKIP ); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 115 | 115 | * |
| 116 | 116 | * @param string $slug The slug name for the generic template. |
| 117 | 117 | * @param string $name The name of the specialised template. |
| | 118 | * @param array $args An array of arguments to control template handling. |
| 118 | 119 | */ |
| 119 | | function get_template_part( $slug, $name = null ) { |
| 120 | | do_action( "get_template_part_{$slug}", $slug, $name ); |
| | 120 | function get_template_part( $slug, $name = null, $args = array() ) { |
| | 121 | do_action( "get_template_part_{$slug}", $slug, $name, $args ); |
| 121 | 122 | |
| 122 | 123 | $templates = array(); |
| 123 | 124 | if ( isset($name) ) |
| … |
… |
|
| 125 | 126 | |
| 126 | 127 | $templates[] = "{$slug}.php"; |
| 127 | 128 | |
| 128 | | locate_template($templates, true, false); |
| | 129 | locate_template($templates, true, false, $args); |
| 129 | 130 | } |
| 130 | 131 | |
| 131 | 132 | /** |