mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Add new filter hooks
- um_get_option_filter__{$option_id}
- um_profile_{$key}__filter
- um_profile_{$key}_empty__filter
This commit is contained in:
@@ -1055,8 +1055,8 @@ function um_get_option($option_id) {
|
||||
global $ultimatemember;
|
||||
if ( !isset( $ultimatemember->options ) ) return '';
|
||||
$um_options = $ultimatemember->options;
|
||||
if ( isset($um_options[$option_id]) && !empty( $um_options[$option_id] ) ) {
|
||||
return $um_options[$option_id];
|
||||
if ( isset( $um_options[ $option_id ] ) && !empty( $um_options[ $option_id ] ) ) {
|
||||
return apply_filters("um_get_option_filter__{$option_id}", $um_options[ $option_id ] );
|
||||
}
|
||||
|
||||
switch($option_id){
|
||||
@@ -1131,11 +1131,15 @@ function um_fetch_user( $user_id ) {
|
||||
***/
|
||||
function um_profile( $key ){
|
||||
global $ultimatemember;
|
||||
if (isset( $ultimatemember->user->profile[$key] ) && !empty( $ultimatemember->user->profile[$key] ) ){
|
||||
return $ultimatemember->user->profile[$key];
|
||||
|
||||
if (isset( $ultimatemember->user->profile[ $key ] ) && !empty( $ultimatemember->user->profile[ $key ] ) ){
|
||||
$value = apply_filters("um_profile_{$key}__filter", $ultimatemember->user->profile[ $key ] );
|
||||
} else {
|
||||
return false;
|
||||
$value = apply_filters("um_profile_{$key}_empty__filter", false );
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
Reference in New Issue
Block a user