- added filter for show meta HTML;

- removed redundant code from member directories class;
This commit is contained in:
nikitasinelnikov
2019-11-04 21:17:13 +02:00
parent 6f0ba1bccf
commit 4a4eb5debf
2 changed files with 3 additions and 14 deletions
+2 -13
View File
@@ -1208,7 +1208,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
}
// Add OR instead AND to search in WP core fields user_email, user_login, user_display_name
$search_where = $context->get_search_sql( $search, UM()->member_directory()->core_search_fields, 'both' );
$search_where = $context->get_search_sql( $search, $this->core_search_fields, 'both' );
$search_where = preg_replace( '/ AND \((.*?)\)/im', "$1 OR", $search_where );
@@ -1225,17 +1225,6 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
}
/**
* Use OR in search query if there is only searching, but with filters there will be AND conditional
* @param $replacement
*
* @return string
*/
function organic_replacement( $replacement ) {
return " OR ( $1 )";
}
/**
* Handle filters request
*/
@@ -1249,10 +1238,10 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
}
}
// added for user tags extension integration on individual tag page
$ignore_empty_filters = apply_filters( 'um_member_directory_ignore_empty_filters', false );
if ( empty( $filter_query ) && ! $ignore_empty_filters ) {
//add_filter( 'um_member_directory_organic_search_replacement', array( &$this, 'organic_replacement' ) );
return;
}
+1 -1
View File
@@ -394,7 +394,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
$icon = ! empty( $data['icon'] ) ? '<i class="' . $data['icon'] . '"></i>' : '';
}
$items[] = '<span>' . $icon . $value . '</span>';
$items[] = apply_filters( 'um_show_meta_item_html', '<span>' . $icon . $value . '</span>', $key );
$items[] = '<span class="b">&bull;</span>';
}
}