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 | |
| // Automatically follow the brand profile on registration. | |
| add_action( 'um_registration_set_extra_data', function( $user_id, $args ) { | |
| if ( defined( 'um_followers_version' ) ) { | |
| // all new members will "follow" this brand profile. | |
| $brand_user_id = 1; | |
| if ( UM()->Followers_API()->api()->can_follow( $brand_user_id, $user_id ) ) { |
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 | |
| // Apply the role's auto-verify feature when the role is changed manually. | |
| if ( function_exists( 'um_after_user_role_is_updated' ) ) { | |
| add_action( 'add_user_role', 'um_after_user_role_is_updated', 20, 2 ); | |
| add_action( 'set_user_role', 'um_after_user_role_is_updated', 20, 2 ); | |
| } |
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 | |
| /** | |
| * Plugin Name: Ultimate Member - Conflicts Fix | |
| * Description: Disable conflicting plugins on UM pages. | |
| * Author: Ultimate Member support team | |
| * Author URI: https://ultimatemember.com/support/ | |
| * Version: 1.0.0 | |
| * | |
| * Add this code to the file /wp-content/mu-plugins/um_conflicts_fix.php | |
| */ |
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 | |
| /** | |
| * Add custom image field into the variable "user" used to build member directory cards. | |
| */ | |
| add_filter( 'um_ajax_get_members_data', 'custom_um_ajax_get_members_data', 10, 3 ); | |
| function custom_um_ajax_get_members_data( $data_array, $user_id, $directory_data ) { | |
| // Enter the field meta_key you need. | |
| $key = 'um_image_upload'; |
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 | |
| /** | |
| * Display custom images in the member directory grid. | |
| */ | |
| add_filter( 'um_ajax_get_members_data', function( $data_array, $user_id, $directory_data ) { | |
| // List needed fields here. | |
| $fields = array( | |
| 'um_image_upload', |
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 | |
| // Continent field. | |
| function custom_continent_choices_callback() { | |
| // choices array. | |
| $options = array( | |
| "africa" => "Africa", | |
| "america" => "America", | |
| "eurasia" => "Eurasia", |
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 | |
| /** | |
| * Display all form errors in the popup. | |
| */ | |
| add_action( 'um_after_form', function () { | |
| if ( ! empty( UM()->form()->errors ) ) { | |
| $error_text = implode( '<br>', UM()->form()->errors ); | |
| ?> | |
| <div id="um_form_errors" style="display:none;"> |
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 | |
| // Set a field you want to remove here. | |
| $meta_key = 'um_number_graduation'; | |
| function um_delete_field( $meta_key ) { | |
| global $wpdb; | |
| // Remove the field. | |
| UM()->fields()->delete_field_from_db( $meta_key ); |
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
| /** | |
| * Enlarge the font size in the activity wall. | |
| * | |
| * Add this file to the theme directory. | |
| */ | |
| .um-activity-wall .um-activity-head, | |
| .um-activity .um-activity-head { | |
| font-size: 14px; /* original 12px */ | |
| } | |
| .um-activity-wall .um-activity-ticon, |
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 | |
| // Delete group discussion posts after 6 months. | |
| add_action( 'um_daily_scheduled_events', 'um_groups_autodelete' ); | |
| function um_groups_autodelete() { | |
| $args = array( | |
| 'post_type' => 'um_groups_discussion', | |
| 'fields' => 'ids', | |
| 'numberposts' => -1, |