Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
KaineLabs / bp_activities_sync_favorites.php
Last active Sep 19, 2022
BuddyPress Sync Activities Favourite with Activities Reactions.
View bp_activities_sync_favorites.php
<?php
/**
* BuddyPress Sync Activities Favourite with Activities Reactions.
* */
add_action( 'bp_init', function() {
if ( ! function_exists( 'yzar_option' ) ) {
return;
}
@KaineLabs
KaineLabs / yzc_add_update_group_cache.php
Last active Jul 20, 2022
yzc_add_update_group_cache.php
View yzc_add_update_group_cache.php
<?php
/*
* BuddyPress - Update Members Status & Update Groups Cache
*/
function yzc_add_update_group_cache() {
$members = get_users( 'fields=ID' );
foreach ( $members as $user_id ) {
bp_update_user_last_activity( $user_id, bp_core_current_time() );
@KaineLabs
KaineLabs / yzc_hide_group_activity_args.php
Last active Jul 12, 2022
BuddyPress - Hide Group Activities in Global Feed
View yzc_hide_group_activity_args.php
<?php
/**
* BuddyPress - Hide Group Activities in Global Feed
*/
function yzc_hide_group_activity_args( $args ) {
if ( ! bp_is_activity_directory() ) {
return $args;
}
$args['filter_query'] = array(
@KaineLabs
KaineLabs / yzc_fix_youzify_albums_count.php
Created Jun 26, 2022
Youzify Albums - Fix albums count
View yzc_fix_youzify_albums_count.php
<?php
/**
* Youzify Albums - Fix albums count
**/
add_action( 'init', 'yzc_fix_youzify_albums_count', 10);
function yzc_fix_youzify_albums_count( ) {
@KaineLabs
KaineLabs / youzify_disable_self_embed.php
Created Jun 20, 2022
Youzify - BuddyPress Disable Self-Domain Embeds
View youzify_disable_self_embed.php
<?php
/**
* Youzify - BuddyPress Mark Local Site Links as not Embed.
*/
add_filter( 'pre_oembed_result', function( $null = null, $url ) {
$site_domain = parse_url( site_url(), PHP_URL_HOST);
if ( strpos( $url, $site_domain ) !== false ) {
return '';
@KaineLabs
KaineLabs / yzc_disable_bbpress_css.php
Created Jun 13, 2022
Youzify - Disable BBpress CSS
View yzc_disable_bbpress_css.php
<?php
/**
* Youzify - Disable BBpress CSS
*/
function yzc_disable_bbpress_css() {
// Remove Youzer CSS.
remove_action( 'wp_enqueue_scripts', 'youzify_bbpress_scripts' );
}
add_action( 'init', 'yzc_disable_bbpress_css', 10 );
View youzify_albums_switch_attachments_order.php
<?php
add_filter( 'youzify_albums_switch_attachments_order' , '__return_false', 999 );
function yzc_albums_attachments_append() { ?>
<script type="text/javascript">window.youzify_albums_append_attachments = true;</script>
<?php
@KaineLabs
KaineLabs / custom_youzify_group_profile_cover.php
Last active May 11, 2022
BuddyPress - Make Group Covers Clickable in Groups Directory Page
View custom_youzify_group_profile_cover.php
<?php
/**
* BuddyPress - Make group covers clickable in groups directory page.
*/
add_filter('youzify_group_profile_cover', 'custom_youzify_group_profile_cover', 999, 2);
function custom_youzify_group_profile_cover($group_cover, $group_id){
$group_link = bp_get_group_permalink($group_id);
if (!empty($group_link)) {
$group_cover = '<a href="' . $group_link . '">' . $group_cover . '</a>';
@KaineLabs
KaineLabs / yzc_make_custom_tab_as_directory.php
Created May 7, 2022
BuddyPress - Make custom tab behave as Directory
View yzc_make_custom_tab_as_directory.php
<?php
/**
* BuddyPress - Make custom tab behave as Directory.
*/
add_filter( 'bp_is_directory', 'yzc_make_custom_tab_as_directory' );
function yzc_make_custom_tab_as_directory( $retval ) {
if ( bp_current_component() == 'custom_tab_slug' ) {
return true;
}
return $retval;
@KaineLabs
KaineLabs / yzc_make_blog_images_full_size.php
Created Apr 28, 2022
Youzify - Make Profile Posts Tab Images Full size
View yzc_make_blog_images_full_size.php
<?php
/**
* Youzify - Make Blog Posts Tab Images Full size
*/
add_filter( 'youzify_get_attachment_image_size', 'yzc_make_blog_images_full_size', 10, 2 );
function yzc_make_blog_images_full_size( $size, $element ) {
if ( $element == 'profile-posts-tab' ) {
return 'full';
}