diff --git wp-includes/general-template.php wp-includes/general-template.php
index 48b8de9..bf83178 100644
|
|
function get_sidebar( $name = null ) { |
148 | 148 | * @param string $name The name of the specialised template. |
149 | 149 | */ |
150 | 150 | function get_template_part( $slug, $name = null ) { |
| 151 | |
| 152 | /** |
| 153 | * Filters whether get_template_part() will continue |
| 154 | * |
| 155 | * @since 4.4.0 |
| 156 | * |
| 157 | * @param bool Whether get_template_part will continue to locate the template part |
| 158 | * @param string $slug The slug name for the generic template. |
| 159 | * @param string $name The name of the specialised template. |
| 160 | */ |
| 161 | $get_template_part = apply_filters( "get_template_part_{$slug}", true, $slug, $name ); |
| 162 | |
| 163 | if ( ! $get_template_part ) { |
| 164 | return; |
| 165 | } |
| 166 | |
151 | 167 | /** |
152 | 168 | * Fires before the specified template part file is loaded. |
153 | 169 | * |
… |
… |
function get_template_part( $slug, $name = null ) { |
163 | 179 | |
164 | 180 | $templates = array(); |
165 | 181 | $name = (string) $name; |
166 | | if ( '' !== $name ) |
| 182 | if ( '' !== $name ) { |
167 | 183 | $templates[] = "{$slug}-{$name}.php"; |
| 184 | } |
168 | 185 | |
169 | 186 | $templates[] = "{$slug}.php"; |
170 | 187 | |
171 | | locate_template($templates, true, false); |
| 188 | locate_template( $templates, true, false ); |
| 189 | |
| 190 | /** |
| 191 | * Fires after the specified template part file is loaded. |
| 192 | * |
| 193 | * The dynamic portion of the hook name, `$slug`, refers to the slug name |
| 194 | * for the generic template part. |
| 195 | * |
| 196 | * @since 4.4.0 |
| 197 | * |
| 198 | * @param string $slug The slug name for the generic template. |
| 199 | * @param string $name The name of the specialized template. |
| 200 | */ |
| 201 | do_action( "after_get_template_part_{$slug}", $slug, $name ); |
172 | 202 | } |
173 | 203 | |
174 | 204 | /** |