Skip to content

Instantly share code, notes, and snippets.

View philipdowner's full-sized avatar

Philip Downer philipdowner

View GitHub Profile
@philipdowner
philipdowner / wp-team-post-save-link-user.php
Last active April 2, 2018 16:07 — forked from chaance/wp-team-post-save-link-user.php
Function to dynamically sync CPT team posts with WP users. The post type requires custom meta fields for linked_author (user ID) and email.
<?php
/**
* Create new users to match team members.
*
* @param integer $post_id Post ID.
*/
function xx_team_post_save_link_user( $post_id ) {
$user_email = get_post_meta( $post_id, 'email', true );
$author_id = (int)get_post_meta( $post_id, 'linked_author', true );
@philipdowner
philipdowner / update.php
Last active February 11, 2025 19:17
Programatically updating Tribe Events Calendar data using ORM
<?php
// Uses the symfony/var_dumper package for the dump() function
/** First we create the Event */
$created = tribe_events()
->set_args([
'title' => "Test Event",
'start_date' => "2025-02-14 08:00:00",
'end_date' => "2025-02-14 10:00:00",
'laws_external_id' => 123,