BP_Email::get_preheader()

Get email preheader.


Source Source

File: bp-core/classes/class-bp-email.php

	public function get_preheader() {
		if ( null !== $this->preheader ) {
			return $this->preheader;
		}

		$preheader = '';

		$post = $this->get_post_object();
		if ( $post ) {
			$switched = false;

			// Switch to the root blog, where the email post lives.
			if ( ! bp_is_root_blog() ) {
				switch_to_blog( bp_get_root_blog_id() );
				$switched = true;
			}

			$preheader = sanitize_text_field( get_post_meta( $post->ID, 'bp_email_preheader', true ) );

			if ( $switched ) {
				restore_current_blog();
			}
		}

		$this->preheader = $preheader;

		return $this->preheader;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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