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
function licenses_save() { | |
if ( empty( $_POST['um_options'] ) || empty( $_POST['licenses_settings'] ) ) { | |
return; | |
} | |
foreach ( $_POST['um_options'] as $key => $value ) { | |
$key = sanitize_key( $key ); | |
$value = sanitize_text_field( $value ); | |
$edd_action = ''; |
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 | |
/** | |
* Paste to active child-theme/ultimate-member/um-messaging/conversations.php file. | |
* | |
* Template for the UM Private Messages. | |
* Used on the "Profile" page, "Messages" tab. | |
* | |
* Shortcode: [ultimatemember_messages] | |
* Caller: method Messaging_Shortcode->ultimatemember_messages() | |
* @version 2.3.5 |
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
function um_custom_country_choices_callback() { | |
// choices array. | |
$countries = array( | |
"FR" => "France", | |
"ES" => "Spain", | |
"IT" => "Italy", | |
); | |
return array_unique( $countries ); | |
} |
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
function um_custom_add_status_links( $views ) { | |
remove_filter( 'pre_user_query', array( UM()->admin()->users_columns(), 'filter_users_by_status' ) ); | |
$old_views = $views; | |
$views = array(); | |
if ( ! isset( $_REQUEST['role'] ) && ! isset( $_REQUEST['um_user_status'] ) ) { | |
$views['all'] = '<a href="' . admin_url( 'users.php' ) . '" class="current">' . __( 'All', 'ultimate-member' ) . ' <span class="count">(' . UM()->query()->count_users() . ')</span></a>'; | |
} else { | |
$views['all'] = '<a href="' . admin_url( 'users.php' ) . '">' . __( 'All', 'ultimate-member' ) . ' <span class="count">(' . UM()->query()->count_users() . ')</span></a>'; |
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
function my_um_loggedin_inner_content_without_kses( $prepared_content, $content ) { | |
return apply_shortcodes( UM()->shortcodes()->convert_locker_tags( wpautop( $content ) ) ); | |
} | |
add_filter( 'um_loggedin_inner_content', 'my_um_loggedin_inner_content_without_kses', 10, 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
function um_users_update_role() { | |
if ( isset( $_GET['um_remove_subscriber'] ) && '1' == $_GET['um_remove_subscriber'] ) { | |
$users = get_users( | |
array( | |
'fields' => 'ids', | |
'role__in' => array( 'um_gold-member', 'um_bronze-member', 'um_silber-member' ), | |
'number' => -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
function custom_um_query_args_c2n_gender__filter_meta( $skip, $query, $field, $value, $filter_type, $is_default ) { | |
if ( ! is_array( $value ) ) { | |
$value = array( $value ); | |
} | |
// $join_alias is pre-escaped. | |
$query->joins[] = "LEFT JOIN {$wpdb->prefix}um_metadata {$join_alias} ON {$join_alias}.user_id = u.ID"; | |
$values_array = array(); | |
foreach ( $value as $single_val ) { |
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
add_action( 'init', 'my_custom_init' ); | |
function my_custom_init() { | |
if ( isset( $_GET['check_lifeguard'] ) && '1' == $_GET['check_lifeguard'] ) { | |
global $wpdb; | |
$meta_results = $wpdb->get_results( | |
"SELECT um.* | |
FROM {$wpdb->usermeta} um | |
WHERE um.user_id IN('1736','1251')", | |
ARRAY_A |
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
// It works since the 2.2.3: | |
// Avoid changing the post title to the "restricted content title". | |
add_filter( 'um_ignore_restricted_title', '__return_true' ); | |
// Avoid changing the post content to the "restricted content content" not recommended to use or use with caution! | |
add_filter( 'um_ignore_restricted_content', '__return_true' ); | |
// Avoid flushing the post excerpt when post is restricted. | |
add_filter( 'um_ignore_restricted_excerpt', '__return_true' ); | |
// It works since the 2.8.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 | |
namespace um\core; | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
if ( ! class_exists( 'um\core\User' ) ) { | |
NewerOlder