llms_get_form_title( string $location, array $args = array() )

Retrieve the title of a form at a given location.


Description Description

Returns an empty string if the form is disabled via form settings.


Top ↑

Parameters Parameters

$location

(string) (Required) Form location, one of: "checkout", "registration", or "account".

$args

(array) (Optional) Additional arguments passed to the short-circuit filter in LLMS_Forms->get_form_post().

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

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

 */
function llms_get_form_title( $location, $args = array() ) {

	$post = llms_get_form( $location, $args );
	if ( ! $post || ! llms_parse_bool( get_post_meta( $post->ID, '_llms_form_show_title', true ) ) ) {
		return '';
	}

	return 'checkout' === $location && isset( $args['plan'] ) && $args['plan']->is_free()
		?
		apply_filters( 'the_title', get_post_meta( $post->ID, '_llms_form_title_free_access_plans', true ), $post->ID )
		:
		get_the_title( $post->ID );



Top ↑

Changelog Changelog

Changelog
Version Description
5.10.0 Return specific form title for checkout forms and free access plans.
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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