mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- updated dependencies versions;
- fixed permalinks generate function for getting raw base permalink from the user meta;
This commit is contained in:
@@ -2458,7 +2458,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// update for um_member_directory_data metakey
|
||||
if ( isset( $_POST['um_options']['use_gravatars'] ) ) {
|
||||
if ( $this->gravatar_changed ) {
|
||||
|
||||
@@ -32,10 +32,10 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
|
||||
public $ext_required_version = array(
|
||||
'bbpress' => '2.0.7',
|
||||
'followers' => '2.1.6',
|
||||
'forumwp' => '2.0.4',
|
||||
'forumwp' => '2.1.5',
|
||||
'friends' => '2.1.4',
|
||||
'groups' => '2.1.7',
|
||||
'jobboardwp' => '1.0.0',
|
||||
'jobboardwp' => '1.0.7',
|
||||
'mailchimp' => '2.2.0',
|
||||
'messaging' => '2.2.5',
|
||||
'mycred' => '2.1.6',
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'UM' ) ) {
|
||||
|
||||
|
||||
@@ -699,11 +699,12 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* @param $user_id
|
||||
* @param int $user_id
|
||||
* @param bool $raw
|
||||
*
|
||||
* @return bool|mixed
|
||||
*/
|
||||
public function get_profile_slug( $user_id ) {
|
||||
public function get_profile_slug( $user_id, $raw = false ) {
|
||||
// Permalink base
|
||||
$permalink_base = UM()->options()->get( 'permalink_base' );
|
||||
if ( 'custom_meta' === $permalink_base ) {
|
||||
@@ -720,6 +721,10 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
}
|
||||
$profile_slug = get_user_meta( $user_id, $meta_key, true );
|
||||
|
||||
if ( $raw ) {
|
||||
return $profile_slug;
|
||||
}
|
||||
|
||||
//get default username permalink if it's empty then return false
|
||||
if ( empty( $profile_slug ) ) {
|
||||
if ( 'user_login' !== $permalink_base ) {
|
||||
@@ -779,7 +784,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
delete_option( "um_cache_userdata_{$user_id}" );
|
||||
|
||||
$current_profile_slug = $this->get_profile_slug( $user_id );
|
||||
$current_profile_slug = $this->get_profile_slug( $user_id, true );
|
||||
|
||||
$user_in_url = '';
|
||||
$permalink_base = UM()->options()->get( 'permalink_base' );
|
||||
@@ -847,9 +852,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
update_user_meta( $user_id, "um_email_as_username_{$user_in_url}", $user_email );
|
||||
|
||||
} else {
|
||||
|
||||
$user_in_url = urlencode( $user_in_url );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,9 +900,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
update_user_meta( $user_id, "um_email_as_username_{$user_in_url}", $user_email );
|
||||
|
||||
} else {
|
||||
|
||||
$user_in_url = sanitize_title( $user_in_url );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user