Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
KaineLabs / yzc_disable_bp_confirmation_email.php
Last active April 2, 2025 18:20
Disable buddypress confirmation e-mail only admins can approve accounts
<?php
/**
* Disable Confimation Messages and E-mail.
**/
function yzc_disable_bp_confirmation_email() {
return false;
}
add_filter( 'bp_registration_needs_activation', 'yzc_disable_bp_confirmation_email' );
@KaineLabs
KaineLabs / yzc_set_activity_comments_length.php
Last active February 8, 2025 12:56
Set Activity Comments Length
<?php
/**
* Set Activity Comments Length - Show the latest 2 comments.
*/
function yzc_set_activity_comments_length() { ?>
<script type="text/javascript">window.youzify_comments_length = 2;</script>
<?php
@KaineLabs
KaineLabs / yzc_limit_profile_tab_by_member_type.php
Created April 30, 2019 05:39
Limit Profile Tab By Member Type.
<?php
/**
* Limit Profile Tab By Member Type.
*/
function yzc_limit_profile_tab_by_member_type() {
// Get User Member Type
$member_type = bp_get_member_type( bp_displayed_user_id() );
// Remove Tabs By Member Type
if ( 'member_type_id_here1' != $member_type ) {
@KaineLabs
KaineLabs / yz-notifications-and-messages-nav-menu-count.php
Last active January 14, 2025 14:33
Add Notifications And Messages Nav Menu Counts.
<?php
/**
* Add Notifications & Messages Nav Menu Counts.
*/
function yzc_notifications_and_messages_nav_menu_count( $items ) {
// Set up Array's.
foreach( $items as $key => $item ) {
@KaineLabs
KaineLabs / yz-md-show-all-site-members-count.php
Created February 13, 2018 02:46
Show All Site Members Count.
/**
* Show All Site Members Count.
*/
function youzer_show_all_site_members_count() {
return bp_get_total_site_member_count();
}
add_filter( 'bp_get_total_member_count', 'youzer_show_all_site_members_count' );
@KaineLabs
KaineLabs / youzify_bp_overload_templates.php
Created November 29, 2024 11:06
Force Youzify Template
<?php
// Force Youzify Template
add_action( 'bp_loaded', 'youzify_bp_overload_templates' , 999);
@KaineLabs
KaineLabs / yzc_fix_frontend_submission_editor.php
Created November 13, 2024 17:41
Youzify - Fix Enfold Theme "Add Media" Button
<?php
/**
* Youzify - Fix Enfold Theme "Add Media" Button
* */
function yzc_fix_frontend_submission_editor( $default ) {
if ( bp_current_component() ) {
return 'force_mediaelement';
}
<?php
// Enable Block Based Theme Template
function yzc_override_youzify_template_using_block_based_template() {
ob_start();
wp_head();
@KaineLabs
KaineLabs / yzc_notify_users_on_activities.php
Created February 29, 2024 10:28
BuddyPress - Youzify Send email notifications to All users if there's a new posts
<?php
/**
* Youzify - BuddyPress Notify Users on New Activities.
*/
add_action( 'youzify_after_adding_wall_post', 'yzc_notify_users_on_activities', 999 );
function yzc_notify_users_on_activities( $activity_id ) {
$subject = "New activity posted!";
$message = 'New activity has been posted, please visit ' . bp_activity_get_permalink( $activity_id );
// Get all users.
@KaineLabs
KaineLabs / YZC_Activity_Custom_Post_Type.php
Last active September 25, 2024 16:07
Add Activity Custom Post Type.
<?php
/**
* Add Activity Custom Post Type.
*/
class YZC_Activity_Custom_Post_Type {
public $post_title;
public $post_type;
public $post_action;
public $enable_upload_attachments;