Matthew Batchelder
Forum Replies Created
-
Forum: Plugins
In reply to: [The Events Calendar] Programatically Create and Update EventsAh, good findings! This will generate the occurrences after post creation (which will then allow tribe_events() to work its magic):
tribe()->make( \TEC\Events\Custom_Tables\V1\Repository\Events::class )->update( $event_id, [] );
This brings up an excellent point that we should create either a helper function that allows for the generation/saving of event occurrences and/or do that by default in
tribe_events()
when saving! Thank you for exploring this here.As for that other finding – I’ll pass that info to the team to look into more deeply.
Forum: Plugins
In reply to: [The Events Calendar] Programatically Create and Update EventsIn the above snippet, it looks like there are missing quotes after each of the dates and the timezone. I was able to run an update just like yours and it succeeded once I fixed the missing quotes.
I have made a note on the
tribe_create_event
documentation to point out the ORM, but I took a look at our automated tests and realize that I misspoke.tribe_create_event
should still function and is supported, despitetribe_events()
being the preferred approach (I indicated that on the documentation).The following update worked for me using
tribe_events()
with an event ID of 5:$event_id = tribe_events()
->where('id', $post_id)
->set('start_date', '2023-07-29 00:00:00')
->set('end_date', '2023-07-31 23:59:59')
->set('timezone', 'America/New_York')
->save();The following
tribe_create_event
worked for me as well:tribe_create_event([
'post_title' => 'Boom',
'post_content' => 'Boom',
'post_status' => 'publish',
'EventStartDate' => '2023-08-01',
'EventStartHour' => '12',
'EventStartMinute' => '00',
'EventStartMeridian' => 'pm',
'EventEndDate' => '2023-08-01',
'EventEndHour' => '01',
'EventEndMinute' => '00',
'EventEndMeridian' => 'pm',
]);Forum: Plugins
In reply to: [The Events Calendar] Programatically Create and Update EventsIf you are curious about where to poke further from a code perspective, check out our automated tests around the ORM. We have a number of tests that show the usage as well! In the TEC repo on GitHub, you can see them here:
As you are working on programmatic tweaking of events, this might have some helpful things to see / take into consideration as you work with the events.
- This reply was modified 1 year, 4 months ago by Matthew Batchelder.
Forum: Plugins
In reply to: [The Events Calendar] Programatically Create and Update EventsAh! You found a broken link – which I have now fixed, thank you. The link you found that was broken was that second one in my reply to you labeled “event creation”. I’ve added some documentation around the fields that can be used for adding / editing events on that Modifying the Database link.
The tribe_create_event is still present because it is still applicable to folks that have had TEC active pre 6.0 and have not migrated their events. The arguments
Forum: Plugins
In reply to: [The Events Calendar] Programatically Create and Update EventsHowdy, @thekendog! We have some documentation around working with events (querying, creating, deleting, etc) programmatically over at https://docs.theeventscalendar.com. Check out the ORM documentation, specifically info on event creation.
Hopefully this is helpful for you!
Forum: Plugins
In reply to: [The Events Calendar] Eventbrite Integration CrashesI apologize that you are having trouble with connecting The Events Calendar with Eventbrite. We are not aware of any reported downtime of our integration with Eventbrite, however, I have attempted to connect my own Eventbrite account in a new development environment and was able to authenticate and authorize importing events via Eventbrite.
It is worth trying again, just in case!
To ensure that you are trying fully from scratch, I suggest going to (in the Dashboard) Events > Settings > Integrations. You should see an Eventbrite section. If it has a link labeled “Disconnect”, I suggest clicking that. Once you have done so, click “Connect to Eventbrite” and follow the prompts.
If your problem continues to persist, I would recommend submitting a support ticket via https://theeventscalendar.com/support/ with your System Information (found in Dashboard > Events > Troubleshooting) along with a description of this problem – and perhaps a link to this thread.
Hopefully this helps!
Forum: Plugins
In reply to: [The Events Calendar] Problems with hijacking the post by this pluginThat is quite the debugging journey and I appreciate your efforts on that front! The mocking of the post solves a lot of issues on a number of sites, though, the use case that you have laid out makes the mocking of posts less than ideal. There is a way to disable the mocking of the posts without directly editing that file – and your digging helped me find the right filter!
Placing the following in your functions.php file (or wherever you think is most appropriate) should do the same thing as your commenting out solution:
add_filter( 'tribe_events_views_v2_should_hijack_page_template', '__return_false' );
Hopefully that will help!
Howdy!
The updated templates implement a before/after hook that you can inject content around each template. Currently, in the Template implementation, each time we load a template we fire a set of filters and actions that can be summarized in this list:
- before template inclusion:
tribe_template_before_include:TEMPLATE/PATH
- after template inclusion:
tribe_template_after_include:TEMPLATE/PATH
- before/after template HTML:
tribe_template_html:TEMPLATE/PATH
You can read about these hooks in our knowledgebase.
In an upcoming release, we’ll be adding some additional hooks that will allow for the following (on all of the v2 templates):
- before template inclusion:
tribe_template_before_include:TEMPLATE/PATH
- inside template container, before content:
tribe_template_entry_point:TEMPLATE/PATH:after_container_open
- inside template container, after content:
tribe_template_entry_point:TEMPLATE/PATH:before_container_close
- after template inclusion:
tribe_template_after_include:TEMPLATE/PATH
- before/after template HTML:
tribe_template_html:TEMPLATE/PATH
Hopefully the first set of hooks help out in the short term. The second set of hooks will hopefully be in our next release this month!
- This reply was modified 4 years, 6 months ago by Matthew Batchelder.
- This reply was modified 4 years, 6 months ago by Matthew Batchelder.
- This reply was modified 4 years, 6 months ago by Matthew Batchelder.
Forum: Plugins
In reply to: [The Events Calendar] Show events that are currently happeningAdditionally, we just release an extension last week that adds a shortcode that shows events that are currently in progress: https://theeventscalendar.com/extensions/events-happening-now/
Forum: Plugins
In reply to: [The Events Calendar] Show events that are currently happeningHowdy,
Try out the following snippet using our Event Repository within TEC:
$events = tribe_events()->where( 'ends_after', 'now' )->per_page( 25 )->all();
That should fetch all events whose end date is after the current date/time, fetching 25 records at a time. If you need to paginate, you can get the current page by adding
->page( $page_num )
to the chain.For more information on the methods available to post repositories, you can see them here: https://docs.theeventscalendar.com/reference/classes/tribe__repository/
For the event-specific repository, you can see more about it here: https://docs.theeventscalendar.com/reference/classes/tribe__events__repositories__event/
Here’s a knowledgebase article that talks about the ORM: https://theeventscalendar.com/knowledgebase/k/show-events-by-custom-field/#ORM_or_Repository
Forum: Plugins
In reply to: [The Events Calendar] Cancel Event OptionHowdy! Thank you for reaching out.
Yesterday, we just released an extension that adds the ability to mark an event as canceled, postponed, or online. You can find it here: https://theeventscalendar.com/extensions/event-statuses/
While it doesn’t have a strikethrough in the title, there is a nice red “Canceled” label in close proximity to the title. I hope this helps!
Forum: Plugins
In reply to: [The Events Calendar] Website pages moved to trash dailyHowdy, @shareecordes! Thank you for pointing out this bug! The good news is, we have a fix that we will aim to get out with our next release.
In the mean time, you can download an extension that we’ve created that resolves the issue.
- The source code is visible here: https://github.com/mt-support/tribe-ext-fix-cron-deleting-posts
- The direct download of the extension is here: https://github.com/mt-support/tribe-ext-fix-cron-deleting-posts/archive/master.zip
Forum: Plugins
In reply to: [WordPress Importer] [Patch included] Importing nav_menu items failsNo problem! Thanks for fixing it (in core) ??
Forum: Plugins
In reply to: [wpCAS Server] How to setup wpcas-server?wpcas-server has worked on my WordPress installations from 2.9 to 3.3.1, so 3.2.1 should work.
Have you turned non-default permalinks turned on?
Forum: Installing WordPress
In reply to: Nothing in settings page for 1.4Sorry about that. I’ve replied to your e-mail and have posted a release of Sexy Comments along with an updated FAQ and installation directions over at BorkWeb.