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
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
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 hwid_acf_admin_footer() { | |
?> | |
<script> | |
( function( $) { | |
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id ) { | |
// grab the classes defined within the field admin and put them in an array | |
var classes = $( '#' + id ).closest( '.acf-field-wysiwyg' ).attr( 'class' ); |
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 | |
// Singular | |
add_filter( 'tribe_event_label_singular', 'event_display_name' ); | |
function event_display_name() { | |
return 'Meeting'; | |
} | |
add_filter( 'tribe_event_label_singular_lowercase', 'event_display_name_lowercase' ); | |
function event_display_name_lowercase() { | |
return 'meeting'; |
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
/** | |
* Changes XML to JSON | |
* Modified version from here: http://davidwalsh.name/convert-xml-json | |
* @param {string} xml XML DOM tree | |
*/ | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; | |
if (xml.nodeType == 1) { |
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( 'preprocess_comment', 'nyt_preprocess_comment' ); | |
function nyt_preprocess_comment($comment) { | |
if ( strlen( $comment['comment_content'] ) > 5000 ) { | |
wp_die('Comment is too long.'); | |
} | |
return $comment; | |
} |
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 | |
add_action( 'admin_init', 'hide_backend_from_user' ); | |
/** | |
* Hide the backend from specific user levels | |
* @uses VFH_User_Controls::$options['login_redirect_to'] to determine where the user should be redirected | |
* @uses VFH_User_Controls::$user_levels to see if the user needs to be redirected | |
*/ | |
function hide_backend_from_user( $level='edit_posts' ) { | |
/** | |
* Attempt not to short-circuit AJAX requests |
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 | |
// Add to functions.php and leave the “Content” box unticked in Settings > Mandrill | |
// Be sure to omit the opening <?php tag when copying this code | |
// Add paragraph breaks to plain text notifications sent by Mandrill | |
add_filter('mandrill_payload', 'wpmandrill_auto_add_breaks'); | |
function wpmandrill_auto_add_breaks($message) { | |
$html = $message['html']; |
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 | |
/** | |
* Customise WordPress Vimeo oEmbed | |
* https://developer.vimeo.com/apis/oembed | |
*/ | |
function my_oembed_fetch_url( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) !== false) { |
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
.tabs{ | |
margin: {top:40px;} | |
&:last-child{ | |
margin: {bottom:80px;} | |
} | |
h2{ | |
color: $color-1; | |
font: { | |
size: emCalc(36px); | |
} |