Skip to content

Instantly share code, notes, and snippets.

View BoweFrankema's full-sized avatar

Bowe Frankema BoweFrankema

View GitHub Profile
@BoweFrankema
BoweFrankema / custom-site-message.php
Created December 16, 2014 12:07
Custom Message BuddyPress Multisite Site Creation
<?php
function cf_site_creation_confirmation() { { ?>
<div class="intro-text important">
All done! We have created your new site succesfully! We also sent you an email with your site details.
</div>
<?php }}
add_action('signup_finished','cf_site_creation_confirmation');
?>
@BoweFrankema
BoweFrankema / overwrite-edd-action.php
Last active August 29, 2015 14:13
Overwrite action
<?php
/*
* Remove the default final checkout price
*/
function cfc_edd_replace_final_total() {
remove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 );
}
add_action( 'init', 'cfc_edd_replace_final_total' );
@BoweFrankema
BoweFrankema / buddypress-username-shortcode.php
Created February 2, 2015 11:15
BuddyPress Username Shortcode
<?php
// Output BuddyPress username through a shortcode
function cfc_bp_username ( $atts=null, $content=null ) {
global $user_ID;
if ( is_user_logged_in() ) {
return bp_core_get_username( $user_ID );
} else {
return "";
}
}
@BoweFrankema
BoweFrankema / buddypress-translate-widgets.php
Created February 13, 2015 16:19
Translate BuddyPress Widgets
//Translate BuddyPress Widgets
function cfc_widget_title( $title ) {
if ( $title == "Members") {
$title = __('Members Translation', 'cfctranslation') ;
}
return $title;
}
add_filter ( 'widget_title' , 'cfc_widget_title', 21 );
@BoweFrankema
BoweFrankema / bp-remember-me.php
Created February 18, 2015 09:06
Automatically check 'remember me' login checkbox.
<?php
function bp_login_checked_remember_me_back() {
add_filter( 'login_footer', 'bp_login_remember_me' );
}
add_action( 'init', 'bp_login_checked_remember_me_back' );
function bp_login_remember_me() {
echo '<script type="text/javascript">document.getElementById(\'rememberme\').checked = true</script>';
}
add_action( 'wp_footer', 'bp_login_remember_me' );
@BoweFrankema
BoweFrankema / bp-keep-me-logged-in.php
Created February 18, 2015 09:09
Keep me logged in for a longer time.
<?php
function bp_keep_me_logged_in( $expirein ) {
return 2629743; // 1 month in seconds
}
add_filter( 'auth_cookie_expiration', 'bp_keep_me_logged_in' );
?>
@BoweFrankema
BoweFrankema / buddypress-logged-in-user-redirect.php
Created February 20, 2015 17:03
Redirect logged in users from the homepage to the activity stream.
<?php
function cfc_bp_profile_homepage()
//Redirect logged in users from homepage to activity. This happens after login or when a user tries to go back to the homepage.
{
global $bp;
if( is_user_logged_in() && is_front_page() && !get_user_meta( $user->ID, 'last_activity', true ) )
{
wp_redirect( network_home_url( $bp->activity->root_slug ), 301 );
exit();
}
<?php
function bptricks_add_handle (){
echo '<span class="bbp-user-nicename"><span class="handle-sign">@</span>'. bp_core_get_username(bbp_get_reply_author_id(bbp_get_reply_id())) .'</span>' ;
}
add_action( 'bbp_theme_after_reply_author_details', 'bptricks_add_handle' );
?>
@BoweFrankema
BoweFrankema / default-buddypress-avatar-settings.php
Created February 23, 2015 10:38
Default BuddyPress Avatar Settings
<?php
/**
* Change Default Avatar Size
*/
if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) {
define( 'BP_AVATAR_THUMB_WIDTH', 80 );
}
if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) {
define( 'BP_AVATAR_THUMB_HEIGHT', 80 );
@BoweFrankema
BoweFrankema / theme-tour.php
Last active August 29, 2015 14:27 — forked from DevinWalker/theme-tour.php
Theme activation welcome message
<?php
/**
* Theme Activation Tour
*
* This class handles the pointers used in the introduction tour.
* @package Popup Demo
*
*/
class WordImpress_Theme_Tour {