WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#40367 closed feature request (wontfix)

Proposal for a new functions file to add and manage custom hooks.

Reported by: adhun Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords: close
Focuses: Cc:

Description

Even being a hardcore WordPress developer, we all have had to use one of those free or premium theme to make some websites quick and hassle-free. In most cases, we place our custom patches/hooks on our theme's functions.php in order to achieve the site-specific requirements. That’s literally modifying a theme file. It will get replaced when the theme is updated. I think there should be a better way to handle this. Introducing a global custom-functions file that's independent of themes and plugins would fix the issue. I would really love your thoughts on this.

Change History (5)

#1 @swissspidy
2 years ago

  • Component changed from General to Themes
  • Focuses accessibility template performance removed

I think there should be a better way to handle this.

Have you tried using a child theme? That's what they were built for.

Introducing a global custom-functions file that's independent of themes and plugins would fix the issue.

Well, there's my-hacks.php (please don't use that one though!)

Last edited 2 years ago by swissspidy (previous) (diff)

#2 @jadpm
2 years ago

Introducing a global custom-functions file that's independent of themes and plugins would fix the issue.

I would say that mu plugins are the very definition of that?

#3 @swissspidy
2 years ago

  • Keywords close added

#4 @johnbillion
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks for the ticket, @adhun. This is precisely why child themes were introduced, so you can take a theme and use it as a parent theme and then place your customisations into a child theme.

#5 @adhun
2 years ago

Thanks all for the valuable suggestions.

Note: See TracTickets for help on using tickets.