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.
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: ''
Return Return
(string)
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 ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.17.0 | Introduced. |