Peter

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: PHP Notice when deleting images via wp_delete_attachment #1389572
    Peter
    Participant

    Hello Cliff,

    Sorry for the delay its been a crazy week.

    The only error that appears is:
    [23-Nov-2017 00:31:19 UTC] PHP Notice: Trying to get property of
    non-object in
    /srv/www/portlincoln/public_html/wp-content/plugins/events-calendar-pro/src/functions/template-tags/general.php
    on line 48

    This appears to only happen when deleting attachments,
    wp_delete_attachment( $attachment_id, true );

    I assume your tribe_is_recurring_event is being triggered when removing
    all posts? I have printed out the post object before line 48 calls it and
    it seems every second call the object is empty.

    in reply to: Tribe embed overriding youtube embed #1135812
    Peter
    Participant

    Ah fantastic thanks for that, fix is in place and working. Ill be sure to check the forums first next time, I was a bit lost when google had no results!

    in reply to: Displaying Next event date for a recurring event. #995281
    Peter
    Participant

    Hey Josh.

    That would be good if I could get a list like that, all that comes up for this site is a single envent. First image is what shows up when editing the page the ACF field is on, the second is the list of events in Events Calendar.


    null

    I have disabled most plugins and still the same result. What settings did you use for the ACF?

    in reply to: Displaying Next event date for a recurring event. #994911
    Peter
    Participant

    Really appreciate the help Josh I realise it is out of the scope of events calendar.

    Here is a screen shot of the ACF field and a code block from where its being displayed. If the field is page link then I have the option to select each of the occurrences but it would be ideal to get just the parent ID of the event set.

    null

    $post_id = get_field( 'event' );
    echo $post_id;
    	$events = tribe_get_events( array(
    		'p' => $post_id,
    	    'posts_per_page' => 1,
    	    'tribeHideRecurrence' => 1,
    	    'start_date' => new DateTime()
    	) );
    
    foreach ( $events as $post ):
    	setup_postdata( $post );
    ?>

    Thanks again Josh!

    in reply to: Displaying Next event date for a recurring event. #994645
    Peter
    Participant

    In the back end when selecting a which post (event) to display you are only able to see a single occurrence of a re-occurring event but when I echo out that value its serving the id of the final event in the series not the “global” id. Hope that makes sense!

    in reply to: Displaying Next event date for a recurring event. #993776
    Peter
    Participant

    Hello Josh,

    Thanks for the help, got a lot closer than before. Using the tribe_get_events() function I can get the next upcoming event fine but not to sure how to use that same function to target a specific reacuring event.

    Using

    $events = tribe_get_events( array(
    ‘p’ => $post_id,
    ‘posts_per_page’ => 1,
    ‘tribeHideRecurrence’ => 1,
    ‘start_date’ => new DateTime()
    ) );

    I get the right event but still only displaying the final date in the series. As I am using ACF to select the post ID I can only see the single event not individual events.

    On a side note, using the startdate new datetime I get “strtotime() expects parameter 1 to be string, object given”
    using that from this tute

Viewing 6 posts - 1 through 6 (of 6 total)