LLMS_Order::get_access_expiration_date( string $format = 'Y-m-d' )
Determine the date when access will expire
Description Description
Based on the access settings of the access plan at the $start_date
of access.
Parameters Parameters
- $format
-
(string) (Optional) Date format. Default is 'Y-m-d'.
Default value: 'Y-m-d'
Return Return
(string) Date string. "Lifetime Access" for plans with lifetime access. "To be Determined" for limited date when access hasn't started yet.
Source Source
File: includes/models/model.llms.order.php
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | public function get_access_expiration_date( $format = 'Y-m-d' ) { $type = $this ->get( 'access_expiration' ); $ret = $this ->get_date( 'date_access_expires' , $format ); if ( ! $ret ) { switch ( $type ) { case 'lifetime' : $ret = __( 'Lifetime Access' , 'lifterlms' ); break ; case 'limited-date' : $ret = date_i18n( $format , ( $this ->get_date( 'access_expires' , 'U' ) + ( DAY_IN_SECONDS - 1 ) ) ); break ; case 'limited-period' : if ( $this ->get( 'start_date' ) ) { $time = strtotime ( '+' . $this ->get( 'access_length' ) . ' ' . $this ->get( 'access_period' ), $this ->get_date( 'start_date' , 'U' ) ) + ( DAY_IN_SECONDS - 1 ); $ret = date_i18n( $format , $time ); } else { $ret = __( 'To be Determined' , 'lifterlms' ); } break ; default : $ret = apply_filters( 'llms_order_' . $type . '_access_expiration_date' , $type , $this , $format ); } } return apply_filters( 'llms_order_get_access_expiration_date' , $ret , $this , $format ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.19.0 | Unknown. |
3.0.0 | Introduced. |