LLMS_Access_Plan::get_enroll_text( boolean $verbose = false )
Retrieve the text displayed on “Buy” buttons Uses optional user submitted text and falls back to LifterLMS defaults if none is supplied
Parameters Parameters
- $verbose
-
(boolean) (Optional) If true, the text will be verbose and include the plan name for accessibility.
Default value: false
Return Return
(string)
Source Source
File: includes/models/model.llms.access.plan.php
public function get_enroll_text( $verbose = false ) {
// User custom text option.
$text = $this->get( 'enroll_text' );
if ( ! $text ) {
switch ( $this->get_product_type() ) {
case 'course':
$text = apply_filters( 'llms_course_enroll_button_text', __( 'Enroll', 'lifterlms' ), $this );
break;
case 'membership':
$text = apply_filters( 'llms_membership_enroll_button_text', __( 'Join', 'lifterlms' ), $this );
break;
}
}
// Build the verbose enroll text, if requested.
if ( $verbose ) {
$plan_name = $this->get( 'title' );
$text = sprintf( _x( '%1$s: Select the %2$s plan.', 'Verbose enrollment text', 'lifterlms' ), $text, $plan_name );
}
return apply_filters( 'llms_plan_get_enroll_text', $text, $this, $verbose );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 8.0.0 | Added $verbose parameter. |
| 3.0.0 | Introduced. |