Skip to content

Instantly share code, notes, and snippets.

@jonasnick
jonasnick / bca.php
Last active October 17, 2022 20:36
Blog Comments in Activity (bca) Shows blog post comments in buddypress' activity stream. Does currently not keep track of editing or removing comments.
<?php
/*
* Blog Comments in Buddypress Activity
* WARNING: Test thoroughly if it works in your environment before using in production code.
* LICENSE: Public domain
*/
/*
* When a new comment gets added to the database, add this comment to the
@KaineLabs
KaineLabs / remove-yoast-meta-tags.php
Last active October 30, 2021 19:55
Youzify - BuddyPress Remove Yoast Meta Tags
<?php
/**
* Remove Yoast Meta Tags in profiles and groups pages.
*/
function remove_all_wpseo_og() {
if ( bp_is_user() || bp_is_group() ) {
$front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
}
}
@KaineLabs
KaineLabs / yz-change-images-compression-quality.php
Created July 13, 2018 17:27
Change Images Compression Quality
<?php
/**
* Change Images Compression Quality
*/
function yzc_attachments_compression_quality( $quality ) {
// By default the quality is : 80.
return 80;
}
add_filter( 'yz_attachments_compression_quality', 'yzc_attachments_compression_quality' );
@KaineLabs
KaineLabs / yz-show-unearned-badges.php
Created September 19, 2018 02:49
Show Unearned Badges In The Badges Tab
<?php
// Show Unearned Badges In The Badges Tab
function yzc_add_unearned_badges_to_badges_list() {
add_filter( 'mycred_the_badge', 'yzc_mycred_the_badge', 10, 3 );
// Get User ID.
$user_id = bp_displayed_user_id();
@KaineLabs
KaineLabs / yz-post-on-other-users-wall.php
Last active February 13, 2022 22:20
Post On Other Users Wall !
<?php
/**
* Display Posting Form In Friends Wall.
*/
add_action( 'bp_before_member_activity_post_form', 'yzc_add_posting_form_in_friends_wall' );
function yzc_add_posting_form_in_friends_wall() {
if ( is_user_logged_in() && ! bp_is_my_profile() && bp_is_user() ) {
add_filter( 'gettext', 'yzc_change_whats_new_msg', 10 );
<?php
/**
* Add Tagname to profile username.
*/
function yzc_add_username_tag( $username ) {
// Get Current User Data.
$user = get_userdata( bp_displayed_user_id() );
@KaineLabs
KaineLabs / yzc_edit_files_max_size.php
Last active July 24, 2019 10:23
Set Max Files Size By Member Type
<?php
/**
* Set Max Files Size By Member Type.
*/
function yzc_edit_files_max_size( $option_value = null, $option_id = null ) {
// Get User Member Types
$member_type = bp_get_member_type( bp_loggedin_user_id() );
<?php
/**
* Change Cover Image Size.
*/
function yzc_attachments_get_cover_image_dimensions( $wh ) {
return array( 'width' => 1350, 'height' => 350 );
}
add_filter( 'bp_attachments_get_cover_image_dimensions', 'yzc_attachments_get_cover_image_dimensions', 99 );
@KaineLabs
KaineLabs / yzc_sync_profile_about_me_widget.php
Last active January 22, 2021 05:03
Sync About Me Widget
<?php
/**
* Sync About Me Widget - Image.
*/
function yzc_sync_profile_about_me_widget_image( $photo_url = null, $user_id ) {
if ( ! empty( $photo_url ) || bp_is_current_component( 'widgets' ) ) {
return $photo_url;
}
@KaineLabs
KaineLabs / yzc_change_lost_password_link.php
Created April 10, 2019 03:11
Change Lost Password Page Link.