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 | |
// This is the meat of the plugin and should go in mu-plugins/0-env-url-override.php | |
// Only load these filters if we're not in the production environment | |
if ( defined( 'ENV_NOT_PRODUCTION' ) && ENV_NOT_PRODUCTION ) { | |
// This always needs to be filtered | |
add_filter( 'site_url', 'env_filter_site_url', 0 ); | |
// We don't filter home_url in the admin so that we get production URLs for posts. | |
// This does break certain links like "Preview/View Post", however. |
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
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@machine$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |
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 the_post_thumbnail( 'thumbnail', array( 'class' => 'fl' ) ); ?> | |
<?php the_post_thumbnail( array( 150, 150 ), array( 'class' => 'fr' ) ); ?> |
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
/** | |
* Add plugin page links to Toolbar in Multisite | |
* | |
* Adds Toolbar link to the 'Plugins' list page in Network Admin | |
* Adds Toolbar link to 'Add New Plugin' in Network Admin | |
* @uses global $wp_admin_bar | |
*/ | |
function ww_ms_plugin_toolbar_links() { | |
global $wp_admin_bar; |
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
/** | |
* Build 'First Last' user display name | |
* | |
* Sets up default-style Display Name for users on new registrations | |
* | |
* @param int $user_id | |
* @uses wp_insert_user() | |
*/ | |
function ww_default_display_name( $user_id ) { | |
$first = get_user_meta( $user_id, 'first_name', 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
function ww_add_customize_link() { | |
// add the Customize link to the admin menu | |
add_theme_page( 'Customize', 'Customize', 'edit_theme_options', 'customize.php' ); | |
} | |
add_action ( 'admin_menu', 'ww_add_customize_link' ); |
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
/** | |
* #content references the outer container selector | |
* .post references in the inner containers selectors | |
*/ | |
jQuery(document).ready(function(){ | |
jQuery( '#content' ).masonry({ | |
itemSelector: '.post', | |
columnWidth: 320 | |
}); |
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
function plupload_scaling( $defaults ) { | |
$defaults['resize'] = array( | |
'width' => 1024, | |
'height' => 1024, | |
'quality' => 100 | |
); | |
return $defaults; | |
} | |
add_filter( 'plupload_default_settings', 'plupload_scaling' ); |
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
/** | |
* Unregister Core Widgets | |
* | |
* Unregisters all core widgets based on their individual | |
* class names. | |
* | |
* @uses unregister_widget() to unregister from the Widget Factory class | |
*/ | |
function remove_core_widgets() { | |
unregister_widget( 'WP_Widget_Calendar' ); |