MP_Addon_OfflineConversions_Callback::get_period( string $period, string $before, string $after, string $date, string $year, string $month, string $day )

Get period.


Parameters Parameters

$period

(string) (Required) days, months or years.

$before

(string) (Required) end of period.

$after

(string) (Required) start of period.

$date

(string) (Required) date.

$year

(string) (Required) year.

$month

(string) (Required) month.

$day

(string) (Required) day.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: calculator-offline-conversions-add-on/inc/MP_Addon_OfflineConversions_Callback.php

	protected function get_period( $period, $before, $after, $date, $year, $month, $day ) {

		if ( null !== $period && null === $before || null === $after) {

			switch ($period) {
				case 'days':
					return $this->get_days_period( $year, $month, $day);
				case 'months':
					return $this->get_months_period( $year, $month );
				case 'years':
					return $this->get_years_period( $year );
			}
		}

		if ( null === $date ) {

			return $this->get_custom_period($before, $after);
		}

		return array();
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.