Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 10 years ago

#2557 closed defect (bug) (fixed)

Allow customized HTML elements in bbp_get_topic_author_role

Reported by: netweb's profile netweb Owned by: netweb's profile netweb
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5
Component: Component - Users Keywords: has-patch
Cc:

Description

Previously the <div> HTML element was hardcoded and you could only change the CSS class with bbp_parse_args

<?php bbp_topic_author_role( array( 'before' => '<p>', 'class' => 'bbp-author-role', 'after' => '</p>' ) ); ?>

The above would render as <p><div class="bbp-author-role">Keymaster</div></p>

Now before defaults to <div class="bbp-author-role"> and after defaults to </div>

Thus now:

<?php bbp_topic_author_role( array( 'before' => '<p>', 'after' => '</p>' ) ); ?>

Now the above renders as <p>Keymaster</p> and brings bbp_get_topic_author_role before/after functionality similar to other (majority) bbPress functions.

Attachments (1)

2557.diff (928 bytes) - added by netweb 10 years ago.

Download all attachments as: .zip

Change History (5)

@netweb
10 years ago

#1 @netweb
10 years ago

  • Milestone changed from Awaiting Review to 2.6

Just did something similar for bbp_author_ip in #2519, moving to 2.6

#2 @netweb
10 years ago

  • Owner set to netweb
  • Version set to 2.5

This ticket was mentioned in IRC in #bbpress-dev by netweb. View the logs.


10 years ago

#4 @johnjamesjacoby
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 5513:

Simplify topic & reply author role markup arguments, with backpat support. Props netweb. Fixes #2557.

Note: See TracTickets for help on using tickets.