⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
################################################################ | |
# Example configuration file for nginx | |
# | |
# To add a new local WordPress domain to your environment, copy | |
# this file using a filename that matches the domain you wish to | |
# setup. For example - mylocaldomain.com.conf would be an ideal | |
# filename for http://mylocaldomain.com | |
# | |
# Once copied, you will need to modify two settings in the server | |
# configuration provided: |
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
#301 Redirect Local Images to Live | |
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$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
// Allows you to add ?debug=true query parameter | |
// For live sites in which a dev environment is not possible. | |
if ( isset($_GET['debug']) && $_GET['debug'] == 'true') { | |
define('WP_DEBUG', true); | |
} | |
// A nice stack recommended by @jjeaton, | |
// for dev environments: |
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 | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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
#!/bin/bash | |
# args | |
MSG=${1-'deploy from git'} | |
BRANCH=${2-'trunk'} | |
# paths | |
SRC_DIR=$(git rev-parse --show-toplevel) | |
DIR_NAME=$(basename $SRC_DIR) | |
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH |
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 | |
/** | |
* Text Field | |
* | |
* A simple text field callback to use with the Settings API. Don't forget to pass in | |
* the arguments array. Here's an example call to add_settings_field() : | |
* | |
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array( | |
* 'name' => 'my_theme_options[my_option]', | |
* 'value' => $options['my_option'], // assuming $options is declared |
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 | |
/* | |
Plugin Name: Custom Field Shortcodes | |
Plugin URI: http://trepmal.com/2010/12/including-custom-fields-inside-your-post/ | |
Description: Include a custom field in your post with a shortcode. [cf name=custom_field] | |
Author: Kailey Lampert | |
Version: 1.0 | |
Author URI: http://kaileylampert.com/ | |
*/ | |
/* |