[buddypress-trac] [BuddyPress Trac] #6610: BP Attachments API should allow plugins to use their own custom templates in WP Admin

buddypress-trac noreply at wordpress.org
Thu Sep 3 15:22:51 UTC 2015


#6610: BP Attachments API should allow plugins to use their own custom templates
in WP Admin
-------------------------------------+--------------------
 Reporter:  imath                    |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  2.4
Component:  Component - Attachments  |     Version:  2.3.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch                |
-------------------------------------+--------------------

Comment (by boonebgorges):

 >  Because if the filter happens before, then one of our template could be
 overriden inside our context.

 Yeah, but that's what I mean about your suggestion being very restrictive.
 Adding an overly-specific filter here doesn't seem like a sustainable
 solution if we're going to keep introducing Backbone templates in
 BuddyPress.

 That being said, if we do decide to go with this, I find the filter name
 and by-reference technique you're using a little opaque. May I suggest
 something like following?

 {{{
 /**
  * Filters the fallback attachment template used in the Dashboard when no
 core template is found.
  *
  * Plugin authors should use this to provide their own additional
 attachment tempalates.
  *
  * @since whenever
  * @param string $fallback_template Template path.
  */
 $fallback_template = apply_filters(
 'bp_attachments_get_fallback_template_path', '', $slug,
 $attachment_template_part );
 if ( $fallback_template && file_exists( $fallback_template ) ) {
     ...
 }}}
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6610#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list