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

    (@angelo_nwl)

    hi,

    maybe you can try to check php file under wp-fullcalendar/wp-fullcalendar.php

    Thread Starter Marie Comet

    (@chaton666)

    Hi,
    Thanks for your response but i found the solution.

    @chaton666

    Hi,
    Can you share your solution, please?
    thanks

    Thread Starter Marie Comet

    (@chaton666)

    Hi @nbatteur
    You need to create your own function (in your child-theme), in this function get your ACF custom field value with get_field('your_custom_field_name', $post_id); and define this for $item variable, return this variable and finally add filter to wpfc_ajax_post function.
    Be carreful with the format which be returned by your ACF custom field date.
    It will be the same format as the format used by the extension.

    Hi guys,
    I was using PODS to create my custom fields and was able to get the start and end date from the custom fields by adding the following code in my functions.php

    function event_calender_custom_dates($item, $post){
    		$id = $post->ID;
    		$title = get_the_title($post->ID);
    		$color = "#ad1213";
    		$trade_event = pods("trade_events", $id);
    		$date_from = $trade_event->field("event_date");
    		$date_to = $trade_event->field("to_date");
    	    $post_timestamp = strtotime($date_from);
    	    $end_timestamp = strtotime($date_to);
    		$item = array ("title" => $title, "color" => $color, "start" => date('Y-m-d\TH:i:s', $post_timestamp), "end" => date('Y-m-d\TH:i:s', $end_timestamp), "url" => get_permalink($post->ID), 'post_id' => $post->ID );
    		return $item;
    	}
    	add_filter('wpfc_ajax_post', 'event_calender_custom_dates', 10, 2);

    if someone is using ACF, then replace the pods part with get_field(‘your_custom_field_name’, $post_id)

    Good Luck.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘add_filter on wpfc_ajax_post ?’ is closed to new replies.