最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - how can I create a calendar for a cpt, using get_calendar or other

programmeradmin5浏览0评论

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.

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.

Share Improve this question asked Jul 15, 2011 at 18:15 TJ SherrillTJ Sherrill 5856 gold badges14 silver badges30 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

发布评论

评论列表(0)

  1. 暂无评论