Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#43515 new enhancement

Twenty Seventeen: Two different function, which return same result

Reported by: mukesh27 Owned by:
Milestone: Awaiting Review Priority: low
Severity: normal Version:
Component: Bundled Theme Keywords: dev-feedback
Focuses: Cc:


Many apologies if this is a duplicate. I have searched but did not find it yet posted.

Theme: Twenty Seventeen
Version: 1.4 (not tested below 1.4)

The theme have two different functions twentyseventeen_is_frontpage and twentyseventeen_is_static_front_page both have return same result so why we create two different function as both function return same result? They have to remove "twentyseventeen_is_static_front_page" function use in one place.

Attachments (1)

43515.patch (924 bytes) - added by mukesh27 4 years ago.

Download all attachments as: .zip

Change History (7)

4 years ago

#1 @mukesh27
4 years ago

  • Keywords has-patch added
  • Version 4.9.4 deleted

#3 @mukesh27
4 years ago

  • Keywords dev-feedback added

@soulseekah above both link are not working.

My question is below both the functions return same result then wy should we use two different function?

twentyseventeen_is_static_front_page function

function twentyseventeen_is_static_front_page() {
   return ( is_front_page() && ! is_home() );

twentyseventeen_is_frontpage function

function twentyseventeen_is_frontpage() {
   return ( is_front_page() && ! is_home() );

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

4 years ago

#5 @swissspidy
4 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed
  • Priority changed from normal to low

@mukesh27 You need to be logged in on GitHub in order for the links to work.

This should rather look something like this (or the other way around):

function twentyseventeen_is_frontpage() {
  return twentyseventeen_is_static_front_page();

#6 @mukesh27
3 years ago

  • Keywords dev-feedback added; needs-patch removed
Note: See TracTickets for help on using tickets.