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
/** | |
* 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 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_action( 'contextual_help', 'wptuts_screen_help', 10, 3 ); | |
function wptuts_screen_help( $contextual_help, $screen_id, $screen ) { | |
// The add_help_tab function for screen was introduced in WordPress 3.3. | |
if ( ! method_exists( $screen, 'add_help_tab' ) ) | |
return $contextual_help; | |
global $hook_suffix; | |
// List screen properties |
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 is_user_logged_in() { | |
$loggedin = false; | |
foreach ( (array) $_COOKIE as $cookie => $value ) { | |
if ( stristr($cookie, 'wordpress_logged_in_') ) | |
$loggedin = true; | |
} | |
return $loggedin; | |
} | |
if ( ! stristr($_SERVER['REQUEST_URI'], '/wp-admin') && ! stristr($_SERVER['REQUEST_URI'], '/wp-login.php') && ! is_user_logged_in() ) |
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(){ | |
var request = wp.ajax.post('custom_action', {param1: 'uppercase this string pls'}); | |
// on success | |
request.done( function ( res ) { | |
console.log( res ); | |
}); | |
// on fail |
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
[submodule "chosen"] | |
path = chosen | |
url = git@github.com:harvesthq/chosen.git |
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 | |
/** | |
* Enable dev mode vendor packages. | |
*/ | |
if ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) { | |
return; | |
} | |
add_action( 'init', function () { |
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
// Output Android Icons.jsx | |
// 2012 Todd Linkner | |
// License: none (public domain) | |
// v1.0 | |
// | |
// This script is for Photoshop CS6. It outputs Android icons of the | |
// following sizes from a source PSD at least 512px x 512px | |
// | |
// store: | |
// Icon.png (512px x 512px) |
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
/** | |
* Save lightsaber mutations to different files | |
* Created by: Matthew Batchelder (Orv Dessrx) | |
* For: Dark Jedi Brotherhood https://www.darkjedibrotherhood.com | |
*/ | |
if ( 0 !== app.documents.length ) { | |
var doc = app.documents[0]; | |
var filename = doc.name.substring( 0, doc.name.indexOf( '.' ) ); | |
var file; |
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
/* | |
The original files are 960x319. | |
Image sizes to save: | |
* 800x266 - Retina for 480x320 resolution (400 logical pixel wide panel areas) | |
* 740x246 - Desktop and iPad | |
* 616x205 - Retina for 320x480 resolution (308 logical pixel wide panel areas) | |
* 400x133 - 480x320 resolution | |
* 308x102 - 320x480 resolution |
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
/* | |
The original files are 960x319. | |
Image sizes to save: | |
* 800x266 - Retina for 480x320 resolution (400 logical pixel wide panel areas) | |
* 740x246 - Desktop and iPad | |
* 616x205 - Retina for 320x480 resolution (308 logical pixel wide panel areas) | |
* 400x133 - 480x320 resolution | |
* 308x102 - 320x480 resolution |
OlderNewer