eo_get_event_archive_link
since 1.7.0
eo_get_event_archive_link( $year = false, $month = false, $day = false )
Returns an the link for the event archive.
Optionally provide the year , or month or day to get an year/month/day archive link.
To get a month archive you should provide a year. To get a day archive you should
provide a year and month.
You can also just pass one argument: a DateTime object, which used to get the archive
link for that specific date.
Example
On a year archive page, show a link to the following year.
if( eo_is_event_archive( 'year' ) ){
$current_year = (int) eo_get_event_archive_date('Y');
$next_year = $current_year + 1;
print_r( 'You are viewing %s. <a href="%s"> Click here to view events in %s </a>',
$current_year,
eo_get_event_archive_link( $next_year ),
$next_year
);
}
Parameters
int|\DateTime
|
$year = false |
Year in full format, e.g. 2018. Or a a DateTime object used to determine the year, month and day. Must be provide for date-based archive link.
|
int
|
$month = false |
Numeric representation of month. 1 = Jan, 12 = Dec. Must be provide for month or day archive link
|
int
|
$day = false |
Day of the month 1-31
|
Return value
string
|
Link to the requested archive
|
Changelog