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
var CMB_Linklist = { | |
init : function ( field ) { | |
var _this = this; | |
_this.uniqueID = jQuery(field).find( '.linklist-wrap' ).attr( 'id' ); | |
field.find('button.cmb-linklist-toggle').click( function(e) { | |
e.preventDefault(); |
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
if ( -d /srv/www/$root/public ) { | |
set $root '${root}/public'; | |
} |
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
/** | |
* Fix login loop. | |
* | |
* When WordPress is installed in a subdirectory, wp-admin/ links don't work correctly. We fix this with an nginx rewrite. | |
* But... it appends reauth=1 to the url which forces a reauthentication when submitted... and you have to log in again! | |
*/ | |
add_filter( 'login_url', function( $url ) { | |
if ( '/wp-admin/' === add_query_arg( array() ) ) { |
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 | |
define( 'MPH_GENERATOR_FLICKR_API_KEY', '' ); | |
if ( ! 'MPH_GENERATOR_FLICKR_API_KEY' ) | |
die( 'You must define the Flickr API key.' ); | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
/** |
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 | |
/** | |
* Plugin Name: PHPMailer SMTP Settings | |
* Description: Enables SMTP servers, SSL/TSL authentication and SMTP settings. | |
*/ | |
defined( 'ABSPATH' ) OR exit; | |
add_action( 'phpmailer_init', 'my_phpmailer_init' ); |
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
/*! jQuery UI - v1.10.3 - 2013-10-09 | |
* http://jqueryui.com | |
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css | |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=%22Open%20Sans%22%2CArial%2Csans-serif&fwDefault=normal&fsDefault=13px&cornerRadius=0&bgColorHeader=%23FFFFFF&bgTextureHeader=flat&bgImgOpacityHeader=100&borderColorHeader=%23dfdfdf&fcHeader=%23555555&iconColorHeader=%23555555&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23dfdfdf&fcContent=%23555555&iconColorContent=%23555555&bgColorDefault=%23222222&bgTextureDefault=flat&bgImgOpacityDefault=100&borderColorDefault=%23222222&fcDefault=%23eee&iconColorDefault=%23eee&bgColorH |
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 | |
// Use this to create a load of meta entries to check its still OK when there are loads of meta entries. | |
// for ( $i = 0; $i < 500; $i++ ) { | |
// $id = 'test-' . uniqid(); | |
// add_post_meta( 1, $id, rand() ); | |
// } | |
// die(); |
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 | |
/** | |
* Intelligently replacement for print_r & var_dump. | |
* | |
* @param mixed $code | |
* @param bool $output. (default: true) | |
* @return $code | |
*/ | |
function hm( $code, $output = 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
/** | |
* Intelligently replacement for print_r & var_dump. | |
* | |
* @param mixed $code | |
* @param bool $output. (default: true) | |
* @return $code | |
*/ | |
function hm( $code, $output = 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
// I guess this is a question of best practice and JavaScript design patterns. | |
// I have an object, and have defined all my functions as properties on this. | |
// My problem... | |
// I want to attach a function within the object to a click event. | |
// As this was getting messy - I wanted to avoid using a closure, instead passing a callback function. | |
// However within that callback function, this referes to the clicked element. | |
// How do I access other properties on MyClass? | |
// What is the BEST way to do this? Am I trying to do something stupid. |