Support » Plugin: WP FullCalendar » Is it possible to feed custom field dates from custom post types to calendar ?

  • Hi, is it possible to feed dates from custom fields from various different custom post types to the calendar so that it shows those dates instead of post publish dates ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    Sorry, but at the moment this is not yet possible or available.

    snippet24

    (@snippet24)

    Oh that would be great!! Well in my case I have set custom fields for default post types but within a specific category.. Hope this feature gets implemented 🙂

    • This reply was modified 1 year ago by snippet24.

    Hi,

    this code works for me

    //Remove the custom where clause before the calendar query is executed
    function hubbubart_calendar_remove_posts_where() {
    remove_filter( ‘posts_where’, ‘wpfc_temp_filter_where’ );
    }
    add_action(‘wpfc_before_wp_query’, ‘hubbubart_calendar_remove_posts_where’, 10);

    //Override the item timestamp
    function change_calendar_item_date($item, $post) {
    $debut = date(“Y-m-d\TH:i:s”, strtotime(get_field(‘debut’, $post->ID) .’ ‘ .’00:00:00’));
    $fin = date(“Y-m-d\TH:i:s”, strtotime(get_field(‘fin’, $post->ID) .’ ‘ .’24:00:00’));

    $item[‘start’] = $debut;
    $item[‘end’] = $fin;

    return $item;
    }
    add_filter(‘wpfc_ajax_post’, ‘change_calendar_item_date’, 10, 2);

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to feed custom field dates from custom post types to calendar ?’ is closed to new replies.