Created
February 4, 2025 11:32
-
-
Save yuriinalivaiko/f074aeae3c605d0fe0e5ee29418b2d11 to your computer and use it in GitHub Desktop.
Code snippets for the "Friends" extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Hide the "Friends" extension elements for guests. | |
if ( ! is_user_logged_in() && defined( 'um_friends_version' ) ) { | |
// A button in profile cover area. | |
remove_action( 'um_before_profile_main_meta', 'um_friends_add_button', 10 ); | |
// A button in profile meta area. | |
remove_action( 'um_after_profile_header_name', 'um_friends_add_button_nocover', 60 ); | |
// Button and stats in the directory. | |
remove_action( 'um_members_just_after_name_tmpl', array( UM()->Friends_API()->member_directory(), 'friends_stats' ), 2 ); | |
remove_action( 'um_members_just_after_name_tmpl', array( UM()->Friends_API()->member_directory(), 'friends_button' ), 102 ); | |
remove_action( 'um_members_list_after_user_name_tmpl', array( UM()->Friends_API()->member_directory(), 'friends_stats' ), 2 ); | |
remove_action( 'um_members_list_just_after_actions_tmpl', array( UM()->Friends_API()->member_directory(), 'friends_button' ), 102 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment