(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
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 | |
/*------------------------------------------------------------------------------ | |
The functions below are executed if the install is declared to be a | |
development environment. | |
The following constants should be set in the install's wp-config.php: | |
SITE_DEV - [true/false] | |
SITE_PROD_URL - primary root URL of the production site | |
------------------------------------------------------------------------------*/ |
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 | |
//* Do NOT include the opening php tag | |
//* ALL EXAMPLES ON THIS PAGE USE THE NEW HTML5 METHOD | |
//* Remove page titles site wide (posts & pages) (requires HTML5 theme support) | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
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 Author Profile Fields to User Profile | |
* | |
* @since 1.0.0 | |
* @param object $user | |
*/ | |
function ja_user_fields( $user ) { | |
?> | |
<h3>Additional Information</h3> |
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 | |
/** | |
* Redirect users with 'foo' role to a specific page after login | |
* | |
* @since 1.0.0 | |
*/ | |
function ja_role_login_redirect( $redirect_to, $request, $user ){ | |
//is there a user to check? | |
if ( isset( $user->roles ) && is_array( $user->roles ) ) { | |
if( in_array( 'foo', $user->roles ) ) { |
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 | |
/** | |
* Customize the login screen text | |
* | |
* Some sites, primarily membership sites, are setup where the usernames ARE their email address. | |
* This is great, but the login screen can confuse users. So help with the confusion, we remove | |
* all references of "Username" on the login screen and replace with "Email". | |
* | |
* @since 1.0.0 | |
*/ |
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
#!/usr/bin/python | |
import os | |
import csv | |
reader = csv.DictReader(open('./instapaper-export.csv', 'rb'), delimiter = ',', quotechar = '"') | |
unread = [] | |
for row in reader: |
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 file adds a custom template to the AgentPress Child Theme. | |
* | |
* @author Brad Dalton | |
* @link http://wpsites.net/web-design/make-custom-page-template/ | |
* @package Agentpress | |
* @subpackage Customizations | |
*/ |
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 subl() { | |
if [[ ! -p /dev/stdin ]]; then | |
command subl > /dev/null 2>&1 | |
fi | |
command subl "$@" | |
} |