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 | |
/** | |
* Example: User ID | |
*/ | |
add_filter( 'ms_helper_listtable_member_get_columns', function( $columns ) { | |
$columns['user_id'] = 'User ID'; | |
return $columns; |
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
add_filter('wp_smush_media_image', 'smush_skip_original_image', '', 2 ); | |
function smush_skip_original_image( $skip, $image_size ) { | |
if( 'full' == $image_size ) { | |
return false; | |
} | |
return $skip; | |
} |
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 is to add a fake component to BuddyPress. A registered component is needed to add notifications | |
function custom_filter_notifications_get_registered_components( $component_names = array() ) { | |
// Force $component_names to be an array | |
if ( ! is_array( $component_names ) ) { | |
$component_names = array(); | |
} | |
// Add 'custom' component to registered components array |
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_filter( 'oembed_result', function( $embed, $url, $args ) { | |
$url_string = parse_url( $url, PHP_URL_QUERY ); | |
parse_str( $url_string, $id ); | |
if( isset( $id['v'] ) ) | |
{ | |
return str_replace( '?feature=oembed', '?feature=oembed&rel=0', $embed ); | |
} |
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
# The Ubuntu USB startup creator often crashes. | |
# This is an alternate way of doing the same process through the command line | |
# First plug in the USB pendrive. It will mount automatically | |
# Then check where it is (which device) | |
df | |
# Let's say we see it's in /dev/sdb1 | |
# Then we have to use /dev/sdb and NOT /dev/sdb1 |
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
/** | |
* | |
* List last 100 registered users without a gravatar or uploaded avatar | |
* | |
*/ | |
add_action( 'admin_menu', 'wk_list_members_without_profile_picture' ); | |
function wk_list_members_without_profile_picture(){ | |
add_menu_page( 'Members w/o picture', 'Members w/o picture', 'manage_options', 'wb-without-avatar', 'wb_without_avatar' ); | |
} |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
function add_post_edit_link() { | |
edit_post_link(__('{Quick Edit}'), ''); | |
} | |
add_action( 'shoestrap_in_article_bottom', 'add_post_edit_link' ); |
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 | |
// Call child-theme style sheet instead of parent them style.css | |
function shoestrap_child_theme_stylesheet() { | |
wp_enqueue_style('shoestrap_child', get_stylesheet_uri(), false, null); | |
} | |
add_action('wp_enqueue_scripts', 'shoestrap_child_theme_stylesheet', 110); | |
//from favoc 11-14-14 is response to http://press.codes/forums/topic/fluid-navbar-in-a-wide-layout-flipping-jumbotron-and-secondary-navbar/ | |
function move_extra_header() { |
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_action( 'shoestrap_in_article_bottom', 'custom_prev_next_links' ); | |
function custom_prev_next_links() { | |
$prev_post = get_previous_post(); | |
$next_post = get_next_post(); | |
if (!empty( $prev_post )) { | |
echo '<a class="pull-left" href="'. get_permalink( $prev_post->ID ) .'"><<< '. $prev_post->post_title .'</a>'; | |
} | |
if (!empty( $next_post )) { | |
echo '<a class="pull-right" href="'. get_permalink( $next_post->ID ) .'">'. $next_post->post_title .' >>></a>'; |