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 | |
/** | |
* Only allow super admins to upload files | |
* | |
* @see map_meta_cap() | |
* | |
* @param array $caps Primitive capabilities assigned to meta caps. | |
* @param string $cap Meta capability. | |
* @param int $user_id The current user id. | |
* @param array $args An array of contextual arguments, sometimes empty. |
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
class My_Singleton { | |
/** | |
* The only instance of the My_Singleton Object | |
* @var My_Singleton | |
*/ | |
private static $instance; | |
/** | |
* Returns the main instance. |
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
Do not copy and paste this. Your fingers need the muscle memory. | |
# HTML Cheat Sheet | |
<!-- basic structure tags --> | |
<html></html> | |
<head></head> | |
<body></body> | |
<!-- link to a stylesheet --> | |
<link rel="stylesheet" href="/css/style.css"> |
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
vipsync() { | |
local DEVENV="/Users/tddewey/Sites/vip/wp-content/themes/vip/" | |
rsync -rv --delete --exclude='.svn' $DEVENV$1/* $DEVENV$2 | |
cd $DEVENV$2 | |
svn status | grep '^!' | awk '{print $2}' | xargs svn rm | |
svn status | grep '^?' | awk '{print $2}' | xargs svn add | |
} |
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
vipsync() { | |
local DEVENV="/Users/tddewey/Sites/vip/wp-content/themes/vip/" | |
rsync -rv --delete --exclude='.svn' $DEVENV$1/* $DEVENV$2 | |
cd $DEVENV$2 | |
svn status | grep '^!' | awk '{print $2}' | xargs svn rm | |
svn status | grep '^?' | awk '{print $2}' | xargs svn add | |
} |
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 | |
/** | |
* Very simplified comment callback to illustrate one particular nuance. Yours should be more robust. | |
* | |
* param $comment object The comments object | |
* param $args array Array of parameters passed to wp_list_comments | |
* param $depth integer How deep we are in the nested comments | |
*/ | |
function tdd_demo_comments_callback( $comment, $args, $depth ) { | |
?> |
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
/** | |
* Moves meta boxes in the 'normal' context to the front of the 'advanced' context. | |
* To be used when inserting content via the edit_form_advanced hook (example given) | |
*/ | |
class MoveMetaBoxes { | |
public $CPT_Slug = 'tdd_library'; | |
function __construct() { | |
add_action( 'edit_form_advanced', array( $this, 'edit_form_advanced' ), 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
<!doctype HTML> | |
<html> | |
<head> | |
<title>Typography Demo</title> | |
<style type="text/css"> | |
body { | |
max-width: 50rem; | |
margin: 5.5rem auto 5.5rem auto; |
NewerOlder