// --- Custom Code to Send New Posts to Discord --- function send_to_discord_on_publish($post_id) { // Get the post type and post data $post_type = get_post_type($post_id); $post = get_post($post_id); // Stop if this is just a revision, an auto-save, or already published and just being updated if (wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) { return; } if (get_post_status($post_id) !== 'publish' || get_post_meta($post_id, '_discord_sent_on_publish', true)) { return; } $webhook_url = ''; $message = ''; // --- Configure for News Posts --- if ($post_type === 'post') { $webhook_url = 'https://discord.com/api/webhooks/1427126413848481905/5V5LSGxPbzA5vM4LYBLvmZYYkktw7d_BP9dFoh6O7IQyAcTQPennhEspc1Zjfz0RSOU-'; // <-- PASTE NEWS WEBHOOK URL $post_excerpt = has_excerpt($post_id) ? $post->post_excerpt : wp_trim_words($post->post_content, 30, '...'); $message = sprintf( "**%s**\n\n%s\n\nRead more: %s", $post->post_title, $post_excerpt, get_permalink($post_id) ); } // --- Configure for Jobs --- if ($post_type === 'job_listing') { $webhook_url = 'https://discord.com/api/webhooks/1427128502574125186/SRa4To098LAbrpiCGsW75PM2W9cnoqLF1hhr2_jI6cQNXOJhR1vxv3C3m2085NzIim7f'; // <-- PASTE JOBS WEBHOOK URL $company = get_post_meta($post_id, '_company_name', true); $location = get_post_meta($post_id, '_job_location', true); $message = sprintf( "💼 **%s**\n\n**Company:** %s\n**Location:** %s\n\nApply here: %s", $post->post_title, $company, $location, get_permalink($post_id) ); } // --- Configure for Events --- if ($post_type === 'tribe_events') { $webhook_url = 'https://discord.com/api/webhooks/1427127593576169603/vd9yAbEJ3he5J14gIbXV8RrKCi9G4rZH2Y_iLubbqDHopTbsAim2u-7srtTvMVnmOKUq'; // <-- PASTE EVENTS WEBHOOK URL $start_date = function_exists('tribe_get_start_date') ? tribe_get_start_date($post_id, true, 'F j, Y') : 'Not specified'; $venue_name = function_exists('tribe_get_venue') ? tribe_get_venue($post_id) : 'Not specified'; $message = sprintf( "🗓️ **%s**\n\n**When:** %s\n**Where:** %s\n\nFull details: %s", $post->post_title, $start_date, $venue_name, get_permalink($post_id) ); } // --- This part sends the message --- if (!empty($webhook_url) && !empty($message)) { $payload = json_encode(['content' => $message]); $args = [ 'body' => $payload, 'headers' => ['Content-Type' => 'application/json'], 'data_format' => 'body', ]; wp_remote_post($webhook_url, $args); // Mark this post as sent so it doesn't send again on update update_post_meta($post_id, '_discord_sent_on_publish', true); } } // This last part tells WordPress to run our code whenever you publish something add_action('publish_post', 'send_to_discord_on_publish'); add_action('publish_job_listing', 'send_to_discord_on_publish'); add_action('publish_tribe_events', 'send_to_discord_on_publish'); // --- End of Custom Discord Code ---
Make Games NYC Events for October 2, 2025 › Festival › – Make Games NYC

Festival

  1. Events
  2. Festival

Views Navigation

Event Views Navigation

Today

Want to add your event?  Email: contact@makegames.nyc