WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#42273 new defect (bug)

Template_url calls index pge

Reported by: wassimo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.2
Component: Themes Keywords: reporter-feedback
Focuses: template Cc:

Description

get_bloginfo("template_url")

When i use the function with these arguments
The function calls index.php and then return the url

So u can fix that by stop calling index

Test the code with

Mkdir() << inside index.php

Then use the function in page.php or single.php template
And see!.

Hope u credit me for this bug

Wasim .

Change History (5)

#1 @SergeyBiryukov
2 years ago

  • Component changed from General to Themes
  • Focuses template added

#2 @ocean90
2 years ago

  • Keywords reporter-feedback added

Hello @wassimo, welcome to WordPress Trac!

Does it still happen with all plugins disabled and a default theme activated?

#3 follow-up: @SergeyBiryukov
2 years ago

I'm not sure I see the issue, get_bloginfo( 'template_url' ) calls get_template_directory_uri(), which works in all templates and does not depend on index.php in any way.

#4 in reply to: ↑ 3 ; follow-up: @wassimo
2 years ago

Replying to SergeyBiryukov:

I'm not sure I see the issue, get_bloginfo( 'template_url' ) calls get_template_directory_uri(), which works in all templates and does not depend on index.php in any way.

It calls index.php in the template

Tou can create empty index.php with function like mkdir
Then get_bloginfo with template _url
U can see it will calls index.php and create a folder

#5 in reply to: ↑ 4 @SergeyBiryukov
2 years ago

Replying to wassimo:

Tou can create empty index.php with function like mkdir
Then get_bloginfo with template _url
U can see it will calls index.php and create a folder

WordPress loads index.php as a part of the template hierarchy. If I put a mkdir() call there, it would always be executed, with or without get_bloginfo( 'template_url' ). I don't see a bug here.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.