Changeset 55013
- Timestamp:
- 12/22/2022 11:06:10 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/template.php
r54747 r55013 691 691 * @param string|array $template_names Template file(s) to search for, in order. 692 692 * @param bool $load If true the template file will be loaded if it is found. 693 * @param bool $ require_onceWhether to require_once or require. Has no effect if `$load` is false.693 * @param bool $load_once Whether to require_once or require. Has no effect if `$load` is false. 694 694 * Default true. 695 695 * @param array $args Optional. Additional arguments passed to the template. … … 697 697 * @return string The template filename if one is located. 698 698 */ 699 function locate_template( $template_names, $load = false, $ require_once = true, $args = array() ) {699 function locate_template( $template_names, $load = false, $load_once = true, $args = array() ) { 700 700 $located = ''; 701 701 foreach ( (array) $template_names as $template_name ) { … … 716 716 717 717 if ( $load && '' !== $located ) { 718 load_template( $located, $ require_once, $args );718 load_template( $located, $load_once, $args ); 719 719 } 720 720 … … 745 745 * 746 746 * @param string $_template_file Path to template file. 747 * @param bool $ require_onceWhether to require_once or require. Default true.747 * @param bool $load_once Whether to require_once or require. Default true. 748 748 * @param array $args Optional. Additional arguments passed to the template. 749 749 * Default empty array. 750 750 */ 751 function load_template( $_template_file, $ require_once = true, $args = array() ) {751 function load_template( $_template_file, $load_once = true, $args = array() ) { 752 752 global $posts, $post, $wp_did_header, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; 753 753 … … 775 775 * 776 776 * @param string $_template_file The full path to the template file. 777 * @param bool $ require_onceWhether to require_once or require.777 * @param bool $load_once Whether to require_once or require. 778 778 * @param array $args Additional arguments passed to the template. 779 779 */ 780 do_action( 'wp_before_load_template', $_template_file, $ require_once, $args );781 782 if ( $ require_once ) {780 do_action( 'wp_before_load_template', $_template_file, $load_once, $args ); 781 782 if ( $load_once ) { 783 783 require_once $_template_file; 784 784 } else { … … 792 792 * 793 793 * @param string $_template_file The full path to the template file. 794 * @param bool $ require_onceWhether to require_once or require.794 * @param bool $load_once Whether to require_once or require. 795 795 * @param array $args Additional arguments passed to the template. 796 796 */ 797 do_action( 'wp_after_load_template', $_template_file, $ require_once, $args );798 } 797 do_action( 'wp_after_load_template', $_template_file, $load_once, $args ); 798 }
Note: See TracChangeset
for help on using the changeset viewer.