mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 06:03:38 +09:00
- member directory code merge;
This commit is contained in:
@@ -186,6 +186,11 @@ jQuery(document).ready( function() {
|
||||
}
|
||||
|
||||
|
||||
function um_distinct( value, index, self ) {
|
||||
return self.indexOf( value ) === index;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Conditional logic
|
||||
*
|
||||
@@ -206,10 +211,12 @@ jQuery(document).ready( function() {
|
||||
var parent_condition = true;
|
||||
|
||||
if ( condition === '=' || condition === '!=' ) {
|
||||
var condition_field = jQuery( '#' + prefix + '_' + conditional[0] );
|
||||
if ( conditional[0].indexOf( '||' ) === -1 ) {
|
||||
var condition_field = jQuery( '#' + prefix + '_' + conditional[0] );
|
||||
|
||||
if ( typeof condition_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
|
||||
parent_condition = check_condition( condition_field.parents('.um-forms-line') );
|
||||
if ( typeof condition_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
|
||||
parent_condition = check_condition( condition_field.parents('.um-forms-line') );
|
||||
}
|
||||
}
|
||||
} else if ( condition === '~' ) {
|
||||
var selectors = conditional[0].split('|');
|
||||
@@ -224,31 +231,106 @@ jQuery(document).ready( function() {
|
||||
|
||||
var own_condition = false;
|
||||
if ( condition === '=' ) {
|
||||
var tagName = condition_field.prop("tagName").toLowerCase();
|
||||
if ( conditional[0].indexOf( '||' ) !== -1 ) {
|
||||
var selectors = conditional[0].split('||');
|
||||
var complete_condition = false;
|
||||
|
||||
if ( tagName == 'input' ) {
|
||||
var input_type = condition_field.attr('type');
|
||||
if ( input_type == 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? condition_field.is(':checked') : ! condition_field.is(':checked');
|
||||
} else {
|
||||
jQuery.each( selectors, function(i) {
|
||||
var cond_field = jQuery( '#' + prefix + '_' + selectors[i] );
|
||||
|
||||
own_condition = false;
|
||||
parent_condition = true;
|
||||
|
||||
if ( typeof cond_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
|
||||
parent_condition = check_condition( cond_field.parents('.um-forms-line') );
|
||||
}
|
||||
|
||||
var tagName = cond_field.prop("tagName").toLowerCase();
|
||||
|
||||
if ( tagName === 'input' ) {
|
||||
var input_type = cond_field.attr('type');
|
||||
if ( input_type === 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? cond_field.is(':checked') : ! cond_field.is(':checked');
|
||||
} else {
|
||||
own_condition = ( cond_field.val() == value );
|
||||
}
|
||||
} else if ( tagName === 'select' ) {
|
||||
own_condition = ( cond_field.val() == value );
|
||||
}
|
||||
|
||||
if ( own_condition && parent_condition ) {
|
||||
complete_condition = true;
|
||||
}
|
||||
});
|
||||
|
||||
return complete_condition;
|
||||
} else {
|
||||
var tagName = condition_field.prop("tagName").toLowerCase();
|
||||
|
||||
if ( tagName == 'input' ) {
|
||||
var input_type = condition_field.attr('type');
|
||||
if ( input_type == 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? condition_field.is(':checked') : ! condition_field.is(':checked');
|
||||
} else {
|
||||
own_condition = ( condition_field.val() == value );
|
||||
}
|
||||
} else if ( tagName == 'select' ) {
|
||||
own_condition = ( condition_field.val() == value );
|
||||
}
|
||||
} else if ( tagName == 'select' ) {
|
||||
own_condition = ( condition_field.val() == value );
|
||||
}
|
||||
} else if ( condition === '!=' ) {
|
||||
var tagName = condition_field.prop("tagName").toLowerCase();
|
||||
|
||||
if ( tagName == 'input' ) {
|
||||
var input_type = condition_field.attr('type');
|
||||
if ( input_type == 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? ! condition_field.is(':checked') : condition_field.is(':checked');
|
||||
} else {
|
||||
return ( own_condition && parent_condition );
|
||||
}
|
||||
|
||||
} else if ( condition === '!=' ) {
|
||||
if ( conditional[0].indexOf( '||' ) !== -1 ) {
|
||||
var selectors = conditional[0].split('||');
|
||||
var complete_condition = false;
|
||||
|
||||
jQuery.each( selectors, function(i) {
|
||||
var cond_field = jQuery( '#' + prefix + '_' + selectors[i] );
|
||||
|
||||
own_condition = false;
|
||||
parent_condition = true;
|
||||
if ( typeof cond_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
|
||||
parent_condition = check_condition( cond_field.parents('.um-forms-line') );
|
||||
}
|
||||
|
||||
var tagName = cond_field.prop("tagName").toLowerCase();
|
||||
|
||||
if ( tagName === 'input' ) {
|
||||
var input_type = cond_field.attr('type');
|
||||
if ( input_type === 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? ! cond_field.is(':checked') : cond_field.is(':checked');
|
||||
} else {
|
||||
own_condition = ( cond_field.val() != value );
|
||||
}
|
||||
} else if ( tagName === 'select' ) {
|
||||
own_condition = ( cond_field.val() != value );
|
||||
}
|
||||
|
||||
if ( own_condition && parent_condition ) {
|
||||
complete_condition = true;
|
||||
}
|
||||
});
|
||||
|
||||
return complete_condition;
|
||||
} else {
|
||||
var tagName = condition_field.prop("tagName").toLowerCase();
|
||||
|
||||
if ( tagName == 'input' ) {
|
||||
var input_type = condition_field.attr('type');
|
||||
if ( input_type == 'checkbox' ) {
|
||||
own_condition = ( value == '1' ) ? ! condition_field.is(':checked') : condition_field.is(':checked');
|
||||
} else {
|
||||
own_condition = ( condition_field.val() != value );
|
||||
}
|
||||
} else if ( tagName == 'select' ) {
|
||||
own_condition = ( condition_field.val() != value );
|
||||
}
|
||||
} else if ( tagName == 'select' ) {
|
||||
own_condition = ( condition_field.val() != value );
|
||||
|
||||
return ( own_condition && parent_condition );
|
||||
}
|
||||
|
||||
} else if ( condition === '~' ) {
|
||||
|
||||
var field_id = form_line.find( form_line.data('field_type') ).data('field_id');
|
||||
@@ -265,6 +347,11 @@ jQuery(document).ready( function() {
|
||||
visible_options.push( condition_field.data( 'fill_' + field_id ) );
|
||||
}
|
||||
}
|
||||
} else if ( tagName == 'select' ) {
|
||||
if ( ! value && condition_field.val() ) {
|
||||
visible_options = visible_options.concat( condition_field.val() );
|
||||
visible_options = visible_options.filter( um_distinct );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -285,9 +372,11 @@ jQuery(document).ready( function() {
|
||||
lines_field.val( null );
|
||||
lines_field.find( 'option' ).attr( 'selected', false ).prop( 'selected', false );
|
||||
}
|
||||
|
||||
return ( own_condition && parent_condition );
|
||||
}
|
||||
|
||||
return ( own_condition && parent_condition );
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -411,6 +411,54 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render text field
|
||||
*
|
||||
* @param $field_data
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
function render_number( $field_data ) {
|
||||
|
||||
if ( empty( $field_data['id'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
|
||||
$id_attr = ' id="' . esc_attr( $id ) . '" ';
|
||||
|
||||
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
|
||||
$class .= ! empty( $field_data['size'] ) ? 'um-' . $field_data['size'] . '-field' : 'um-long-field';
|
||||
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
|
||||
|
||||
$data = array(
|
||||
'field_id' => $field_data['id']
|
||||
);
|
||||
|
||||
if ( ! empty( $field_data['attr'] ) && is_array( $field_data['attr'] ) ){
|
||||
$data = array_merge( $data, $field_data['attr'] );
|
||||
}
|
||||
|
||||
$data_attr = '';
|
||||
foreach ( $data as $key => $value ) {
|
||||
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
|
||||
}
|
||||
|
||||
$placeholder_attr = ! empty( $field_data['placeholder'] ) ? ' placeholder="' . esc_attr( $field_data['placeholder'] ) . '"' : '';
|
||||
|
||||
$name = $field_data['id'];
|
||||
$name = ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] . '[' . $name . ']' : $name;
|
||||
$name_attr = ' name="' . $name . '" ';
|
||||
|
||||
$value = $this->get_field_value( $field_data );
|
||||
$value_attr = ' value="' . esc_attr( $value ) . '" ';
|
||||
|
||||
$html = "<input type=\"number\" $id_attr $class_attr $name_attr $data_attr $value_attr $placeholder_attr />";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $field_data
|
||||
*
|
||||
@@ -908,8 +956,24 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
|
||||
$for_attr = ' for="' . esc_attr( $id . '_' . $k ) . '" ';
|
||||
$name_attr = ' name="' . $name . '[' . $k . ']" ';
|
||||
|
||||
$data = array(
|
||||
'field_id' => $field_data['id'] . '_' . $k,
|
||||
);
|
||||
|
||||
if ( ! empty( $field_data['data'] ) ) {
|
||||
$data = array_merge( $data, $field_data['data'] );
|
||||
}
|
||||
|
||||
$data_attr = '';
|
||||
foreach ( $data as $key => $value ) {
|
||||
if ( $value == 'checkbox_key' ) {
|
||||
$value = $k;
|
||||
}
|
||||
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
|
||||
}
|
||||
|
||||
$html .= "<label $for_attr>
|
||||
<input type=\"checkbox\" " . checked( in_array( $k, $values ), true, false ) . "$id_attr $name_attr value=\"1\" $class_attr>
|
||||
<input type=\"checkbox\" " . checked( in_array( $k, $values ), true, false ) . "$id_attr $name_attr $data_attr value=\"1\" $class_attr>
|
||||
<span>$title</span>
|
||||
</label>";
|
||||
}
|
||||
|
||||
@@ -776,6 +776,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
*/
|
||||
function add_metabox_directory() {
|
||||
add_meta_box( 'um-admin-form-general', __( 'General Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-sorting', __( 'Sorting', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-profile', __( 'Profile Card', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-search', __( 'Search Options', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
add_meta_box( 'um-admin-form-pagination', __( 'Results & Pagination', 'ultimate-member' ), array( &$this, 'load_metabox_directory' ), 'um_directory', 'normal', 'default' );
|
||||
@@ -1014,26 +1015,31 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
*
|
||||
* @param $post_id
|
||||
* @param $post
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function save_metabox_directory( $post_id, $post ) {
|
||||
global $wpdb;
|
||||
|
||||
// validate nonce
|
||||
if ( !isset( $_POST['um_admin_save_metabox_directory_nonce'] ) || !wp_verify_nonce( $_POST['um_admin_save_metabox_directory_nonce'], basename( __FILE__ ) ) ) return $post_id;
|
||||
if ( ! isset( $_POST['um_admin_save_metabox_directory_nonce'] ) || ! wp_verify_nonce( $_POST['um_admin_save_metabox_directory_nonce'], basename( __FILE__ ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// validate post type
|
||||
if ( $post->post_type != 'um_directory' ) return $post_id;
|
||||
if ( $post->post_type != 'um_directory' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// validate user
|
||||
$post_type = get_post_type_object( $post->post_type );
|
||||
if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id;
|
||||
if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$where = array( 'ID' => $post_id );
|
||||
|
||||
if ( empty( $_POST['post_title'] ) )
|
||||
if ( empty( $_POST['post_title'] ) ) {
|
||||
$_POST['post_title'] = 'Directory #'.$post_id;
|
||||
}
|
||||
|
||||
$wpdb->update( $wpdb->posts, array( 'post_title' => $_POST['post_title'] ), $where );
|
||||
|
||||
@@ -1043,30 +1049,43 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
delete_post_meta( $post_id, '_um_reveal_fields' );
|
||||
delete_post_meta( $post_id, '_um_search_fields' );
|
||||
delete_post_meta( $post_id, '_um_roles_can_search' );
|
||||
delete_post_meta( $post_id, '_um_roles_can_filter' );
|
||||
delete_post_meta( $post_id, '_um_show_these_users' );
|
||||
|
||||
//save metadata
|
||||
foreach ( $_POST['um_metadata'] as $k => $v ) {
|
||||
|
||||
if ( $k == '_um_show_these_users' && trim( $_POST['um_metadata'][ $k ] ) ) {
|
||||
$v = preg_split( '/[\r\n]+/', $v, -1, PREG_SPLIT_NO_EMPTY );
|
||||
}
|
||||
|
||||
if ( strstr( $k, '_um_' ) ) {
|
||||
|
||||
if ( $k === '_um_is_default' ) {
|
||||
|
||||
$mode = UM()->query()->get_attr( 'mode', $post_id );
|
||||
|
||||
if ( ! empty( $mode ) ) {
|
||||
|
||||
$posts = $wpdb->get_col(
|
||||
"SELECT post_id
|
||||
FROM {$wpdb->postmeta}
|
||||
WHERE meta_key = '_um_mode' AND
|
||||
meta_value = 'directory'"
|
||||
);
|
||||
|
||||
foreach ( $posts as $p_id ) {
|
||||
delete_post_meta( $p_id, '_um_is_default' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$v = apply_filters( 'um_member_directory_meta_value_before_save', $v, $k, $post_id );
|
||||
|
||||
update_post_meta( $post_id, $k, $v );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
global $post_id;
|
||||
|
||||
$meta = get_post_custom( get_the_ID() );
|
||||
foreach( $meta as $k => $v ) {
|
||||
@@ -8,67 +9,63 @@ foreach( $meta as $k => $v ) {
|
||||
}
|
||||
}
|
||||
|
||||
$roles_array = array();
|
||||
|
||||
foreach ( UM()->roles()->get_roles() as $key => $value ) {
|
||||
$_um_roles = UM()->query()->get_meta_value( '_um_roles', $key );
|
||||
if ( ! empty( $_um_roles ) )
|
||||
$roles_array[] = $_um_roles;
|
||||
}
|
||||
$_um_roles_value = get_post_meta( $post_id, '_um_roles', true );
|
||||
$_um_roles_value = empty( $_um_roles_value ) ? array() : $_um_roles_value;
|
||||
|
||||
$show_these_users = get_post_meta( get_the_ID(), '_um_show_these_users', true );
|
||||
if ( $show_these_users ) {
|
||||
$show_these_users = implode( "\n", str_replace( "\r", "", $show_these_users ) );
|
||||
} ?>
|
||||
}
|
||||
|
||||
$_um_view_types_value = get_post_meta( $post_id, '_um_view_types', true );
|
||||
$_um_view_types_value = empty( $_um_view_types_value ) ? array( 'grid' ) : $_um_view_types_value;
|
||||
|
||||
$view_types_options = array_map( function( $item ) {
|
||||
return $item['title'];
|
||||
}, UM()->member_directory()->view_types );
|
||||
|
||||
$conditional = array();
|
||||
foreach ( $view_types_options as $key => $value ) {
|
||||
$conditional[] = '_um_view_types_' . $key;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="um-admin-metabox">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_admin_directory_sort_users_select
|
||||
* @description Extend Sort Types for Member Directory
|
||||
* @input_vars
|
||||
* [{"var":"$sort_types","type":"array","desc":"Sort Types"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_filter( 'um_admin_directory_sort_users_select', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_admin_directory_sort_users_select', 'my_directory_sort_users_select', 10, 1 );
|
||||
* function my_directory_sort_users_select( $sort_types ) {
|
||||
* // your code here
|
||||
* return $sort_types;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$sort_options = apply_filters( 'um_admin_directory_sort_users_select', array(
|
||||
'user_registered_desc' => __( 'New users first', 'ultimate-member' ),
|
||||
'user_registered_asc' => __( 'Old users first', 'ultimate-member' ),
|
||||
'last_login' => __( 'Last login', 'ultimate-member' ),
|
||||
'display_name' => __( 'Display Name', 'ultimate-member' ),
|
||||
'first_name' => __( 'First Name', 'ultimate-member' ),
|
||||
'last_name' => __( 'Last Name', 'ultimate-member' ),
|
||||
'random' => __( 'Random', 'ultimate-member' ),
|
||||
'other' => __( 'Other (custom field)', 'ultimate-member' ),
|
||||
) );
|
||||
|
||||
$fields = array(
|
||||
<?php $fields = array(
|
||||
array(
|
||||
'id' => '_um_mode',
|
||||
'type' => 'hidden',
|
||||
'value' => 'directory',
|
||||
'id' => '_um_mode',
|
||||
'type' => 'hidden',
|
||||
'value' => 'directory',
|
||||
),
|
||||
array(
|
||||
'id' => '_um_view_types',
|
||||
'type' => 'multi_checkbox',
|
||||
'label' => __( 'View type(s)', 'ultimate-member' ),
|
||||
'tooltip' => __( 'View type a specific parameter in the directory', 'ultimate-member' ),
|
||||
'options' => $view_types_options,
|
||||
'columns' => 3,
|
||||
'value' => $_um_view_types_value,
|
||||
'data' => array( 'fill__um_default_view' => 'checkbox_key' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_default_view',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Default view type', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Default directory view type', 'ultimate-member' ),
|
||||
'options' => $view_types_options,
|
||||
'value' => UM()->query()->get_meta_value( '_um_default_view', null, '' ),
|
||||
'conditional' => array( implode( '|', $conditional ), '~', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_roles',
|
||||
'type' => 'select',
|
||||
'type' => 'multi_checkbox',
|
||||
'label' => __( 'User Roles to Display', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If you do not want to show all members, select only user roles to appear in this directory', 'ultimate-member' ),
|
||||
'options' => UM()->roles()->get_roles(),
|
||||
'multi' => true,
|
||||
'value' => $roles_array,
|
||||
'columns' => 3,
|
||||
'value' => $_um_roles_value,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_has_profile_photo',
|
||||
@@ -83,22 +80,6 @@ if ( $show_these_users ) {
|
||||
'label' => __( 'Only show members who have uploaded a cover photo', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_has_cover_photo' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_sortby',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Sort users by', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Sort users by a specific parameter in the directory', 'ultimate-member' ),
|
||||
'options' => $sort_options,
|
||||
'value' => UM()->query()->get_meta_value( '_um_sortby' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_sortby_custom',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Meta key', 'ultimate-member' ),
|
||||
'tooltip' => __( 'To sort by a custom field, enter the meta key of field here', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_sortby_custom', null, 'na' ),
|
||||
'conditional' => array( '_um_sortby', '=', 'other' )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_these_users',
|
||||
'type' => 'textarea',
|
||||
|
||||
@@ -3,33 +3,62 @@
|
||||
|
||||
<div class="um-admin-metabox">
|
||||
<?php UM()->admin_forms( array(
|
||||
'class' => 'um-member-directory-pagination um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => array(
|
||||
'class' => 'um-member-directory-pagination um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => '_um_profiles_per_page',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Number of profiles per page', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Number of profiles to appear on page for standard users', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profiles_per_page', null, 12 ),
|
||||
'size' => 'small'
|
||||
'id' => '_um_must_search',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show results only after search/filtration', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, member results will only appear after search/filter is performed', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_must_search' ),
|
||||
'conditional' => array( '_um_search||_um_filters', '=', 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profiles_per_page_mobile',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Number of profiles per page (for Mobiles & Tablets)', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Number of profiles to appear on page for mobile users', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profiles_per_page_mobile', null, 8 ),
|
||||
'size' => 'small'
|
||||
'id' => '_um_max_users',
|
||||
'type' => 'number',
|
||||
'label' => __( 'Maximum number of profiles', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Use this setting to control the maximum number of profiles to appear in this directory. Leave blank to disable this limit', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_max_users', null, 'na' ),
|
||||
'size' => 'small'
|
||||
),
|
||||
array(
|
||||
'id' => '_um_max_users',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Maximum number of profiles', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Use this setting to control the maximum number of profiles to appear in this directory. Leave blank to disable this limit', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_max_users', null, 'na' ),
|
||||
'size' => 'small'
|
||||
)
|
||||
'id' => '_um_profiles_per_page',
|
||||
'type' => 'number',
|
||||
'label' => __( 'Number of profiles per page', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Number of profiles to appear on page for standard users', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profiles_per_page', null, 12 ),
|
||||
'size' => 'small'
|
||||
),
|
||||
array(
|
||||
'id' => '_um_profiles_per_page_mobile',
|
||||
'type' => 'number',
|
||||
'label' => __( 'Number of profiles per page (for Mobiles & Tablets)', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Number of profiles to appear on page for mobile users', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profiles_per_page_mobile', null, 8 ),
|
||||
'size' => 'small'
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_header',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Results Text', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Customize the search result text . e.g. Found 3,000 Members. Leave this blank to not show result text', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_header', null, __( '{total_users} Members', 'ultimate-member' ) ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_header_single',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Single Result Text', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Same as above but in case of 1 user found only', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_header_single', null, __( '{total_users} Member', 'ultimate-member' ) ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_no_users',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Custom text if no users were found', 'ultimate-member' ),
|
||||
'tooltip' => __( 'This is the text that is displayed if no users are found during a search', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_no_users', null, __( 'We are sorry. We cannot find any users who match your search criteria.', 'ultimate-member' ) ),
|
||||
),
|
||||
)
|
||||
) )->render_form(); ?>
|
||||
|
||||
|
||||
@@ -12,77 +12,103 @@
|
||||
$_um_tagline_fields = get_post_meta( $post_id, '_um_tagline_fields', true );
|
||||
$_um_reveal_fields = get_post_meta( $post_id, '_um_reveal_fields', true );
|
||||
|
||||
|
||||
$fields = array(
|
||||
array(
|
||||
'id' => '_um_profile_photo',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Profile Photo', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photo', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_cover_photos',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Cover Photo', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, the users cover photo will appear in the directory', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_cover_photos', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_name',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show display name', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_name', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_tagline',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show tagline below profile name', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_tagline' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_tagline_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to display in tagline', 'ultimate-member' ),
|
||||
'value' => $_um_tagline_fields,
|
||||
'conditional' => array( '_um_show_tagline', '=', 1 ),
|
||||
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
|
||||
'options' => $user_fields,
|
||||
'show_default_number' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_userinfo',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show extra user information below tagline?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_userinfo' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_reveal_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to display in reveal section', 'ultimate-member' ),
|
||||
'value' => $_um_reveal_fields,
|
||||
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 ),
|
||||
'options' => $user_fields,
|
||||
'show_default_number' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_social',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show social connect icons', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_social' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_userinfo_animate',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable reveal section transition by default', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_userinfo_animate' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 )
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_admin_extend_directory_options_general
|
||||
* @description Extend Directory options fields
|
||||
* @input_vars
|
||||
* [{"var":"$fields","type":"array","desc":"Directory options fields"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_filter( 'um_admin_directory_sort_users_select', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_admin_directory_sort_users_select', 'my_directory_sort_users_select', 10, 1 );
|
||||
* function my_directory_sort_users_select( $sort_types ) {
|
||||
* // your code here
|
||||
* return $sort_types;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$fields = apply_filters( 'um_admin_extend_directory_options_profile', $fields );
|
||||
|
||||
UM()->admin_forms( array(
|
||||
'class' => 'um-member-directory-profile um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => '_um_profile_photo',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Profile Photo', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_profile_photo', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_cover_photos',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Cover Photo', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, the users cover photo will appear in the directory', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_cover_photos', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_name',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show display name', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_name', null, 1 ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_tagline',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show tagline below profile name', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_tagline' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_tagline_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to display in tagline', 'ultimate-member' ),
|
||||
'value' => $_um_tagline_fields,
|
||||
'conditional' => array( '_um_show_tagline', '=', 1 ),
|
||||
'add_text' => __( 'Add New Custom Field','ultimate-member' ),
|
||||
'options' => $user_fields,
|
||||
'show_default_number' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_userinfo',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show extra user information below tagline?', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_userinfo' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_userinfo_animate',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable reveal section transition by default', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_userinfo_animate' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_reveal_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to display in reveal section', 'ultimate-member' ),
|
||||
'value' => $_um_reveal_fields,
|
||||
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 ),
|
||||
'options' => $user_fields,
|
||||
'show_default_number' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_show_social',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show social connect icons', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_show_social' ),
|
||||
'conditional' => array( '_um_show_userinfo', '=', 1 )
|
||||
)
|
||||
)
|
||||
'class' => 'um-member-directory-profile um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => $fields,
|
||||
) )->render_form(); ?>
|
||||
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
</div>
|
||||
@@ -1,14 +1,35 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
global $post_id; ?>
|
||||
|
||||
|
||||
<div class="um-admin-metabox">
|
||||
<?php
|
||||
$can_search_array = array();
|
||||
foreach ( UM()->roles()->get_roles() as $key => $value ) {
|
||||
$_um_roles_can_search = UM()->query()->get_meta_value( '_um_roles_can_search', $key );
|
||||
if ( ! empty( $_um_roles_can_search ) )
|
||||
$can_search_array[] = $_um_roles_can_search;
|
||||
}
|
||||
/*$_um_roles_search_value = array();
|
||||
$_um_roles_search = get_post_meta( $post_id, '_um_roles_can_search', true );
|
||||
if ( ! empty( $_um_roles_search ) ) {
|
||||
foreach ( UM()->roles()->get_roles() as $key => $value ) {
|
||||
if ( in_array( $key, array_keys( $_um_roles_search ) ) ) {
|
||||
$_um_roles_search_value[] = $key;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$_um_roles_search_value = get_post_meta( $post_id, '_um_roles_can_search', true );
|
||||
$_um_roles_search_value = empty( $_um_roles_search_value ) ? array() : $_um_roles_search_value;
|
||||
|
||||
/*$_um_roles_filter_value = array();
|
||||
$_um_roles_filter = get_post_meta( $post_id, '_um_roles_can_filter', true );
|
||||
if ( ! empty( $_um_roles_filter ) ) {
|
||||
foreach ( UM()->roles()->get_roles() as $key => $value ) {
|
||||
if ( in_array( $key, array_keys( $_um_roles_filter ) ) ) {
|
||||
$_um_roles_filter_value[] = $key;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$_um_roles_filter_value = get_post_meta( $post_id, '_um_roles_can_filter', true );
|
||||
$_um_roles_filter_value = empty( $_um_roles_filter_value ) ? array() : $_um_roles_filter_value;
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
@@ -36,84 +57,68 @@
|
||||
$searchable_fields = $searchable_fields + $custom_search;
|
||||
$user_fields = array();
|
||||
foreach ( $searchable_fields as $key => $arr ) {
|
||||
$user_fields[$key] = isset( $arr['title'] ) ? $arr['title'] : '';
|
||||
$user_fields[ $key ] = isset( $arr['title'] ) ? $arr['title'] : '';
|
||||
}
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$_um_search_fields = get_post_meta( $post_id, '_um_search_fields', true );
|
||||
//$post_id = get_the_ID();
|
||||
$_um_search_fields = get_post_meta( $post_id, '_um_search_fields', true );
|
||||
|
||||
UM()->admin_forms( array(
|
||||
'class' => 'um-member-directory-search um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => array(
|
||||
'class' => 'um-member-directory-search um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => array(
|
||||
array(
|
||||
'id' => '_um_search',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Search feature', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, users will be able to search members in this directory', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_search' ),
|
||||
'id' => '_um_search',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Search feature', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, users will be able to search members in this directory', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_search' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_must_search',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show results only after search', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, member results will only appear after search is performed', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_must_search' ),
|
||||
'id' => '_um_roles_can_search',
|
||||
'type' => 'multi_checkbox',
|
||||
'label' => __( 'User Roles that can use search', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If you want to allow specific user roles to be able to search only', 'ultimate-member' ),
|
||||
'value' => $_um_roles_search_value,
|
||||
'options' => UM()->roles()->get_roles(),
|
||||
'columns' => 3,
|
||||
'conditional' => array( '_um_search', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_roles_can_search',
|
||||
'type' => 'select',
|
||||
'multi' => true,
|
||||
'label' => __( 'User Roles that can use search', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If you want to allow specific user roles to be able to search only', 'ultimate-member' ),
|
||||
'value' => $can_search_array,
|
||||
'options' => UM()->roles()->get_roles(),
|
||||
'conditional' => array( '_um_search', '=', 1 )
|
||||
'id' => '_um_filters',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Filters feature', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If turned on, users will be able to filter members in this directory', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_filters' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_search_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to enable in search', 'ultimate-member' ),
|
||||
'value' => $_um_search_fields,
|
||||
'conditional' => array( '_um_search', '=', 1 ),
|
||||
'options' => $user_fields,
|
||||
'add_text' => __( 'Add New Custom Field','ultimate-member' ),
|
||||
'show_default_number' => 1,
|
||||
'id' => '_um_roles_can_filter',
|
||||
'type' => 'multi_checkbox',
|
||||
'label' => __( 'User Roles that can use filters', 'ultimate-member' ),
|
||||
'tooltip' => __( 'If you want to allow specific user roles to be able to filter only', 'ultimate-member' ),
|
||||
'value' => $_um_roles_filter_value,
|
||||
'options' => UM()->roles()->get_roles(),
|
||||
'columns' => 3,
|
||||
'conditional' => array( '_um_filters', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_search_filters',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Additional search filters', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Additional search filters like URL parameters' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_search_filters', null, '' ),
|
||||
'conditional' => array( '_um_search', '=', 1 ),
|
||||
'placeholder' => 'field1=val1&field2=val2'
|
||||
'id' => '_um_search_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose filter(s) meta to enable', 'ultimate-member' ),
|
||||
'value' => $_um_search_fields,
|
||||
'conditional' => array( '_um_filters', '=', 1 ),
|
||||
'options' => UM()->member_directory()->filter_fields,
|
||||
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
|
||||
'show_default_number' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_header',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Results Text', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Customize the search result text . e.g. Found 3,000 Members. Leave this blank to not show result text', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_header', null, __('{total_users} Members','ultimate-member') ),
|
||||
'conditional' => array( '_um_search', '=', 1 )
|
||||
'id' => '_um_search_filters',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Default filters', 'ultimate-member' ),
|
||||
'tooltip' => __( 'You can set default filters like URL parameters', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_search_filters', null, 'na' ),
|
||||
'placeholder' => 'field1=val1&field2=val2'
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_header_single',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Single Result Text', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Same as above but in case of 1 user found only', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_header_single', null, __('{total_users} Member','ultimate-member') ),
|
||||
'conditional' => array( '_um_search', '=', 1 )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_directory_no_users',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Custom text if no users were found', 'ultimate-member' ),
|
||||
'tooltip' => __( 'This is the text that is displayed if no users are found during a search', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value('_um_directory_no_users', null, __('We are sorry. We cannot find any users who match your search criteria.','ultimate-member') ),
|
||||
'conditional' => array( '_um_search', '=', 1 )
|
||||
)
|
||||
)
|
||||
) )->render_form(); ?>
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
global $post_id;
|
||||
|
||||
|
||||
$_um_sorting_fields = get_post_meta( $post_id, '_um_sorting_fields', true );
|
||||
$_um_sorting_fields = empty( $_um_sorting_fields ) ? array() : $_um_sorting_fields; ?>
|
||||
|
||||
<div class="um-admin-metabox">
|
||||
|
||||
<?php $fields = array(
|
||||
array(
|
||||
'id' => '_um_sortby',
|
||||
'type' => 'select',
|
||||
'label' => __( 'Default sort users by', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Default sorting users by a specific parameter in the directory', 'ultimate-member' ),
|
||||
'options' => UM()->member_directory()->default_sorting,
|
||||
'value' => UM()->query()->get_meta_value( '_um_sortby' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_sortby_custom',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Meta key', 'ultimate-member' ),
|
||||
'tooltip' => __( 'To sort by a custom field, enter the meta key of field here', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_sortby_custom', null, 'na' ),
|
||||
'conditional' => array( '_um_sortby', '=', 'other' )
|
||||
),
|
||||
array(
|
||||
'id' => '_um_enable_sorting',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable custom sorting', 'ultimate-member' ),
|
||||
'tooltip' => __( 'Whether to provide an ability to change the sorting on the directory page', 'ultimate-member' ),
|
||||
'value' => UM()->query()->get_meta_value( '_um_enable_sorting' ),
|
||||
),
|
||||
array(
|
||||
'id' => '_um_sorting_fields',
|
||||
'type' => 'multi_selects',
|
||||
'label' => __( 'Choose field(s) to enable in sorting', 'ultimate-member' ),
|
||||
'value' => $_um_sorting_fields,
|
||||
'options' => UM()->member_directory()->sort_fields,
|
||||
'add_text' => __( 'Add New Field', 'ultimate-member' ),
|
||||
'show_default_number' => 1,
|
||||
'conditional' => array( '_um_enable_sorting', '=', 1 )
|
||||
)
|
||||
);
|
||||
|
||||
UM()->admin_forms( array(
|
||||
'class' => 'um-member-directory-sorting um-half-column',
|
||||
'prefix_id' => 'um_metadata',
|
||||
'fields' => $fields
|
||||
) )->render_form(); ?>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user