LLMS_Access_Plan::get_schedule_details()
Get a sentence explaining the plan’s payment schedule
Return Return
(string)
Source Source
File: includes/models/model.llms.access.plan.php
$ret = '';
$period = $this->get( 'period' );
$frequency = $this->get( 'frequency' );
$length = $this->get( 'length' );
// One-time payments don't display anything here unless filtered.
if ( $frequency > 0 ) {
if ( 1 === $frequency ) {
$ret = sprintf( _x( 'per %s', 'subscription schedule', 'lifterlms' ), $this->get_access_period_name( $period, $frequency ) );
} else {
$ret = sprintf( _x( 'every %1$d %2$s', 'subscription schedule', 'lifterlms' ), $frequency, $this->get_access_period_name( $period, $frequency ) );
}
// Add length sentence if applicable.
if ( $length > 0 ) {
$ret .= ' ' . sprintf( _x( 'for %1$d total payments', 'subscription # of payments', 'lifterlms' ), $length );
}
}
return apply_filters( 'llms_get_product_schedule_details', sprintf( $ret, $this->get( 'period' ), $frequency, $length ), $this );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |