mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-19 22:54:03 +09:00
- member directories upgrade;
- user tags integration; - fixed member directory pagination; - fixed styles;
This commit is contained in:
@@ -137,7 +137,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
|
||||
|
||||
wp_register_script('um_dropdown', $this->js_baseurl . 'dropdown' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
|
||||
|
||||
wp_register_script('um_members', $this->js_baseurl . 'um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown' ), ultimatemember_version, true );
|
||||
wp_register_script('um_members', $this->js_baseurl . 'um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks' ), ultimatemember_version, true );
|
||||
wp_register_script('um_profile', $this->js_baseurl . 'um-profile' . $this->suffix . '.js', array( 'jquery', 'wp-util' ), ultimatemember_version, true );
|
||||
wp_register_script('um_account', $this->js_baseurl . 'um-account' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
|
||||
|
||||
|
||||
@@ -292,6 +292,9 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function init_filter_types() {
|
||||
$this->filter_types = apply_filters( 'um_members_directory_filter_types', array(
|
||||
'country' => 'select',
|
||||
@@ -386,7 +389,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$attrs = apply_filters( "um_custom_search_field_{$filter}", array() );
|
||||
$attrs = apply_filters( "um_custom_search_field_{$filter}", array(), $field_key );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,7 +413,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$attrs = apply_filters( 'um_search_fields', $attrs );
|
||||
$attrs = apply_filters( 'um_search_fields', $attrs, $field_key );
|
||||
|
||||
$unique_hash = substr( md5( $directory_data['form_id'] ), 10, 5 );
|
||||
|
||||
@@ -583,7 +586,6 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
*/
|
||||
function slider_filters_range( $filter, $directory_data ) {
|
||||
|
||||
|
||||
switch ( $filter ) {
|
||||
|
||||
default: {
|
||||
@@ -638,10 +640,10 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
if ( ! $placeholder ) {
|
||||
switch ( $attrs['type'] ) {
|
||||
default:
|
||||
$placeholder = "<strong>$label:</strong> {min_range} - {max_range}";
|
||||
$placeholder = "<strong>$label:</strong> {min_range} - {max_range}";
|
||||
break;
|
||||
case 'rating':
|
||||
$placeholder = "<strong>$label:</strong> {min_range} - {max_range}" . __( ' stars', 'ultimate-member' );
|
||||
$placeholder = "<strong>$label:</strong> {min_range} - {max_range}" . __( ' stars', 'ultimate-member' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -649,7 +651,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
break;
|
||||
}
|
||||
case 'birth_date': {
|
||||
$placeholder = __( '<strong>Age:</strong> {min_range} - {max_range} years old', 'ultimate-member' );
|
||||
$placeholder = __( '<strong>Age:</strong> {min_range} - {max_range} years old', 'ultimate-member' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1250,7 +1252,9 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $filter_query ) ) {
|
||||
$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;
|
||||
}
|
||||
@@ -1484,7 +1488,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
$current_page = ! empty( $_POST['page'] ) ? $_POST['page'] : 1;
|
||||
|
||||
$total_users = ( ! empty( $max_users ) && $max_users <= $result->total_users ) ? $max_users : $result->total_users;
|
||||
$total_users = ( ! empty( $directory_data['max_users'] ) && $directory_data['max_users'] <= $result->total_users ) ? $directory_data['max_users'] : $result->total_users;
|
||||
$total_pages = ceil( $total_users / $directory_data['profiles_per_page'] );
|
||||
|
||||
if ( ! empty( $total_pages ) ) {
|
||||
@@ -1732,6 +1736,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
wp_send_json_success( array( 'users' => array(), 'pagination' => $pagination_data ) );
|
||||
}
|
||||
|
||||
do_action( 'um_member_directory_before_query' );
|
||||
|
||||
// Prepare for BIG SELECT query
|
||||
$wpdb->query( 'SET SQL_BIG_SELECTS=1' );
|
||||
@@ -1818,8 +1823,6 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
$user_query = new \WP_User_Query( $this->query_args );
|
||||
|
||||
//var_dump( $user_query->request );
|
||||
|
||||
remove_filter( 'get_meta_sql', array( &$this, 'change_meta_sql' ), 10 );
|
||||
|
||||
/**
|
||||
|
||||
@@ -542,21 +542,22 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
*/
|
||||
function load( $args ) {
|
||||
$defaults = array();
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
// when to not continue
|
||||
$this->form_id = (isset($args['form_id'])) ? $args['form_id'] : null;
|
||||
if (!$this->form_id) {
|
||||
$this->form_id = isset( $args['form_id'] ) ? $args['form_id'] : null;
|
||||
if ( ! $this->form_id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->form_status = get_post_status($this->form_id);
|
||||
if ($this->form_status != 'publish') {
|
||||
$this->form_status = get_post_status( $this->form_id );
|
||||
if ( $this->form_status != 'publish' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get data into one global array
|
||||
$post_data = UM()->query()->post_data( $this->form_id );
|
||||
$args = array_merge( $args, $post_data );
|
||||
|
||||
ob_start();
|
||||
|
||||
@@ -581,7 +582,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$args = apply_filters( 'um_pre_args_setup', $post_data );
|
||||
$args = apply_filters( 'um_pre_args_setup', $args );
|
||||
|
||||
if ( ! isset( $args['template'] ) ) {
|
||||
$args['template'] = '';
|
||||
|
||||
Reference in New Issue
Block a user