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
function getYouTubeIdByUrl(url) { | |
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/, | |
match = url.match(regExp), | |
result = false; | |
if( match && match[2].length == 11 ) { | |
result = match[2]; | |
} | |
return result; |
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
// Inspired by @desandro's debounce.js https://gist.github.com/desandro/8559356 | |
// Inspired by @ChrisFerdinandi's article: https://gomakethings.com/debouncing-events-with-requestanimationframe-for-better-performance/ | |
function debounce( fn ) { | |
var timeout; | |
return function debounced() { | |
var _this = this, | |
args = arguments; | |
// If there's a timer, cancel it |
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
(function($) { | |
$(document).ready(function() { | |
// Call doc ready functions here | |
}); | |
// Add additional listeners as needed | |
// Define functions below | |
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
function getSiblings($element) { | |
var siblings = [], | |
$sibling = $element.parentNode.firstElementChild; | |
while( $sibling ) { | |
// Make sure the sibling isn't the $element being referenced | |
if( $sibling !== $element ) { | |
// Add sibling to array | |
siblings.push($sibling); | |
} |
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 | |
// Enqueue Thickbox Assets | |
add_thickbox(); | |
// Define shortcodes | |
// Setup array | |
$shortcodes = array(); | |
// Add a shortcode to the shortcodes 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
{% macro transition(value) -%} | |
-webkit-transition: {{ value }}; | |
-o-transition: {{ value }}; | |
transition: {{ value }}; | |
{%- endmacro %} | |
{% macro transform(value) -%} | |
-webkit-transform: {{ value }}; | |
-ms-transform: {{ value }}; | |
transform: {{ value }}; |
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 disable_wp_emoji() { | |
// all actions related to emojis | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); |
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 | |
/** | |
* Template part for displaying page content in page.php | |
* | |
* @link https://codex.wordpress.org/Template_Hierarchy | |
* | |
* @package WordPress | |
* @subpackage Twenty_Seventeen | |
* @since 1.0 | |
* @version 1.0 |