mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Merge branch 'master' of https://github.com/ultimatemember/ultimatemember into release/2.0.18
This commit is contained in:
@@ -244,9 +244,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
global $post;
|
||||
|
||||
$curr = UM()->permalinks()->get_current_url();
|
||||
$ms_empty_role_access = is_multisite() && is_user_logged_in() && !UM()->roles()->get_priority_user_role( um_user('ID') );
|
||||
|
||||
if ( is_front_page() ) {
|
||||
if ( is_user_logged_in() ) {
|
||||
if ( is_user_logged_in() && !$ms_empty_role_access ) {
|
||||
|
||||
$user_default_homepage = um_user( 'default_homepage' );
|
||||
if ( ! empty( $user_default_homepage ) )
|
||||
@@ -300,7 +301,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
} elseif ( is_category() ) {
|
||||
if ( ! is_user_logged_in() ) {
|
||||
if ( ! is_user_logged_in() || $ms_empty_role_access ) {
|
||||
|
||||
$access = UM()->options()->get( 'accessible' );
|
||||
|
||||
@@ -324,7 +325,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
$access = UM()->options()->get( 'accessible' );
|
||||
|
||||
if ( $access == 2 && ! is_user_logged_in() ) {
|
||||
if ( $access == 2 && ( !is_user_logged_in() || $ms_empty_role_access ) ) {
|
||||
|
||||
//build exclude URLs pages
|
||||
$redirects = array();
|
||||
|
||||
@@ -88,14 +88,14 @@ if ( ! class_exists( 'um\core\Members' ) ) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show filter
|
||||
/**
|
||||
* Prepare filter data
|
||||
*
|
||||
* @param $filter
|
||||
* @return array
|
||||
*/
|
||||
function show_filter( $filter ) {
|
||||
$fields = UM()->builtin()->all_user_fields;
|
||||
function prepare_filter( $filter ) {
|
||||
$fields = UM()->builtin()->all_user_fields;
|
||||
|
||||
if ( isset( $fields[ $filter ] ) ) {
|
||||
$attrs = $fields[ $filter ];
|
||||
@@ -222,6 +222,21 @@ if ( ! class_exists( 'um\core\Members' ) ) {
|
||||
$attrs = apply_filters( 'um_search_select_fields', $attrs );
|
||||
}
|
||||
|
||||
return compact( 'type', 'attrs' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show filter
|
||||
*
|
||||
* @param $filter
|
||||
*/
|
||||
function show_filter( $filter ) {
|
||||
/**
|
||||
* @var $type
|
||||
* @var $attrs
|
||||
*/
|
||||
extract( $this->prepare_filter( $filter ) );
|
||||
|
||||
switch ( $type ) {
|
||||
|
||||
case 'select':
|
||||
|
||||
@@ -22,11 +22,8 @@ add_action( 'init', 'um_block_wpadmin_by_user_role', 99 );
|
||||
* @return bool
|
||||
*/
|
||||
function um_control_admin_bar( $content ) {
|
||||
if ( is_user_logged_in() ) {
|
||||
if ( um_user( 'can_not_see_adminbar' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
if ( is_user_logged_in() && um_user( 'can_not_see_adminbar' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $content;
|
||||
|
||||
@@ -141,19 +141,25 @@ function um_add_search_to_query( $query_args, $args ){
|
||||
'value' => trim( $value ),
|
||||
'compare' => '=',
|
||||
),
|
||||
array(
|
||||
'key' => $field,
|
||||
'value' => trim( $value ),
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
array(
|
||||
'key' => $field,
|
||||
'value' => trim( $serialize_value ),
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
'relation' => 'OR',
|
||||
);
|
||||
|
||||
$filter_data = UM()->members()->prepare_filter( $field );
|
||||
if( $filter_data['type'] != 'select' ) {
|
||||
$field_query = array_merge( $field_query, array(
|
||||
array(
|
||||
'key' => $field,
|
||||
'value' => trim( $value ),
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
array(
|
||||
'key' => $field,
|
||||
'value' => trim( $serialize_value ),
|
||||
'compare' => 'LIKE',
|
||||
),
|
||||
'relation' => 'OR',
|
||||
) );
|
||||
}
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user