This file contains 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
{# | |
# USAGE: | |
# (transform can either be an object, or an array of objects, aka srcset) | |
# | |
# {{ macro.regular(entry.image.one(), { width: 50, height: 50 }, 'class="block"') }} | |
# ➡️ <img src="..." width="50" height="50" alt="..." class="block" /> | |
# | |
# {{ macro.url(entry.image.one(), { width: 50, height: 50 }) }} | |
# ➡️ /uploads_c/../{...}.jpg | |
# |
This file contains 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
//Based on https://www.jackbarber.co.uk/blog/2019-04-26-email-address-plugin-for-redactor with small improvements | |
(function ($R) { | |
$R.add('plugin', 'email', { | |
modals: { | |
// this is variable with modal HTML body | |
'emailmodal': '<form action=""><div class="form-item"><label>Email Address</label><input type="text" name="emailaddress"><label>Text</label><input type="text" name="anchortext"></div></form>' | |
}, | |
// set translations | |
translations: { | |
en: { |
This file contains 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":"Time Zone", | |
"handle":"timeZone", | |
"instructions":"", | |
"required":null, | |
"translationMethod":"none", | |
"translationKeyFormat":null, | |
"type":"craft\\fields\\Dropdown", | |
"settings":{ |
This file contains 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
import Vue from 'vue' | |
import axios from 'axios' | |
const apiClient = axios.create({ | |
baseURL: '', | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json', | |
} | |
}) |
This file contains 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
var MS_IN_MINUTES = 60 * 1000; | |
var formatTime = function (date) { | |
date = new Date(date * 1000); | |
return date.toISOString().replace(/-|:|\.\d\d\d/g, "") | |
}; | |
var calendarGenerators = { | |
google: function (event) { | |
var startTime = formatTime(event.start); |
This file contains 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
// https://codepen.io/cmykw/pen/gemxJm | |
// layout | |
<nav/> | |
// style | |
<style> | |
body { min-height: 200vh; } | |
nav { |
This file contains 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
Header add Content-Type "application/json" | |
Header add Access-Control-Allow-Methods "GET,HEAD,POST,PUT,DELETE,OPTIONS" | |
Header add Access-Control-Allow-Headers "Auth-Token,Content-Type" | |
Header add Access-Control-Allow-Origin "*" |
This file contains 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
add_filter( 'mce_external_plugins', 'my_theme_mce_external_plugins' ); | |
function my_theme_mce_external_plugins( $plugin_array ) { | |
$plugin_array['typekit'] = get_template_directory_uri() . '/typekit.tinymce.js'; | |
return $plugin_array; | |
} |
This file contains 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 | |
/* | |
Based on http://github.com/deliciousbrains/wp-migrate-db-pro-tweaks | |
*/ | |
class ACF_WP_Migrate_DB_Pro_Tweaks { | |
function __construct() { | |
add_filter( 'wpmdb_preserved_options', array( $this, 'preserved_options' ) ); | |
} |
This file contains 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_filedate = new Twig_SimpleFunction( | |
'fileDate', | |
/** | |
* @param $file_path | |
* This function generates a new file path with the last date of filechange | |
* to support better better client caching via Expires header: | |
* i.e: |