WordPress.org

Making WordPress.org

Opened 5 months ago

Last modified 5 months ago

#5759 new enhancement

Support Forums: Improve local environment support

Reported by: Clorith Owned by:
Milestone: Priority: normal
Component: Support Forums Keywords: has-patch
Cc:

Description

Currently the foums theme (and many other meta elements really), rely on the global header and footer fetched via a call to require WPORGPATH . 'header.php and require WPORGPATH . 'footer.php' respectively.

The global header is not open sourced, so to be able to replicate the environment locally, one would need to do something like define( 'WPORGPATH', 'https://wordpress.org/' ) and enable allow_url_fopen in PHP.

This works, but the header is then not aware of any enqueued assets or other scripts in the local environment that may need to trigger.

The attached patch adds a check if the header or footer actions have been ran in the support theme after requiring these global files, and will call wp_head() and wp_footer() if not.

Attachments (2)

5759.patch (1.8 KB) - added by Clorith 5 months ago.
5759.2.patch (888 bytes) - added by Clorith 5 months ago.

Download all attachments as: .zip

Change History (6)

@Clorith
5 months ago

#1 @Clorith
5 months ago

  • Keywords has-patch added

@Clorith
5 months ago

#2 @Clorith
5 months ago

In addition to 5759.patch providing the header and footer code as mentioned, 5759.2.patch improves local development by adding a grunt script runner to the package.json. This allows contributors to use grunt directly from the project dependencies, instead of needing to install it globally.

#3 @dd32
5 months ago

The wporg theme which is intended on being used as a "base theme" provides a fall-back for the header/footer, could this be merged with that approach instead?

Unfortunately not all themes use that as the theme template, but I think it'd be worthwhile considering.

#4 @Clorith
5 months ago

That's a thought indeed, and I agree with you that sounds like a much cleaner solution if there's already a fallback in there.

(probably something worth checking if can be done on a grander scale for all themes when possible to ease the process for others as well?)

Note: See TracTickets for help on using tickets.