bp_get_email_subject( array $args = array() )

Retrieve a client friendly version of the root blog name.


Description 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 See also


Top ↑

Parameters 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()


Top ↑

Return Return

(string) Sanitized email subject.


Top ↑

Source 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', 'buddypress' ),
		'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 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 );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 No longer used by BuddyPress, but not deprecated in case any existing plugins use it.
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.