[buddypress-trac] [BuddyPress Trac] #6486: 'bp_template_title' h3 element should be more selectable/flexible

buddypress-trac noreply at wordpress.org
Wed Jun 10 18:53:29 UTC 2015

#6486: 'bp_template_title' h3 element should be more selectable/flexible
 Reporter:  boonebgorges                 |      Owner:
     Type:  defect (bug)                 |     Status:  new
 Priority:  normal                       |  Milestone:  2.4
Component:  Appearance - Template Parts  |    Version:
 Severity:  normal                       |   Keywords:
 When using members/single/plugins.php to display custom component content,
 there's a bit of markup that looks like this:

 <h3><?php do_action( 'bp_template_title' ) ?></h3>

 To create a title for this kind of page, you `add_action(
 'bp_template_title', 'my_component_page_title' );` and echo your title.

 Aside from being generally inelegant, this system poses problems for
 plugins that want to omit a title. If you don't hook anything to
 `'bp_template_title'`, you get an empty `<h3></h3>` element, which takes
 up vertical space. There's not even a great way to hide it using CSS,
 because it doesn't have any specific selectors.

 I suggest first that we add a selector - something like `class="bp-plugin-
 page-title"`. Better suggestions for selector names are welcome.

 Better still, but more complicated: we should not show the `<h3>` element
 if there's nothing to put inside of it. Not sure how to do this without
 breaking  backward compatibility. Maybe: fire 'bp_template_title' in an
 output buffer, and check its content before generating the markup.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6486>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list