Description
Return the base date from which the OTD dates are calculated
Usage
$string|null = bw_otd_base_date( $atts );Parameters
- $atts
- ( array ) required – shortcode parameters
Returns
string|null the current post date, selected date or null in format Y-m-d Current post / Conditional test Return is_multiple() nullSource
File name: oik-dates/shortcodes/oik-otd.phpLines:
1 to 22 of 22
function bw_otd_base_date( $atts ) { $base_date = ''; if ( !is_single() ) { } else { // Single - what is the post type? // same as one of the selected post types then we'll use the post's date // If NOT in the selection list then we don't use the post's date. // So we won't get confused when looking at event calendar entries which are posted on a particular date with a different event date. // @TODO - use the value of a date field from the selected post type rather than the post date $post = bw_global_post(); if ( $post ) { if ( false !== array_search( $post->post_type, $atts['post_type'] ) ) { $base_date = bw_otd_year() ; $base_date .= bw_format_date( $post->post_date, "-M-d" ); } } } return( $base_date ); }
Invoked by
Calls
1 to 2 of 2
Call hooks
API Letters:
