WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 10 months ago

#38718 closed feature request (wontfix)

Code Snippets function in core

Reported by: lukecavanagh Owned by:
Milestone: Priority: low
Severity: normal Version:
Component: Customize Keywords: 2nd-opinion
Focuses: Cc:

Description

If a user was not using a custom theme or a child theme for their parent theme, then having code snippets in core, would be handy way to add in PHP code snippets, instead of adding in the code into the functions.php of the active theme. Not all users would think about adding that code into site specific plugins either.

Change History (4)

#1 @celloexpressions
4 years ago

  • Keywords 2nd-opinion added
  • Priority changed from normal to low

I'm not quite sure what you're suggesting @lukecavanagh. Is the idea essentially to offer something similar to custom CSS but for PHP?

I'm not sure that that would be appropriate for core given the much higher likelihood of seriously breaking a site. It would be good to see a plugin version as a proof of concept before considering whether there's enough of a use case to justify core inclusion.

#2 @lukecavanagh
4 years ago

@celloexpressions

Correct something simlar to custom CSS but for PHP. Where the use case is code snippets.

I am suggesting something similar to say https://wordpress.org/plugins/code-snippets/

So where a user is not using a child theme, so not adding in code snippets into the functions.php and wanted to add in code snippets for minor changes to there site.

Last edited 4 years ago by lukecavanagh (previous) (diff)

#3 @dlh
10 months ago

  • Version 4.6.1 deleted

Would such a feature be possible without the use of eval(), which is prohibited by the core coding standards?

comment:1 expresses the right level of skepticism, it seems to me, but perhaps someone else sees a path forward?

#4 @dlh
10 months ago

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

Closing per comment:1 and comment:3.

Note: See TracTickets for help on using tickets.