Support » Plugin: WP FullCalendar » Advanced Custom Fields Date instead of Post Date

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thanks. But nothing new 😛

    Nice! How the hell did I miss that?

    I had to do this same thing but I didn’t want to modify the plugin core. In my case start time and end time was the same value and I used a custom field for both date and time. I ended up doing it this way:

    Inside functions.php

    if(class_exists("WP_FullCalendar")) {
    	//Remove the custom where clause before the calendar query is executed
    	function remove_posts_where() {
    	    remove_filter( 'posts_where', 'wpfc_temp_filter_where' );
    	add_action('wpfc_before_wp_query', 'remove_posts_where', 10);
            //Override the item timestamp
    	function change_item_date($item, $post) {
    		$new_post_timestamp = date("Y-m-d\TH:i:s", strtotime(get_field('date', $post->ID) . ' ' . get_field('time', $post->ID)));
    		$item['start'] = $new_post_timestamp;
    		$item['end'] = $new_post_timestamp;
    		return $item;
    	add_filter('wpfc_ajax_post', 'change_item_date', 10, 2);
    • This reply was modified 3 years, 6 months ago by DanShedd.

    I cannot get it to work with this snippet, no matter what I tried.
    CHanged value of some Posts and resaved them, just to exclude transients caching.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Advanced Custom Fields Date instead of Post Date’ is closed to new replies.