WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 days ago

Last modified 2 days ago

#33857 closed feature request (wontfix)

Add new function the_home_url()

Reported by: miyauchi Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: template Cc:
PR Number:

Description

I am thinking theme should not have echo.
It enables <?php the_home_url() ?> so it is friendly for the theme designer.

Attachments (3)

33857.patch (729 bytes) - added by miyauchi 4 years ago.
33857.2.patch (756 bytes) - added by miyauchi 4 years ago.
33857.3.patch (744 bytes) - added by miyauchi 4 years ago.

Download all attachments as: .zip

Change History (7)

@miyauchi
4 years ago

#1 @miyauchi
4 years ago

  • Keywords has-patch added

@miyauchi
4 years ago

@miyauchi
4 years ago

This ticket was mentioned in Slack in #core by noisysocks. View the logs.


3 days ago

#3 @noisysocks
3 days ago

  • Resolution set to wontfix
  • Status changed from new to closed

Hey @miyauchi, thanks for the suggestion and for the patch! This was discussed during a triage session (see Slack link above) and it was decided that we don't want to add this new API, because:

  • the_{thing} functions are for outputting big sections of HTML e.g. in a template, not strings like the one returned by home_url.
  • The naming convention for these functions is that there is the_{thing} and get_the_{thing}, but adding this would make it so that there is the_{thing} and {thing}.
  • Themes don't need this very often.

I'm going to close this out as wontfix for now.

#4 @SergeyBiryukov
2 days ago

  • Component changed from General to Themes
  • Focuses template added
Note: See TracTickets for help on using tickets.