[buddypress-trac] [BuddyPress] #2198: bp_core_load_template does not load plugin's sub-templates
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Mon Mar 15 21:50:52 UTC 2010
#2198: bp_core_load_template does not load plugin's sub-templates
--------------------+-------------------------------------------------------
Reporter: DJPaul | Owner: DJPaul
Type: defect | Status: new
Priority: minor | Milestone: 1.2.3
Component: Core | Keywords:
--------------------+-------------------------------------------------------
You use bp_core_load_template() in a plugin to load a theme file, using
the filter 'bp_located_template'.
If you're modelling your plugin on the default BuddyPress components, or
even the skeleton component, you could use the above to load an index page
for your directory, and use a "loop" file to display each item within your
directory index page.
However, the whole purposes of the 'bp_located_template' filter is that it
allows theme authors to override your plugin's theme file by adding it to
their WordPress theme's directory. The problem is that you cannot use
bp_located_template() to include your loop file (henceforth referred to as
a "plugin sub-template").
Why? Because bp_core_load_template() just sets up the data for the
template to load; nothing happens until the WordPress 'template_redirect'
action is called, which only happens once on page load (.e. when it loads
your index page).
--
Ticket URL: <http://trac.buddypress.org/ticket/2198>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list