BP_Email_Tokens::token__group_description( BP_Email $bp_email, array $formatted_tokens, array $tokens )
Generate the output for token group.description
Description
Parameters
- $bp_email
-
(BP_Email) (Required)
- $formatted_tokens
-
(array) (Required)
- $tokens
-
(array) (Required)
Return
(string) html for the output
Source
File: bp-core/classes/class-bp-email-tokens.php
public function token__group_description( $bp_email, $formatted_tokens, $tokens ) { $group_id = false; $output = ''; if ( ! bp_is_active( 'groups' ) ) { return ''; } $group = isset( $tokens['group'] ) ? $tokens['group'] : false; if ( empty( $group ) ) { $group_id = isset( $tokens['group.id'] ) ? $tokens['group.id'] : false; if ( empty( $group_id ) ) { return $output; } $group = groups_get_group( $group_id ); } $group_excerpt = bp_get_group_description_excerpt( $group ); if ( empty( $group ) || empty( $group_excerpt ) ) { return $output; } $settings = bp_email_get_appearance_settings(); ob_start(); ?> <div class="spacer" style="font-size: 5px; line-height: 5px; height: 5px;"> </div> <table cellspacing="0" cellpadding="0" border="0" width="100%" style="background: <?php echo esc_attr( $settings['quote_bg'] ); ?>; border: 1px solid <?php echo esc_attr( $settings['body_border_color'] ); ?>; border-radius: 4px; border-collapse: separate !important"> <tbody> <tr> <td height="5px" style="font-size: 5px; line-height: 5px;"> </td> </tr> <tr> <td align="center"> <table cellpadding="0" cellspacing="0" border="0" width="88%" style="width: 88%;"> <tbody> <tr> <td> <div style="color: <?php echo esc_attr( $settings['body_text_color'] ); ?>; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>; letter-spacing: -0.24px; line-height: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.625 ) . 'px' ) ?>;"> <?php echo wpautop( $group_excerpt ); ?> </div> </td> </tr> </tbody> </table> </td> </tr> <tr> <td height="5px" style="font-size: 5px; line-height: 5px;"> </td> </tr> </tbody> </table> <div class="spacer" style="font-size: 30px; line-height: 30px; height: 30px;"> </div> <?php $output = str_replace( array( "\r", "\n" ), '', ob_get_clean() ); return $output; }
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.