This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create or update a list of contacts in Hubspot. | |
* @param registrants Array of contact objects, e.g. from an external data source. | |
* @returns The JSON response from Hubspot. | |
*/ | |
async function hubspotCreateOrUpdateContacts( contacts, hubspotAPIKey ) { | |
let hubspotContacts = contacts.map( registrant => { | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace JupiterX_Core\Raven\Modules\Advanced_Accordion\Widgets; | |
defined( 'ABSPATH' ) || die(); | |
use JupiterX_Core\Raven\Controls\Query; | |
use JupiterX_Core\Raven\Base\Base_Widget; | |
use Elementor\Icons_Manager; | |
use Elementor\Controls_Manager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_enqueue_scripts', 'my_block_enqueue_scripts' ); | |
function my_block_enqueue_scripts() { | |
wp_enqueue_style( 'my-normal-css' ); | |
// Do this only if the current post/page has an instance of the related block. | |
if ( has_block('my-block-name') ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'get_header', function() { | |
if ( !is_attachment() ) return; | |
$file_url = wp_get_attachment_url( get_the_ID() ); | |
$file_name = basename( $file_url ); | |
header( sprintf('Content-type: %s', get_post_mime_type() ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'get_header', function() { | |
if ( !is_attachment() ) return; | |
$file_url = wp_get_attachment_url( get_the_ID() ); | |
wp_redirect( $file_url ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Production | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
web-deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', function() { | |
if ( !is_attachment() ) return; | |
$file_url = wp_get_attachment_url( get_the_ID() ); | |
?><script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'rest_api_init', 'register_form_shortcode' ); | |
function register_form_shortcode() { | |
register_rest_route( 'mdg/v1', '/events', [ | |
'methods' => 'GET', | |
'callback' => 'get_shortcode_html', | |
'permission_callback' => '__return_true', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function build_ical( array $input, string $output_path ) { | |
$template = file_get_contents( __DIR__ . '/template.ics' ); | |
$timezone = new DateTimeZone('America/New_York'); | |
$now = new DateTime( 'now', $timezone ); | |
$start = new DateTime( $input['start'], $timezone ); |
NewerOlder