bp_get_email_subject( array $args = array() )

Retrieve a client friendly version of the root blog name.

Description

The blogname option is escaped with esc_html on the way into the database in sanitize_option, we want to reverse this for the plain text arena of emails.

See also

Parameters

$args

(Optional) Array of optional parameters.

  • 'before'
    (string) String to appear before the site name in the email subject. Default: '['.
  • 'after'
    (string) String to appear after the site name in the email subject. Default: ']'.
  • 'default'
    (string) The default site name, to be used when none is found in the database. Default: 'Community'.
  • 'text'
    (string) Text to append to the site name (ie, the main text of the email subject).

Default value: array()

Return

(string) Sanitized email subject.

Source

File: bp-core/bp-core-template.php

function bp_get_email_subject( $args = array() ) {

	$r = bp_parse_args( $args, array(
		'before'  => '[',
		'after'   => ']',
		'default' => __( 'Community', 'buddyboss' ),
		'text'    => ''
	), 'get_email_subject' );

	$subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text'];

	/**
	 * Filters a client friendly version of the root blog name.
	 *
	 * @since BuddyPress 1.7.0
	 *
	 * @param string $subject Client friendy version of the root blog name.
	 * @param array  $r       Array of arguments for the email subject.
	 */
	return apply_filters( 'bp_get_email_subject', $subject, $r );
}

Changelog

Changelog
Version Description
BuddyPress 2.5.0 No longer used by BuddyPress, but not deprecated in case any existing plugins use it. BuddyPress 2.5.0 No longer used by BuddyPress, but not deprecated in case any existing plugins use it.
BuddyPress 1.7.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.