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, |
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 | |
/** | |
* Hook: um_after_email_notification_sending | |
* | |
* Type: action | |
* | |
* Description: Fires after sending an email notification. | |
* | |
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-mail.php#L456 |
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 grouped filters to the member directory. | |
* | |
* Add filters you need to this array. Every filter is an array where: | |
* - key Filter key. Any valid string key. | |
* - type Filter type. Accepts: 'text', 'select', 'slider', 'datepicker', 'timepicker'. | |
* - label Filter label (used as the filter placeholder). | |
* - fields An array of usermeta keys. Filter searches a value in these usermeta. |
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 | |
// Use direct links for images in the social activity wall. | |
function um_activity_get_download_link_direct( $url, $post_id, $author_id ) { | |
$photo = get_post_meta( $post_id, '_photo', true ); | |
return home_url( "/wp-content/uploads/ultimatemember/{$author_id}/{$photo}" ); | |
} | |
add_filter( 'um_activity_get_download_link', 'um_activity_get_download_link_direct', 10, 3 ); |
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 | |
// Enqueue the "select2" script earlier to avoid a conflict with "selectWoo". | |
add_action( 'admin_enqueue_scripts', 'um_fix_selectWoo_conflict' ); | |
add_action( 'wp_enqueue_scripts', 'um_fix_selectWoo_conflict' ); | |
function um_fix_selectWoo_conflict() { | |
if ( wp_script_is( 'select2' ) && wp_script_is( 'selectWoo' ) ) { | |
$wp_scripts = wp_scripts(); | |
if ( ! in_array( 'select2', $wp_scripts->queue, true ) && isset( $wp_scripts->registered[ 'select2' ] ) ) { | |
array_unshift( $wp_scripts->queue, 'select2' ); |