Ticket #37655: 37655.2.diff
| File 37655.2.diff, 2.0 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/template.php
175 175 $templates = array(); 176 176 177 177 if ( ! empty( $category->slug ) ) { 178 179 $slug_decoded = urldecode( $category->slug ); 180 if ( $slug_decoded !== $category->slug ) { 181 $templates[] = "category-{$slug_decoded}.php"; 182 } 183 178 184 $templates[] = "category-{$category->slug}.php"; 179 185 $templates[] = "category-{$category->term_id}.php"; 180 186 } … … 205 211 $templates = array(); 206 212 207 213 if ( ! empty( $tag->slug ) ) { 214 215 $slug_decoded = urldecode( $tag->slug ); 216 if ( $slug_decoded !== $tag->slug ) { 217 $templates[] = "tag-{$slug_decoded}.php"; 218 } 219 208 220 $templates[] = "tag-{$tag->slug}.php"; 209 221 $templates[] = "tag-{$tag->term_id}.php"; 210 222 } … … 241 253 242 254 if ( ! empty( $term->slug ) ) { 243 255 $taxonomy = $term->taxonomy; 256 257 $slug_decoded = urldecode( $term->slug ); 258 if ( $slug_decoded !== $term->slug ) { 259 $templates[] = "taxonomy-$taxonomy-{$slug_decoded}.php"; 260 } 261 244 262 $templates[] = "taxonomy-$taxonomy-{$term->slug}.php"; 245 263 $templates[] = "taxonomy-$taxonomy.php"; 246 264 } … … 335 353 $templates = array(); 336 354 if ( $template && 0 === validate_file( $template ) ) 337 355 $templates[] = $template; 338 if ( $pagename ) 356 if ( $pagename ) { 357 $pagename_decoded = urldecode( $pagename ); 358 if ( $pagename_decoded !== $pagename ) { 359 $templates[] = "page-{$pagename_decoded}.php"; 360 } 339 361 $templates[] = "page-$pagename.php"; 362 } 340 363 if ( $id ) 341 364 $templates[] = "page-$id.php"; 342 365 $templates[] = 'page.php'; … … 395 418 $templates = array(); 396 419 397 420 if ( ! empty( $object->post_type ) ) { 421 422 $name_decoded = urldecode( $object->post_name ); 423 if ( $name_decoded !== $object->post_name ) { 424 $templates[] = "single-{$object->post_type}-{$name_decoded}.php"; 425 } 426 398 427 $templates[] = "single-{$object->post_type}-{$object->post_name}.php"; 399 428 $templates[] = "single-{$object->post_type}.php"; 400 429 }