llms_get_post_sales_page_content( WP_Post $post, string $default = '' )

Retrieve the sales page content for a course or membership


Description Description

By default only courses and memberships support sales pages, the meta property must be set to content or an empty string, and the post must have a post_excerpt property value.


Top ↑

Parameters Parameters

$post

(WP_Post) (Required) The post object.

$default

(string) (Optional) Default content to use when no override content can be found.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/functions/llms-functions-content.php

function llms_get_post_sales_page_content( $post, $default = '' ) {

	$content = $default;

	if ( post_type_supports( $post->post_type, 'llms-sales-page' ) ) {
		$sales_page = get_post_meta( $post->ID, '_llms_sales_page_content_type', true );
		if ( $post->post_excerpt && ( '' === $sales_page || 'content' === $sales_page ) ) {
			add_filter( 'the_excerpt', array( $GLOBALS['wp_embed'], 'autoembed' ), 9 );
			$content = llms_get_excerpt( $post->ID );
		}
	}

	/**
	 * Filters the HTML content of a LifterLMS post type's sales page content
	 *
	 * @since 4.17.0
	 *
	 * @param string  $content HTML content of the sales page.
	 * @param WP_Post $content Post object.
	 * @param string  $default Default content used when no override content can be found.
	 */
	return apply_filters( 'llms_post_sales_page_content', $content, $post, $default );

}


Top ↑

Changelog Changelog

Changelog
Version Description
4.17.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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