public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Work out if the user can access this content yet (based on dripfeed access).
		 *
		 * @return Array Contains details if content is locked or not, and the unlock date.
		 */
Work out if the user can access this content yet (based on dripfeed access).
@return Array Contains details if content is locked or not, and the unlock date.
Work out if the user can access this content yet ( based on dripfeed access ) . @return Array Contains details if content is locked or not and the unlock date .
public function render_completionBox_contentLockedDueToDripfeed() {
			$lockDetails = array(
				'content_locked' => false,
				'unlock_date'    => false,
			);
			$unitMeta = WPCW_units_getUnitMetaData( $this->unitPost->ID );
			if ( ! $unitMeta ) {
				return $lockDetails;
			}
			$isContentLocked = false;
			switch ( $unitMeta->unit_drip_type ) {
				case 'drip_interval':    
				case 'drip_specific':
					$futureDate = WPCW_users_getUnitUnlockDate_forUser( $this->currentUserID, $unitMeta );
					if ( $futureDate > current_time( 'timestamp' ) ) {
						$lockDetails['content_locked'] = true;
						$lockDetails['unlock_date']    = $futureDate;
					}
					break;
				default:
					$lockDetails['content_locked'] = false;
					break;
			}
			return $lockDetails;
		}
public function render_completionBox_contentLockedDueToDripfeed ( ) { $ lockDetails = array ( 'content_locked' => false , 'unlock_date' => false , ) ; $ unitMeta = WPCW_units_getUnitMetaData ( $ this -> unitPost -> ID ) ; if ( ! $ unitMeta ) { return $ lockDetails ; } $ isContentLocked = false ; switch ( $ unitMeta -> unit_drip_type ) { case 'drip_interval' : case 'drip_specific' : $ futureDate = WPCW_users_getUnitUnlockDate_forUser ( $ this -> currentUserID , $ unitMeta ) ; if ( $ futureDate > current_time ( 'timestamp' ) ) { $ lockDetails [ 'content_locked' ] = true ; $ lockDetails [ 'unlock_date' ] = $ futureDate ; } break ; default : $ lockDetails [ 'content_locked' ] = false ; break ; } return $ lockDetails ; }
Work out if the user can access this content yet (based on dripfeed access).
Work out if the user can access this content yet ( based on dripfeed access ) .
// Need meta data to determine if the user can access this unit or not. // Got no meta data (which is odd), so let them pass. // See if we have a specific dripfeed type to look for. // Fixed time period between 2 dates // Work out when this unit is unlocked. // Future date is in the future, so it's locked. // Any other status (so not dripfeeding).