Title: Matthew Batchelder's Replies | WordPress.org

---

# Matthew Batchelder

  [  ](https://wordpress.org/support/users/borkweb/)

 *   [Profile](https://wordpress.org/support/users/borkweb/)
 *   [Topics Started](https://wordpress.org/support/users/borkweb/topics/)
 *   [Replies Created](https://wordpress.org/support/users/borkweb/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/borkweb/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/borkweb/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/borkweb/engagements/)
 *   [Favorites](https://wordpress.org/support/users/borkweb/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Programatically Create and Update Events](https://wordpress.org/support/topic/programatically-create-and-update-events/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/programatically-create-and-update-events/#post-16893318)
 * Ah, 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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Programatically Create and Update Events](https://wordpress.org/support/topic/programatically-create-and-update-events/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/programatically-create-and-update-events/#post-16892671)
 * In 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, despite `tribe_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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Programatically Create and Update Events](https://wordpress.org/support/topic/programatically-create-and-update-events/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/programatically-create-and-update-events/#post-16890960)
 * If 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:
    - [Events](https://github.com/the-events-calendar/the-events-calendar/tree/master/tests/wpunit/Tribe/Events/ORM/Events)
    - [Organizers](https://github.com/the-events-calendar/the-events-calendar/tree/master/tests/wpunit/Tribe/Events/ORM/Organizers)
    - [Venues](https://github.com/the-events-calendar/the-events-calendar/tree/master/tests/wpunit/Tribe/Events/ORM/Venues)
 * 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 2 years, 12 months ago by [Matthew Batchelder](https://wordpress.org/support/users/borkweb/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Programatically Create and Update Events](https://wordpress.org/support/topic/programatically-create-and-update-events/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/programatically-create-and-update-events/#post-16890957)
 * Ah! 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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Programatically Create and Update Events](https://wordpress.org/support/topic/programatically-create-and-update-events/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/programatically-create-and-update-events/#post-16890858)
 * Howdy, @thekendog! We have some documentation around working with events (querying,
   creating, deleting, etc) programmatically over at [https://docs.theeventscalendar.com](https://docs.theeventscalendar.com).
   Check out the [ORM documentation](https://docs.theeventscalendar.com/apis/orm/),
   specifically info on [event creation](https://docs.theeventscalendar.com/apis/orm/basics/#modifying-the-database).
 * Hopefully this is helpful for you!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Eventbrite Integration Crashes](https://wordpress.org/support/topic/eventbrite-integration-crashes/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/eventbrite-integration-crashes/#post-15377193)
 * I 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/](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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Problems with hijacking the post by this plugin](https://wordpress.org/support/topic/problems-with-hijacking-the-post-by-this-plugin/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/problems-with-hijacking-the-post-by-this-plugin/#post-14986257)
 * That 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!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Where are all the hooks in the new (v2) templates in 5.x?](https://wordpress.org/support/topic/where-are-all-the-hooks-in-the-new-v2-templates-in-5-x/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/where-are-all-the-hooks-in-the-new-v2-templates-in-5-x/#post-12799117)
 * 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](https://theeventscalendar.com/knowledgebase/k/template-hooks/).
 * 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 6 years, 2 months ago by [Matthew Batchelder](https://wordpress.org/support/users/borkweb/).
    -  This reply was modified 6 years, 2 months ago by [Matthew Batchelder](https://wordpress.org/support/users/borkweb/).
    -  This reply was modified 6 years, 2 months ago by [Matthew Batchelder](https://wordpress.org/support/users/borkweb/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Show events that are currently happening](https://wordpress.org/support/topic/show-events-that-are-currently-happening/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/show-events-that-are-currently-happening/#post-12582647)
 * Additionally, 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/](https://theeventscalendar.com/extensions/events-happening-now/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Show events that are currently happening](https://wordpress.org/support/topic/show-events-that-are-currently-happening/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/show-events-that-are-currently-happening/#post-12582638)
 * Howdy,
 * 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/](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/](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](https://theeventscalendar.com/knowledgebase/k/show-events-by-custom-field/#ORM_or_Repository)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Cancel Event Option](https://wordpress.org/support/topic/cancel-event-option/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/cancel-event-option/#post-12582569)
 * Howdy! 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/](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](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[The Events Calendar] Website pages moved to trash daily](https://wordpress.org/support/topic/website-pages-moved-to-trash-daily/)
 *  Plugin Contributor [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/website-pages-moved-to-trash-daily/#post-12407621)
 * Howdy, [@shareecordes](https://wordpress.org/support/users/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](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](https://github.com/mt-support/tribe-ext-fix-cron-deleting-posts/archive/master.zip)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WordPress Importer] [Patch included] Importing nav_menu items fails](https://wordpress.org/support/topic/patch-included-importing-nav_menu-items-fails/)
 *  Thread Starter [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/patch-included-importing-nav_menu-items-fails/#post-3169719)
 * No problem! Thanks for fixing it (in core) 😀
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[wpCAS Server] How to setup wpcas-server?](https://wordpress.org/support/topic/how-to-setup-wpcas-server/)
 *  Plugin Author [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/how-to-setup-wpcas-server/#post-2376651)
 * 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](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Nothing in settings page for 1.4](https://wordpress.org/support/topic/nothing-in-settings-page-for-14/)
 *  [Matthew Batchelder](https://wordpress.org/support/users/borkweb/)
 * (@borkweb)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/nothing-in-settings-page-for-14/#post-602426)
 * Sorry 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](http://borkweb.com/story/plugin-sexy-comments-v14-released).

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