WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 6 months ago

#20509 new feature request

Theme idea - generic.php — at Version 1

Reported by: johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Themes Keywords: needs-patch dev-feedback
Focuses: Cc:

Description (last modified by johnjamesjacoby)

Problem: How do plugins that introduce completely new functionality (I.E. BuddyPress/bbPress) interface with themes, without needing to move template files directly into a theme's folder?

Solution: generic.php


generic.php would be a template file that includes skeletal layout of the theme. In place of the content and the comment logic, is an action; for the sake of discussion, let's name this action 'generic_content'

A concept file is attached for twentyeleven.

This type of ability would help prevent a ton of additional processing that plugins currently need to do to hi-jack the_content output and noop the comment stream, in situations where a plugin needs to output HTML into the main content area of a theme.

Rather than guessing at template names, and hoping 'page.php' or 'index.php' will be close enough, a convention of having themes come with a dedicated template for plugin compatibility would be incredibly helpful.

BuddyPress components have a similar convention already, with a plugin.php having only the header, footer, sidebar, and generic action in them.

The use case is currently small, and there's very little (if anything) needed in WordPress core to make this work. Wanted to post the idea here to get some developer talk going, and get opinions on other possible approaches.

Change History (2)

johnjamesjacoby2 years ago

comment:1 johnjamesjacoby2 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.