how can I create a calendar for a cpt, using get_calendar or other

by TJ Sherrill   Last Updated June 13, 2019 07:08 AM

I have a custom post type with its own date field. the date is setup for unix YYYY/mm/dd

I need to create a simple month calendar that shows days that have a cpt on them. get_calendar works for posts but not a CPT.



Answers 1


Disclaimer: I have not tested this out myself.

It looks like you will have to hook the calendar and push your content into it. The filter that gets called by the calendar is get_calendar.

So, at a guess, something like this:

function filter_get_calendar( $cache_key ) { 
    // Do awesome things here... 
    return $cache_key; 
}; 

// add the filter 
add_filter( 'get_calendar', 'filter_get_calendar', 10, 1 ); 

I hope that helps.

Matthew Brown aka Lord Matt
Matthew Brown aka Lord Matt
June 13, 2019 06:40 AM

Related Questions


Updated March 09, 2017 21:08 PM

Updated November 25, 2016 08:03 AM

Updated July 14, 2017 18:08 PM

Updated April 24, 2016 08:03 AM