Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
KaineLabs / yzc_mention_user_on_reply.php
Created Apr 28, 2022
Youzify - BuddyPress Mention User On Reply
View yzc_mention_user_on_reply.php
<?php
/**
* Youzify - BuddyPress Mention User On Reply
*/
add_action( 'wp_footer', 'yzc_mention_user_on_reply' );
function yzc_mention_user_on_reply() {
?>
<script type="text/javascript">
@KaineLabs
KaineLabs / yzc_set_restriction_by_group_type.php
Created Apr 22, 2022
Youzify - Restrict BuddyPress Groups Access by Group Type
View yzc_set_restriction_by_group_type.php
<?php
/**
* Youzify - Restrict BuddyPress Groups Access by Group Type
* */
function yzc_set_restriction_by_group_type() {
$restriction_roles = array(
'subscriber' => array(
'nature' => 5,
@KaineLabs
KaineLabs / yzc_disable_friendship_notifications.php
Created Apr 5, 2022
Youzify - Disable Friendship Notifications Settings
View yzc_disable_friendship_notifications.php
<?php
/**
* Youzify - Disable Friendship Notifications Settings
* */
add_action( 'youzify_profile_settings', 'yzc_disable_friendship_notifications' );
function yzc_disable_friendship_notifications() {
if ( bp_current_action() == 'notifications' ) {
add_filter( 'bp_is_active' , 'yzc_disable_friendship', 10, 2 );
}
}
@KaineLabs
KaineLabs / youzify_recent_posts_widget_order_by.php
Created Apr 4, 2022
Youzify - Sort Recent Posts Widget by Last Modified Date
View youzify_recent_posts_widget_order_by.php
<?php
// Youzify - Sort Recent Posts Widget by Last Modified Date
add_filter( 'youzify_recent_posts_widget_order_by', 'yzc_order_by_last_modified' );
function yzc_order_by_last_modified() {
return 'modified';
}
@KaineLabs
KaineLabs / yzc_exclude_users_by_meta_value.php
Created Mar 31, 2022
Youzify - BuddyPress Exclude Users from Members Directory by Meta Value
View yzc_exclude_users_by_meta_value.php
<?php
/**
* Youzify - BuddyPress Exclude Users from Members Directory by Meta Value
* Ps: Adminstartor can see everyone one.
*/
function yzc_exclude_users_by_meta_value( $args ) {
// do not exclude in admin.
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
return $args;
@KaineLabs
KaineLabs / yzc_change_range_field_type.php
Last active Mar 23, 2022
Youzify - Change Search Members Range from Number to Select
View yzc_change_range_field_type.php
<?php
/**
* Youzify - Change Search Members Range Field type from Number to Select
*/
add_filter( 'yzms_range_field_args', 'yzc_change_range_field_type', 10 );
function yzc_change_range_field_type( $args ) {
// Get Field ID.
$field_id = 98;
View yzc_alma_theme_fix.php
<?php
// Alma Theme Before Content Code
function yzc_alma_theme_before_content() {
if ( function_exists( 'alma_print_menu' ) ) {
alma_print_menu();
}
?>
<style type="text/css">
#main header {
position: relative;
@KaineLabs
KaineLabs / yzc_delete_all_youzer_options.php
Created Mar 8, 2022
Delete All Old Youzer Options From Database.
View yzc_delete_all_youzer_options.php
<?php
/**
* Delete All Old Youzer Options From Database.
*/
add_action( 'init', 'yzc_delete_all_youzer_options' );
function yzc_delete_all_youzer_options() {
global $wpdb;
@KaineLabs
KaineLabs / yzc_enable_custom_post_type_blog_comment_sync.php
Created Mar 4, 2022
Youzify - BuddyPress Sync Custom Post Type Activity Comments with Blog
View yzc_enable_custom_post_type_blog_comment_sync.php
<?php
/**
* Youzify - BuddyPress Sync Custom Post Type Activity Comments with Blog.
* */
function yzc_enable_custom_post_type_blog_comment_sync( $args ) {
$args['new_video'] = (object)array(
'component_id' => 'activity',
'action_id' => 'new_video',
'bp_activity_admin_filter' => __( 'Published a new video', 'youzify' ),
@KaineLabs
KaineLabs / yzc_add_field_group_description.php
Created Mar 3, 2022
Youzify - BuddyPress Add Info Group Fields Description
View yzc_add_field_group_description.php
<?php
/**
* Youzify - BuddyPress Add Info Group Fields Description.
*/
add_action( 'youzify_before_account_settings_form', 'yzc_add_field_group_description' );
function yzc_add_field_group_description() {
// Get Current Page.