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
/** | |
* 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
/** | |
* 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
<?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
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 | |
// 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
<?php | |
if ( ! wp_is_large_network( 'users' ) ) { | |
$num = '<a href="' . network_admin_url('users.php') . '">' . $num . '</a>'; | |
$text = '<a href="' . network_admin_url('users.php') . '">' . $text . '</a>'; | |
} else { | |
$num = '<a href="' . network_admin_url('users.php') . '">10,000+</a>'; | |
$text = '<a href="' . network_admin_url('users.php') . '">' . $text . '</a>'; | |
?> |
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 if ( $recent->have_posts() ) : while ( $recent->have_posts() ) : $recent->the_post(); | |
// Pull the URL from the_content() | |
$link = esc_url( get_the_content() ); | |
// Check if it's a properly formed URL, append http:// if not. Don't want user to struggle here | |
if ( ! preg_match('/^http:\/\//', $link ) ) | |
$link = 'http://' . $link; | |
// Setup args for our oEmbed |
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
if ( is_single() && in_category( 'recent-events' ) ) { | |
$content = get_the_content(); | |
echo $content; | |
} else { | |
// Main loop content goes here | |
} |
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 $format = get_post_format(); | |
if ( $format === false ) | |
$format = 'standard'; | |
get_template_part( 'formats/content', $format ); ?> |