Skip to content

Instantly share code, notes, and snippets.


Daniel Schutzsmith schutzsmith

View GitHub Profile
schutzsmith / gist:4652354
Created Jan 28, 2013
Include custom post types in “Right Now” admin dashboard widget
View gist:4652354
// originally from
function wph_right_now_content_table_end() {
$args = array(
'public' => true ,
'_builtin' => false
$output = 'object';
$operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
schutzsmith / gist:4758909
Created Feb 12, 2013
Buddypress Functions for profile url logged in user lots off globals
View gist:4758909
$bp->loggedin_user->id The user ID of the user.
$bp->loggedin_user->domain The profile page URL of the user
$bp->loggedin_user->fullname The display name of the user
$bp->displayed_user->id The user ID of the user.
$bp->displayed_user->domain The profile page URL of the user
schutzsmith / gist:4758917
Created Feb 12, 2013
Get Buddypress avatar
View gist:4758917
<a href="<?php bloginfo('url'); ?>/category/<? echo $post->post_author;?>"><?php echo get_avatar( get_the_author_meta('ID'), '65' ); ?></a>
schutzsmith / gist:4758938
Created Feb 12, 2013
Buddypress Get user profile data function
View gist:4758938
Drop in functions.php
function getProfileData($fieldName){
global $bp;
return xprofile_get_field_data($fieldName,$bp->loggedin_user->id);
We couldn’t find that file to show.
schutzsmith / gist:5383348
Created Apr 14, 2013
Random text in PHP
View gist:5383348
$random_text = array("Random Text 1",
"Random Text 2",
"Random Text 3",
"Random Text 4",
"Random Text 5");
$sizeof = count($random_text);
$random = (rand()%$sizeof);
schutzsmith / gist:6400038
Created Aug 31, 2013
Execute admin only code in Wordpress
View gist:6400038
schutzsmith / gist:6400047
Created Aug 31, 2013
Change default Post Type labels in Wordpress
View gist:6400047
function frl_change_post_labels($post_type, $args){ /* change assigned labels */
global $wp_post_types;
if($post_type != 'post')
$labels = new stdClass();
$labels->name = __('Articles', 'frl');
$labels->singular_name = __('Article', 'frl');
schutzsmith / gist:6400056
Created Aug 31, 2013
Custom set of default quick tags in Wordpress
View gist:6400056
function frl_quicktags_settings($qt_init, $editor_id){
if($editor_id != 'content')
return $qt_init; //not a default case
/* default set of values - "strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,fullscreen" */;
$qt_init['buttons'] = "strong,em,link,block,img,ul,ol,li,code,fullscreen"; ;
return $qt_init;
View pagelines-dms-customize-image-sizes.php
// PageLines references
// 'aspect-thumb' not in use --
// 'basic-thumb' might be used by PopThumbs --
// 'landscape-thumb' used when PL settings have featured image on top of posts --
// WordPress references