- added escape functions, security fix for XSS;

This commit is contained in:
nikitasinelnikov
2019-08-08 00:36:33 +03:00
parent b2e57e8f92
commit 5f66fd5fe3
95 changed files with 2228 additions and 2026 deletions
+112 -89
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
@@ -58,32 +59,35 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
switch ( $mode ) {
case 'numeric':
if ( !empty( $array['post'][$post_input] ) && !is_numeric( $array['post'][$post_input] ) ){
$errors[$post_input] = $validate[$post_input]['error'];
if ( ! empty( $array['post'][ $post_input ] ) && ! is_numeric( $array['post'][ $post_input ] ) ){
$errors[ $post_input ] = $validate[ $post_input ]['error'];
}
break;
case 'unique':
if ( !isset( $array['post']['edit_mode'] ) ) {
if ( UM()->builtin()->unique_field_err( $array['post'][$post_input] ) ) {
$errors[$post_input] = UM()->builtin()->unique_field_err( $array['post'][$post_input] );
if ( ! isset( $array['post']['edit_mode'] ) ) {
if ( UM()->builtin()->unique_field_err( $array['post'][ $post_input ] ) ) {
$errors[ $post_input ] = UM()->builtin()->unique_field_err( $array['post'][ $post_input ] );
}
}
break;
case 'required':
if ( $array['post'][$post_input] == '' )
$errors[$post_input] = $validate[$post_input]['error'];
if ( $array['post'][ $post_input ] == '' ) {
$errors[ $post_input ] = $validate[ $post_input ]['error'];
}
break;
case 'range-start':
if ( UM()->builtin()->date_range_start_err( $array['post'][$post_input] ) && $array['post']['_range'] == 'date_range' )
$errors[$post_input] = UM()->builtin()->date_range_start_err( $array['post'][$post_input] );
if ( UM()->builtin()->date_range_start_err( $array['post'][ $post_input ] ) && $array['post']['_range'] == 'date_range' ) {
$errors[ $post_input ] = UM()->builtin()->date_range_start_err( $array['post'][ $post_input ] );
}
break;
case 'range-end':
if ( UM()->builtin()->date_range_end_err( $array['post'][$post_input], $array['post']['_range_start'] ) && $array['post']['_range'] == 'date_range' )
$errors[$post_input] = UM()->builtin()->date_range_end_err( $array['post'][$post_input], $array['post']['_range_start'] );
if ( UM()->builtin()->date_range_end_err( $array['post'][ $post_input ], $array['post']['_range_start'] ) && $array['post']['_range'] == 'date_range' ) {
$errors[ $post_input ] = UM()->builtin()->date_range_end_err( $array['post'][ $post_input ], $array['post']['_range_start'] );
}
break;
}
@@ -141,15 +145,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
$fields = UM()->query()->get_attr('custom_fields', $form_id);
$count = 1;
if ( isset( $fields ) && !empty( $fields) ) $count = count($fields)+1;
if ( ! empty( $fields ) ) {
$count = count( $fields ) + 1;
}
// set unique meta key
if ( in_array( $field_type, $fields_without_metakey ) && !isset($array['post']['_metakey']) ) {
if ( in_array( $field_type, $fields_without_metakey ) && ! isset( $array['post']['_metakey'] ) ) {
$array['post']['_metakey'] = "um_{$field_type}_{$form_id}_{$count}";
}
// set position
if ( !isset( $array['post']['_position'] ) ) {
if ( ! isset( $array['post']['_position'] ) ) {
$array['post']['_position'] = $count;
}
@@ -166,27 +172,27 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
*/
function um_admin_pre_save_field_to_form( $array ){
unset( $array['conditions'] );
if ( isset($array['conditional_field']) && !empty( $array['conditional_action'] ) && !empty( $array['conditional_operator'] ) ) {
if ( isset($array['conditional_field']) && ! empty( $array['conditional_action'] ) && ! empty( $array['conditional_operator'] ) ) {
$array['conditional_value'] = isset( $array['conditional_value'] ) ? $array['conditional_value'] : '';
$array['conditions'][] = array( $array['conditional_action'], $array['conditional_field'], $array['conditional_operator'], $array['conditional_value'] );
}
if ( isset($array['conditional_field1']) && !empty( $array['conditional_action1'] ) && !empty( $array['conditional_operator1'] ) ) {
if ( isset( $array['conditional_field1'] ) && ! empty( $array['conditional_action1'] ) && ! empty( $array['conditional_operator1'] ) ) {
$array['conditional_value1'] = isset( $array['conditional_value1'] ) ? $array['conditional_value1'] : '';
$array['conditions'][] = array( $array['conditional_action1'], $array['conditional_field1'], $array['conditional_operator1'], $array['conditional_value1'] );
}
if ( isset($array['conditional_field2']) && !empty( $array['conditional_action2'] ) && !empty( $array['conditional_operator2'] ) ) {
if ( isset( $array['conditional_field2'] ) && ! empty( $array['conditional_action2'] ) && ! empty( $array['conditional_operator2'] ) ) {
$array['conditional_value2'] = isset( $array['conditional_value2'] ) ? $array['conditional_value2'] : '';
$array['conditions'][] = array( $array['conditional_action2'], $array['conditional_field2'], $array['conditional_operator2'], $array['conditional_value2'] );
}
if ( isset($array['conditional_field3']) && !empty( $array['conditional_action3'] ) && !empty( $array['conditional_operator3'] ) ) {
if ( isset( $array['conditional_field3'] ) && ! empty( $array['conditional_action3'] ) && ! empty( $array['conditional_operator3'] ) ) {
$array['conditional_value3'] = isset( $array['conditional_value3'] ) ? $array['conditional_value3'] : '';
$array['conditions'][] = array( $array['conditional_action3'], $array['conditional_field3'], $array['conditional_operator3'], $array['conditional_value3'] );
}
if ( isset($array['conditional_field4']) && !empty( $array['conditional_action4'] ) && !empty( $array['conditional_operator4'] ) ) {
if ( isset( $array['conditional_field4'] ) && ! empty( $array['conditional_action4'] ) && ! empty( $array['conditional_operator4'] ) ) {
$array['conditional_value4'] = isset( $array['conditional_value4'] ) ? $array['conditional_value4'] : '';
$array['conditions'][] = array( $array['conditional_action4'], $array['conditional_field4'], $array['conditional_operator4'], $array['conditional_value4'] );
}
@@ -224,25 +230,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<div class="um-admin-btn-toggle">
<?php if ( $in_edit ) { $metabox->in_edit = true; $metabox->edit_array = $edit_array; ?>
<a href="#"><i class="um-icon-plus"></i><?php _e( 'Manage conditional fields support' ); ?></a> <?php UM()->tooltip( __( 'Here you can setup conditional logic to show/hide this field based on specific fields value or conditions', 'ultimate-member' ) ); ?>
<a href="javascript:void(0);"><i class="um-icon-plus"></i><?php _e( 'Manage conditional fields support' ); ?></a> <?php UM()->tooltip( __( 'Here you can setup conditional logic to show/hide this field based on specific fields value or conditions', 'ultimate-member' ) ); ?>
<?php } else { ?>
<a href="#"><i class="um-icon-plus"></i><?php _e( 'Add conditional fields support' ); ?></a> <?php UM()->tooltip( __( 'Here you can setup conditional logic to show/hide this field based on specific fields value or conditions', 'ultimate-member' ) ); ?>
<a href="javascript:void(0);"><i class="um-icon-plus"></i><?php _e( 'Add conditional fields support' ); ?></a> <?php UM()->tooltip( __( 'Here you can setup conditional logic to show/hide this field based on specific fields value or conditions', 'ultimate-member' ) ); ?>
<?php } ?>
<div class="um-admin-btn-content">
<div class="um-admin-cur-condition-template">
<div class="um-admin-cur-condition-template">
<?php $metabox->field_input( '_conditional_action', $form_id ); ?>
<?php $metabox->field_input( '_conditional_field', $form_id ); ?>
<?php $metabox->field_input( '_conditional_operator', $form_id ); ?>
<?php $metabox->field_input( '_conditional_value', $form_id ); ?>
<p><a href="#" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<p><a href="javascript:void(0);" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<div class="um-admin-clear"></div>
</div>
<p><a href="#" class="um-admin-new-condition button button-primary um-admin-tipsy-n" title="Add new condition"><?php _e( 'Add new rule', 'ultimate-member' ); ?></a></p>
<p class="um-admin-reset-conditions"><a href="#" class="button"><?php _e( 'Reset all rules', 'ultimate-member' ); ?></a></p>
<div class="um-admin-clear"></div>
</div>
<p><a href="javascript:void(0);" class="um-admin-new-condition button button-primary um-admin-tipsy-n" title="Add new condition"><?php _e( 'Add new rule', 'ultimate-member' ); ?></a></p>
<p class="um-admin-reset-conditions"><a href="javascript:void(0);" class="button"><?php _e( 'Reset all rules', 'ultimate-member' ); ?></a></p>
<div class="um-admin-clear"></div>
<?php if ( isset( $edit_array['conditions'] ) && count( $edit_array['conditions'] ) != 0 ) {
@@ -258,7 +264,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<?php $metabox->field_input( '_conditional_operator' . $k, $form_id ); ?>
<?php $metabox->field_input( '_conditional_value' . $k, $form_id ); ?>
<p><a href="#" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<p><a href="#" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<div class="um-admin-clear"></div>
</div>
@@ -275,7 +281,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<?php $metabox->field_input( '_conditional_operator', $form_id ); ?>
<?php $metabox->field_input( '_conditional_value', $form_id ); ?>
<p><a href="#" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<p><a href="#" class="um-admin-remove-condition button um-admin-tipsy-n" title="Remove condition"><i class="um-icon-close" style="margin-right:0!important"></i></a></p>
<div class="um-admin-clear"></div>
</div>
@@ -308,7 +314,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
$output = ob_get_clean();
if(is_array($output)){ print_r($output); }else{ echo $output; } die;
if ( is_array( $output ) ) {
print_r( $output );
} else {
echo $output;
}
die;
}
@@ -399,19 +410,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<!-- Master Row Actions -->
<div class="um-admin-drag-row-icons">
<a href="#" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php _e('Add Row','ultimate-member'); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="#" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php _e('Edit Row','ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo $this->form_id; ?>" data-arg3="_um_row_1"><i class="um-faicon-pencil"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php esc_attr_e( 'Add Row', 'ultimate-member' ); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php esc_attr_e( 'Edit Row', 'ultimate-member' ); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo esc_attr( $this->form_id ); ?>" data-arg3="_um_row_1"><i class="um-faicon-pencil"></i></a>
<span class="um-admin-drag-row-start"><i class="um-icon-arrow-move"></i></span>
</div><div class="um-admin-clear"></div>
</div>
<div class="um-admin-clear"></div>
<div class="um-admin-drag-rowsubs">
<div class="um-admin-drag-rowsub">
<!-- Column Layout -->
<div class="um-admin-drag-ctrls columns">
<a href="#" class="active" data-cols="1"></a>
<a href="#" data-cols="2"></a>
<a href="#" data-cols="3"></a>
<a href="javascript:void(0);" class="active" data-cols="1"></a>
<a href="javascript:void(0);" data-cols="2"></a>
<a href="javascript:void(0);" data-cols="3"></a>
</div>
<!-- Sub Row Actions -->
@@ -437,54 +449,51 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
} else {
if( empty( $fields) || ! is_array( $fields ) ){
if ( empty( $fields ) || ! is_array( $fields ) ) {
$this->global_fields = array();
}else{
} else {
$this->global_fields = $fields;
}
foreach( $this->global_fields as $key => $array ) {
foreach ( $this->global_fields as $key => $array ) {
if ( $array['type'] == 'row' ) {
$rows[$key] = $array;
$rows[ $key ] = $array;
unset( $this->global_fields[ $key ] ); // not needed now
}
}
if ( !isset( $rows ) ){
$rows = array( '_um_row_1' => array(
'type' => 'row',
'id' => '_um_row_1',
'sub_rows' => 1,
'cols' => 1
)
if ( ! isset( $rows ) ) {
$rows = array(
'_um_row_1' => array(
'type' => 'row',
'id' => '_um_row_1',
'sub_rows' => 1,
'cols' => 1
),
);
}
foreach ( $rows as $row_id => $array ) {
foreach ( $rows as $row_id => $array ) { ?>
?>
<div class="um-admin-drag-row" data-original="<?php echo $row_id; ?>">
<div class="um-admin-drag-row" data-original="<?php echo esc_attr( $row_id ); ?>">
<!-- Master Row Actions -->
<div class="um-admin-drag-row-icons">
<a href="#" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php _e('Add Row','ultimate-member'); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="#" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php _e('Edit Row','ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo $this->form_id; ?>" data-arg3="<?php echo $row_id; ?>"><i class="um-faicon-pencil"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php esc_attr_e( 'Add Row', 'ultimate-member' ); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php esc_attr_e( 'Edit Row', 'ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo esc_attr( $this->form_id ); ?>" data-arg3="<?php echo esc_attr( $row_id ); ?>"><i class="um-faicon-pencil"></i></a>
<span class="um-admin-drag-row-start"><i class="um-icon-arrow-move"></i></span>
<?php if ( $row_id != '_um_row_1' ) {?>
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="<?php esc_attr_e( 'Delete Row', 'ultimate-member' ); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
<?php } ?>
</div><div class="um-admin-clear"></div>
<div class="um-admin-drag-rowsubs">
<?php
$row_fields = $this->get_fields_by_row( $row_id );
<?php $row_fields = $this->get_fields_by_row( $row_id );
$sub_rows = ( isset( $array['sub_rows'] ) ) ? $array['sub_rows'] : 1;
for( $c = 0; $c < $sub_rows; $c++ ) {
for ( $c = 0; $c < $sub_rows; $c++ ) {
$subrow_fields = $this->get_fields_in_subrow( $row_fields, $c );
@@ -507,7 +516,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
}
for ( $i = 1; $i <= 3; $i++ ) {
echo '<a href="#" data-cols="'.$i.'" ';
echo '<a href="javascript:void(0);" data-cols="'.$i.'" ';
if ( $col_num == $i ) echo 'class="active"';
echo '></a>';
}
@@ -519,8 +528,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<!-- Sub Row Actions -->
<div class="um-admin-drag-rowsub-icons">
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
<?php if ( $c > 0 ) { ?><a href="#" class="um-admin-tipsy-n" title="Delete Row" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a><?php } ?>
</div><div class="um-admin-clear"></div>
<?php if ( $c > 0 ) { ?><a href="javascript:void(0);" class="um-admin-tipsy-n" title="Delete Row" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a><?php } ?>
</div>
<div class="um-admin-clear"></div>
<!-- Columns -->
<div class="um-admin-drag-col">
@@ -532,6 +542,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
$subrow_fields = $this->array_sort_by_column( $subrow_fields, 'position');
foreach( $subrow_fields as $key => $keyarray ) {
/**
* @var $type
* @var $title
*/
extract( $keyarray );
?>
@@ -548,16 +562,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<div class="um-admin-drag-fld-type um-field-type-<?php echo $type; ?>"><?php echo $field_name; ?></div>
<div class="um-admin-drag-fld-icons um-field-type-<?php echo $type; ?>">
<a href="#" class="um-admin-tipsy-n" title="Edit" data-modal="UM_edit_field" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="<?php echo $type; ?>" data-arg2="<?php echo $this->form_id; ?>" data-arg3="<?php echo $key; ?>"><i class="um-faicon-pencil"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="Edit" data-modal="UM_edit_field" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="<?php echo $type; ?>" data-arg2="<?php echo $this->form_id; ?>" data-arg3="<?php echo $key; ?>"><i class="um-faicon-pencil"></i></a>
<a href="#" class="um-admin-tipsy-n um_admin_duplicate_field" title="Duplicate" data-silent_action="um_admin_duplicate_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-files-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n um_admin_duplicate_field" title="Duplicate" data-silent_action="um_admin_duplicate_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-files-o"></i></a>
<?php if ( $type == 'group' ) { ?>
<a href="#" class="um-admin-tipsy-n" title="Delete Group" data-remove_element="um-admin-drag-fld.um-field-type-group" data-silent_action="um_admin_remove_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-trash-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="Delete Group" data-remove_element="um-admin-drag-fld.um-field-type-group" data-silent_action="um_admin_remove_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-trash-o"></i></a>
<?php } else { ?>
<a href="#" class="um-admin-tipsy-n" title="Delete" data-silent_action="um_admin_remove_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-trash-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="Delete" data-silent_action="um_admin_remove_field" data-arg1="<?php echo $key; ?>" data-arg2="<?php echo $this->form_id; ?>"><i class="um-faicon-trash-o"></i></a>
<?php } ?>
@@ -666,6 +680,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
*/
$output['error'] = apply_filters( 'um_admin_field_update_error_handling', $output['error'], $array );
/**
* @var $_metakey
* @var $post_id
*/
extract( $array['post'] );
if ( empty( $output['error'] ) ){
@@ -830,12 +848,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
ob_start(); ?>
<div class="um-admin-metabox">
<p class="_icon_search"><input type="text" name="_icon_search" id="_icon_search" value="" placeholder="<?php _e('Search Icons...','ultimate-member'); ?>" /></p>
<p class="_icon_search"><input type="text" name="_icon_search" id="_icon_search" value="" placeholder="<?php esc_attr_e('Search Icons...', 'ultimate-member' ); ?>" /></p>
</div>
<div class="um-admin-icons">
<?php foreach( UM()->fonticons()->all as $icon ) { ?>
<span data-code="<?php echo $icon; ?>" title="<?php echo $icon; ?>" class="um-admin-tipsy-n"><i class="<?php echo $icon; ?>"></i></span>
<span data-code="<?php echo esc_attr( $icon ); ?>" title="<?php echo esc_attr( $icon ); ?>" class="um-admin-tipsy-n"><i class="<?php echo $icon; ?>"></i></span>
<?php } ?>
</div><div class="um-admin-clear"></div>
@@ -853,31 +871,35 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<h4><?php _e('Setup New Field','ultimate-member'); ?></h4>
<div class="um-admin-btns">
<?php
if ( UM()->builtin()->core_fields ) {
<?php if ( UM()->builtin()->core_fields ) {
foreach ( UM()->builtin()->core_fields as $field_type => $array ) {
if ( isset( $array['in_fields'] ) && $array['in_fields'] == false ) { } else {
?>
if ( isset( $array['in_fields'] ) && $array['in_fields'] == false ) {
continue;
} ?>
<a href="#" class="button" data-modal="UM_add_field" data-modal-size="normal" data-dynamic-content="um_admin_new_field_popup" data-arg1="<?php echo $field_type; ?>" data-arg2="<?php echo $arg2 ?>"><?php echo $array['name']; ?></a>
<a href="javascript:void(0);" class="button" data-modal="UM_add_field" data-modal-size="normal" data-dynamic-content="um_admin_new_field_popup" data-arg1="<?php echo esc_attr( $field_type ); ?>" data-arg2="<?php echo esc_attr( $arg2 ) ?>"><?php echo esc_html( $array['name'] ); ?></a>
<?php } } } ?>
<?php }
} ?>
</div>
<h4><?php _e('Predefined Fields','ultimate-member'); ?></h4>
<div class="um-admin-btns">
<?php
if ( UM()->builtin()->predefined_fields ) {
<?php if ( UM()->builtin()->predefined_fields ) {
foreach ( UM()->builtin()->predefined_fields as $field_key => $array ) {
if ( !isset( $array['account_only'] ) && !isset( $array['private_use'] ) ) {?>
if ( ! isset( $array['account_only'] ) && ! isset( $array['private_use'] ) ) { ?>
<a href="#" class="button" <?php disabled( in_array( $field_key, $form_fields, true ) ) ?> data-silent_action="um_admin_add_field_from_predefined" data-arg1="<?php echo $field_key; ?>" data-arg2="<?php echo $arg2; ?>"><?php echo um_trim_string( stripslashes( $array['title'] ), 20 ); ?></a>
<a href="javascript:void(0);" class="button" <?php disabled( in_array( $field_key, $form_fields, true ) ) ?> data-silent_action="um_admin_add_field_from_predefined" data-arg1="<?php echo esc_attr( $field_key ); ?>" data-arg2="<?php echo esc_attr( $arg2 ); ?>"><?php echo um_trim_string( stripslashes( $array['title'] ), 20 ); ?></a>
<?php } } } else { echo '<p>' . __('None','ultimate-member') . '</p>'; } ?>
<?php }
}
} else {
echo '<p>' . __( 'None', 'ultimate-member' ) . '</p>';
} ?>
</div>
@@ -886,13 +908,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<?php
if ( UM()->builtin()->custom_fields ) {
foreach ( UM()->builtin()->custom_fields as $field_key => $array ) {
foreach ( UM()->builtin()->custom_fields as $field_key => $array ) { ?>
?>
<a href="javascript:void(0);" class="button with-icon" <?php disabled( in_array( $field_key, $form_fields, true ) ) ?> data-silent_action="um_admin_add_field_from_list" data-arg1="<?php echo esc_attr( $field_key ); ?>" data-arg2="<?php echo esc_attr( $arg2 ); ?>"><?php echo um_trim_string( stripslashes( $array['title'] ), 20 ); ?> <small>(<?php echo ucfirst( $array['type']); ?>)</small><span class="remove"></span></a>
<a href="#" class="button with-icon" <?php disabled( in_array( $field_key, $form_fields, true ) ) ?> data-silent_action="um_admin_add_field_from_list" data-arg1="<?php echo $field_key; ?>" data-arg2="<?php echo $arg2; ?>"><?php echo um_trim_string( stripslashes( $array['title'] ), 20 ); ?> <small>(<?php echo ucfirst( $array['type']); ?>)</small><span class="remove"></span></a>
<?php } } else { echo '<p>' . __('You did not create any custom fields', 'ultimate-member') . '</p>'; } ?>
<?php }
} else {
echo '<p>' . __( 'You did not create any custom fields', 'ultimate-member' ) . '</p>';
} ?>
</div>
@@ -921,9 +944,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
extract( $args );
if ( !isset( $col1 ) ) {
if ( ! isset( $col1 ) ) {
echo '<p>'. __('This field type is not setup correcty.', 'ultimate-member') . '</p>';
echo '<p>'. __( 'This field type is not setup correcty.', 'ultimate-member' ) . '</p>';
} else {
@@ -1014,13 +1037,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<div class="um-admin-half">
<?php if ( isset( $col1 ) ) { foreach( $col1 as $opt ) $metabox->field_input ( $opt ); } ?>
<?php if ( isset( $col1 ) ) { foreach( $col1 as $opt ) $metabox->field_input ( $opt ); } ?>
</div>
<div class="um-admin-half um-admin-right">
<?php if ( isset( $col2 ) ) { foreach( $col2 as $opt ) $metabox->field_input ( $opt ); } ?>
<?php if ( isset( $col2 ) ) { foreach( $col2 as $opt ) $metabox->field_input ( $opt ); } ?>
</div><div class="um-admin-clear"></div>
@@ -1028,7 +1051,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
<div class="um-admin-clear"></div>
<?php if ( isset( $col_full ) ) {foreach( $col_full as $opt ) $metabox->field_input ( $opt ); } ?>
<?php if ( isset( $col_full ) ) { foreach( $col_full as $opt ) $metabox->field_input ( $opt ); } ?>
<?php $this->modal_footer( $arg2, $args, $metabox ); ?>
+3 -2
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) {
@@ -98,7 +99,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Columns' ) ) {
function post_row_actions( $actions, $post ) {
//check for your post type
if ( $post->post_type == "um_form" ) {
$actions['um_duplicate'] = '<a href="' . $this->duplicate_uri( $post->ID ) . '">' . __( 'Duplicate', 'ultimate-member' ) . '</a>';
$actions['um_duplicate'] = '<a href="' . esc_url( $this->duplicate_uri( $post->ID ) ) . '">' . __( 'Duplicate', 'ultimate-member' ) . '</a>';
}
return $actions;
}
+40 -37
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
@@ -73,7 +74,7 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
$row_args = $row_array;
if ( isset( $this->row_data[ $row_array['origin'] ] ) ) {
foreach( $this->row_data[ $row_array['origin'] ] as $k => $v ){
foreach ( $this->row_data[ $row_array['origin'] ] as $k => $v ){
if ( $k != 'position' && $k != 'metakey' ) {
$update_args[$k] = $v;
}
@@ -84,55 +85,56 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
$this->exist_rows[] = $key;
}
$fields[$key] = $row_args;
$fields[ $key ] = $row_args;
}
// change field position
if ( 0 === strpos( $key, 'um_position_' ) ) {
$field_key = str_replace('um_position_','',$key);
if ( isset( $fields[$field_key] ) ) {
$fields[$field_key]['position'] = $value;
$field_key = str_replace( 'um_position_', '', $key );
if ( isset( $fields[ $field_key ] ) ) {
$fields[ $field_key ]['position'] = $value;
}
}
// change field master row
if ( 0 === strpos( $key, 'um_row_' ) ) {
$field_key = str_replace('um_row_','',$key);
if ( isset( $fields[$field_key] ) ) {
$fields[$field_key]['in_row'] = $value;
$field_key = str_replace( 'um_row_', '', $key );
if ( isset( $fields[ $field_key ] ) ) {
$fields[ $field_key ]['in_row'] = $value;
}
}
// change field sub row
if ( 0 === strpos( $key, 'um_subrow_' ) ) {
$field_key = str_replace('um_subrow_','',$key);
if ( isset( $fields[$field_key] ) ) {
$fields[$field_key]['in_sub_row'] = $value;
$field_key = str_replace( 'um_subrow_', '', $key );
if ( isset( $fields[ $field_key ] ) ) {
$fields[ $field_key ]['in_sub_row'] = $value;
}
}
// change field column
if ( 0 === strpos( $key, 'um_col_' ) ) {
$field_key = str_replace('um_col_','',$key);
if ( isset( $fields[$field_key] ) ) {
$fields[$field_key]['in_column'] = $value;
$field_key = str_replace( 'um_col_', '', $key );
if ( isset( $fields[ $field_key ] ) ) {
$fields[ $field_key ]['in_column'] = $value;
}
}
// add field to group
if ( 0 === strpos( $key, 'um_group_' ) ) {
$field_key = str_replace('um_group_','',$key);
if ( isset( $fields[$field_key] ) ) {
$fields[$field_key]['in_group'] = $value;
$field_key = str_replace( 'um_group_', '', $key );
if ( isset( $fields[ $field_key ] ) ) {
$fields[ $field_key ]['in_group'] = $value;
}
}
}
foreach ( $this->row_data as $k => $v ) {
if ( ! in_array( $k, $this->exist_rows ) )
unset( $this->row_data[$k] );
if ( ! in_array( $k, $this->exist_rows ) ) {
unset( $this->row_data[ $k ] );
}
}
update_option( 'um_existing_rows_' . $form_id, $this->exist_rows );
@@ -151,33 +153,34 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
$screen = get_current_screen();
if ( ! isset( $screen->id ) || $screen->id != 'um_form' ) return;
?>
if ( ! isset( $screen->id ) || $screen->id != 'um_form' ) {
return;
} ?>
<div class="um-col-demon-settings" data-in_row="" data-in_sub_row="" data-in_column="" data-in_group=""></div>
<div class="um-col-demon-row" style="display:none;">
<div class="um-admin-drag-row-icons">
<a href="#" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php _e('Add Row','ultimate-member'); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="#" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php _e('Edit Row','ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo get_the_ID(); ?>"><i class="um-faicon-pencil"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php esc_attr_e( 'Add Row', 'ultimate-member' ); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
<a href="javascript:void(0);" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php esc_attr_e( 'Edit Row', 'ultimate-member' ); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo esc_attr( get_the_ID() ); ?>"><i class="um-faicon-pencil"></i></a>
<span class="um-admin-drag-row-start"><i class="um-icon-arrow-move"></i></span>
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
</div><div class="um-admin-clear"></div>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="<?php esc_attr_e( 'Delete Row', 'ultimate-member' ); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
</div>
<div class="um-admin-clear"></div>
<div class="um-admin-drag-rowsubs">
<div class="um-admin-drag-rowsub">
<div class="um-admin-drag-ctrls columns">
<a href="#" class="active" data-cols="1"></a>
<a href="#" data-cols="2"></a>
<a href="#" data-cols="3"></a>
<a href="javascript:void(0);" class="active" data-cols="1"></a>
<a href="javascript:void(0);" data-cols="2"></a>
<a href="javascript:void(0);" data-cols="3"></a>
</div>
<div class="um-admin-drag-rowsub-icons">
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="<?php esc_attr_e( 'Delete Row', 'ultimate-member' ); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
</div><div class="um-admin-clear"></div>
<div class="um-admin-drag-col">
@@ -195,14 +198,14 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
<div class="um-col-demon-subrow" style="display:none;">
<div class="um-admin-drag-ctrls columns">
<a href="#" class="active" data-cols="1"></a>
<a href="#" data-cols="2"></a>
<a href="#" data-cols="3"></a>
<a href="javascript:void(0);" class="active" data-cols="1"></a>
<a href="javascript:void(0);" data-cols="2"></a>
<a href="javascript:void(0);" data-cols="3"></a>
</div>
<div class="um-admin-drag-rowsub-icons">
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
<a href="javascript:void(0);" class="um-admin-tipsy-n" title="<?php esc_attr_e( 'Delete Row', 'ultimate-member' ); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
</div><div class="um-admin-clear"></div>
<div class="um-admin-drag-col">
@@ -217,9 +220,9 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
<form action="" method="post" class="um_update_order">
<input type="hidden" name="form_id" id="form_id" value="<?php echo get_the_ID(); ?>" />
<input type="hidden" name="form_id" id="form_id" value="<?php echo esc_attr( get_the_ID() ); ?>" />
<input type="hidden" name="action" value="um_update_order" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<div class="um_update_order_fields">
+3 -4
View File
@@ -2,7 +2,6 @@
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
@@ -195,9 +194,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
function admin_head() {
if ( UM()->admin()->is_plugin_post_type() ) { ?>
<style type="text/css">
.um-admin.post-type-<?php echo get_post_type(); ?> div#slugdiv,
.um-admin.post-type-<?php echo get_post_type(); ?> div#minor-publishing,
.um-admin.post-type-<?php echo get_post_type(); ?> div#screen-meta-links
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#slugdiv,
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#minor-publishing,
.um-admin.post-type-<?php echo esc_attr( get_post_type() ); ?> div#screen-meta-links
{display:none}
</style>
<?php }
+92 -74
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
@@ -76,8 +77,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
<?php }
foreach ( $this->form_data['fields'] as $field_data ) {
if ( isset( $field_data['type'] ) && 'hidden' != $field_data['type'] )
if ( isset( $field_data['type'] ) && 'hidden' != $field_data['type'] ) {
echo $this->render_form_row( $field_data );
}
}
if ( empty( $this->form_data['without_wrapper'] ) ) { ?>
@@ -103,8 +105,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_form_row( $data ) {
if ( empty( $data['type'] ) )
if ( empty( $data['type'] ) ) {
return '';
}
if ( !empty( $data['value'] ) && $data['type'] != 'email_template' ) {
$data['value'] = wp_unslash( $data['value'] );
@@ -116,9 +119,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
}
$conditional = ! empty( $data['conditional'] ) ? 'data-conditional="' . esc_attr( json_encode( $data['conditional'] ) ) . '"' : '';
$prefix_attr = ! empty( $this->form_data['prefix_id'] ) ? ' data-prefix="' . $this->form_data['prefix_id'] . '" ' : '';
$prefix_attr = ! empty( $this->form_data['prefix_id'] ) ? ' data-prefix="' . esc_attr( $this->form_data['prefix_id'] ) . '" ' : '';
$type_attr = ' data-field_type="' . $data['type'] . '" ';
$type_attr = ' data-field_type="' . esc_attr( $data['type'] ) . '" ';
$html = '';
if ( $data['type'] != 'hidden' ) {
@@ -302,16 +305,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
* @return bool|string
*/
function render_field_label( $data ) {
if ( empty( $data['label'] ) )
if ( empty( $data['label'] ) ) {
return false;
}
$id = ! empty( $data['id1'] ) ? $data['id1'] : $data['id'];
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $id;
$for_attr = ' for="' . $id . '" ';
$for_attr = ' for="' . esc_attr( $id ) . '" ';
$label = $data['label'];
if ( isset( $data['required'] ) && $data['required'] )
$label = $label . '<span class="um-req" title="'.__('Required','ultimate-member').'">*</span>';
if ( isset( $data['required'] ) && $data['required'] ) {
$label = $label . '<span class="um-req" title="' . esc_attr__( 'Required', 'ultimate-member' ) . '">*</span>';
}
$tooltip = ! empty( $data['tooltip'] ) ? UM()->tooltip( $data['tooltip'], false, false ) : '';
@@ -331,10 +336,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$id_attr = ' id="' . $id . '" ';
$id_attr = ' id="' . esc_attr( $id ) . '" ';
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -342,7 +347,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -367,30 +372,31 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_text( $field_data ) {
if ( empty( $field_data['id'] ) )
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="' . $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 ' . $class . '" ';
$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'] ) ){
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}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$placeholder_attr = ! empty( $field_data['placeholder'] ) ? ' placeholder="' . $field_data['placeholder'] . '"' : '';
$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;
@@ -412,16 +418,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_color( $field_data ) {
if ( empty( $field_data['id'] ) )
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="' . $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 .= ' um-admin-colorpicker ';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -429,10 +436,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$placeholder_attr = ! empty( $field_data['placeholder'] ) ? ' placeholder="' . $field_data['placeholder'] . '"' : '';
$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;
@@ -454,11 +461,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_icon( $field_data ) {
if ( empty( $field_data['id'] ) )
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="' . $id . '" ';
$id_attr = ' id="' . esc_attr( $id ) . '" ';
$name = $field_data['id'];
$name = ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] . '[' . $name . ']' : $name;
@@ -467,7 +475,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$value = $this->get_field_value( $field_data );
$value_attr = ' value="' . $value . '" ';
$html = '<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="">' . __( 'Choose Icon', 'ultimate-member' ) . '</a>
$html = '<a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="">' . __( 'Choose Icon', 'ultimate-member' ) . '</a>
<span class="um-admin-icon-value">';
if ( ! empty( $value ) ) {
@@ -497,15 +505,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_datepicker( $field_data ) {
if ( empty( $field_data['id'] ) )
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="' . $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 ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -513,10 +522,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$placeholder_attr = ! empty( $field_data['placeholder'] ) ? ' placeholder="' . $field_data['placeholder'] . '"' : '';
$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;
@@ -538,9 +547,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_inline_texts( $field_data ) {
if ( empty( $field_data['id1'] ) )
if ( empty( $field_data['id1'] ) ) {
return false;
}
$i = 1;
$fields = array();
@@ -550,20 +559,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$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 ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id'. $i]
'field_id' => $field_data[ 'id'. $i ]
);
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$placeholder_attr = ! empty( $field_data['placeholder'] ) ? ' placeholder="' . $field_data['placeholder'] . '"' : '';
$name = $field_data['id'. $i];
$name = $field_data[ 'id'. $i ];
$name = ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] . '[' . $name . ']' : $name;
$name_attr = ' name="' . $name . '" ';
@@ -589,15 +598,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_textarea( $field_data ) {
if ( empty( $field_data['id'] ) )
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="' . $id . '" ';
$id_attr = ' id="' . esc_attr( $id ) . '" ';
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class .= ! empty( $field_data['size'] ) ? $field_data['size'] : 'um-long-field';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -605,7 +615,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$rows = ! empty( $field_data['args']['textarea_rows'] ) ? ' rows="' . $field_data['args']['textarea_rows'] . '" ' : '';
@@ -629,8 +639,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_wp_editor( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
@@ -643,7 +654,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -680,12 +691,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return false;
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$id_attr = ' id="' . $id . '" ';
$id_attr_hidden = ' id="' . $id . '_hidden" ';
$id_attr = ' id="' . esc_attr( $id ) . '" ';
$id_attr_hidden = ' id="' . esc_attr( $id ) . '_hidden" ';
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class .= ! empty( $field_data['size'] ) ? $field_data['size'] : 'um-long-field';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -697,7 +708,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -721,17 +732,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_select( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$multiple = ! empty( $field_data['multi'] ) ? 'multiple' : '';
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$id_attr = ' id="' . $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 ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -739,7 +751,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -755,8 +767,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
foreach ( $field_data['options'] as $key => $option ) {
if ( ! empty( $field_data['multi'] ) ) {
if ( ! is_array( $value ) || empty( $value ) )
if ( ! is_array( $value ) || empty( $value ) ) {
$value = array();
}
$options .= '<option value="' . $key . '" ' . selected( in_array( $key, $value ), true, false ) . '>' . esc_html( $option ) . '</option>';
} else {
@@ -799,7 +812,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -824,7 +837,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
continue ;
}
$id_attr = ' id="' . $id . '-' . $k . '" ';
$id_attr = ' id="' . esc_attr( $id . '-' . $k ) . '" ';
$options = '';
foreach ( $field_data['options'] as $key => $option ) {
@@ -866,14 +879,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_multi_checkbox( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class .= ! empty( $field_data['size'] ) ? $field_data['size'] : 'um-long-field';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$name = $field_data['id'];
$name = ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] . '[' . $name . ']' : $name;
@@ -890,8 +904,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$html .= '<span class="um-form-fields-section" style="width:' . floor( 100 / $columns ) . '% !important;">';
foreach ( $section_fields_per_page as $k => $title ) {
$id_attr = ' id="' . $id . '_' . $k . '" ';
$for_attr = ' for="' . $id . '_' . $k . '" ';
$id_attr = ' id="' . esc_attr( $id . '_' . $k ) . '" ';
$for_attr = ' for="' . esc_attr( $id . '_' . $k ) . '" ';
$name_attr = ' name="' . $name . '[' . $k . ']" ';
$html .= "<label $for_attr>
@@ -915,15 +929,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_multi_text( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$size = ! empty( $field_data['size'] ) ? 'um-' . $field_data['size'] . '-field' : 'um-long-field';
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class_attr = ' class="um-forms-field ' . $class . '" ';
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id'],
@@ -932,7 +947,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -946,9 +961,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$html .= "<ul class=\"um-multi-text-list\" $data_attr>";
if ( ! empty( $values ) ) {
foreach ( $values as $k=>$value ) {
$value = esc_attr($value);
$id_attr = ' id="' . $id . '-' . $k . '" ';
foreach ( $values as $k => $value ) {
$value = esc_attr( $value );
$id_attr = ' id="' . esc_attr( $id . '-' . $k ) . '" ';
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
<input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"$value\" /></span>
@@ -957,7 +972,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
} elseif ( ! empty( $field_data['show_default_number'] ) && is_numeric( $field_data['show_default_number'] ) && $field_data['show_default_number'] > 0 ) {
$i = 0;
while( $i < $field_data['show_default_number'] ) {
$id_attr = ' id="' . $id . '-' . $i . '" ';
$id_attr = ' id="' . esc_attr( $id . '-' . $i ) . '" ';
$html .= "<li class=\"um-multi-text-option-line {$size}\"><span class=\"um-field-wrapper\">
<input type=\"text\" $id_attr $name_attr $class_attr $data_attr value=\"\" /></span>
@@ -980,8 +995,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*/
function render_media( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
@@ -993,8 +1009,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
'field_id' => $field_data['id'] . '_url',
);
if ( ! empty( $field_data['default']['url'] ) )
if ( ! empty( $field_data['default']['url'] ) ) {
$data['default'] = esc_attr( $field_data['default']['url'] );
}
$data_attr = '';
foreach ( $data as $key => $value ) {
@@ -1029,8 +1046,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$html .= '<input type="text" class="um-media-upload-url" readonly value="' . $image_url . '" /><div style="clear:both;"></div>';
}
$html .= '<input type="button" class="um-set-image button button-primary" value="' . __( 'Select', 'ultimate-member' ) . '" data-upload_frame="' . $upload_frame_title . '" />
<input type="button" class="um-clear-image button" value="' . __( 'Clear', 'ultimate-member' ) . '" /></div>';
$html .= '<input type="button" class="um-set-image button button-primary" value="' . esc_attr__( 'Select', 'ultimate-member' ) . '" data-upload_frame="' . $upload_frame_title . '" />
<input type="button" class="um-clear-image button" value="' . esc_attr__( 'Clear', 'ultimate-member' ) . '" /></div>';
return $html;
}
@@ -1042,8 +1059,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
* @return bool|string
*/
function render_email_template( $field_data ) {
if ( empty( $field_data['id'] ) )
if ( empty( $field_data['id'] ) ) {
return false;
}
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
@@ -1056,7 +1074,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
@@ -1099,10 +1117,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return false;
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$id_attr = ' id="' . $id . '" ';
$id_attr = ' id="' . esc_attr( $id ) . '" ';
$class = ! empty( $field_data['class'] ) ? $field_data['class'] : '';
$class_attr = ' class="um-forms-field button ' . $class . '" ';
$class_attr = ' class="um-forms-field button ' . esc_attr( $class ) . '" ';
$data = array(
'field_id' => $field_data['id']
@@ -1110,7 +1128,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
$data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
}
$name = $field_data['id'];
+6 -4
View File
@@ -3,9 +3,11 @@ namespace um\admin\core;
use \RecursiveDirectoryIterator;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
@@ -214,7 +216,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
wp_enqueue_script( 'postbox' );
/** custom metaboxes for dashboard defined here **/
add_meta_box( 'um-metaboxes-contentbox-1', __( 'Users Overview','ultimate-member' ), array( &$this, 'users_overview' ), $this->pagehook, 'core', 'core' );
add_meta_box( 'um-metaboxes-contentbox-1', __( 'Users Overview', 'ultimate-member' ), array( &$this, 'users_overview' ), $this->pagehook, 'core', 'core' );
add_meta_box( 'um-metaboxes-mainbox-1', __( 'Latest from our blog', 'ultimate-member' ), array( &$this, 'um_news' ), $this->pagehook, 'normal', 'core' );
@@ -283,7 +285,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
$size = 0;
foreach( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $directory ) ) as $file ) {
$size+=$file->getSize();
$size += $file->getSize();
}
return round ( $size / 1048576, 2);
}
@@ -328,7 +330,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
//<![CDATA[
jQuery(document).ready( function($) {
// postboxes setup
postboxes.add_postbox_toggles('<?php echo $this->pagehook; ?>');
postboxes.add_postbox_toggles('<?php echo esc_js( $this->pagehook ); ?>');
});
//]]>
</script>
+163 -205
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
@@ -27,65 +28,22 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$this->in_edit = false;
$this->edit_mode_value = null;
add_action('admin_head', array(&$this, 'admin_head'), 9);
add_action('admin_footer', array(&$this, 'load_modal_content'), 9);
add_action( 'admin_head', array( &$this, 'admin_head' ), 9);
add_action( 'admin_footer', array( &$this, 'load_modal_content' ), 9);
add_action( 'load-post.php', array(&$this, 'add_metabox'), 9 );
add_action( 'load-post-new.php', array(&$this, 'add_metabox'), 9 );
add_action( 'load-post.php', array( &$this, 'add_metabox' ), 9 );
add_action( 'load-post-new.php', array( &$this, 'add_metabox' ), 9 );
add_action( 'admin_init', array(&$this, 'add_taxonomy_metabox'), 9 );
add_action( 'admin_init', array( &$this, 'add_taxonomy_metabox' ), 9 );
//roles metaboxes
add_action( 'um_roles_add_meta_boxes', array( &$this, 'add_metabox_role' ) );
add_filter( 'um_builtin_validation_types_continue_loop', array( &$this, 'validation_types_continue_loop' ), 1, 4 );
add_filter( 'um_restrict_content_hide_metabox', array( &$this, 'hide_metabox_restrict_content_shop' ), 10, 1 );
/**
* @todo remove these options
*/
//add_filter( 'um_admin_access_settings_fields', array( &$this, 'wpml_post_options' ), 10, 2 );
}
/**
* Add option for WPML
*
* @param array $fields
* @param array $data
*
* @return array
*/
/*function wpml_post_options( $fields, $data ) {
global $post;
if ( ! function_exists( 'icl_get_current_language' ) ) {
return $fields;
}
if ( empty( $post->post_type ) || $post->post_type != 'page' ) {
return $fields;
}
$fields[] = array(
'id' => '_um_wpml_user',
'type' => 'checkbox',
'label' => __( 'This is a translation of UM profile page?', 'ultimate-member' ),
'value' => ! empty( $data['_um_wpml_user'] ) ? $data['_um_wpml_user'] : 0
);
$fields[] = array(
'id' => '_um_wpml_account',
'type' => 'checkbox',
'label' => __( 'This is a translation of UM account page?', 'ultimate-member' ),
'value' => ! empty( $data['_um_wpml_account'] ) ? $data['_um_wpml_account'] : 0
);
return $fields;
}*/
/**
* Hide Woocommerce Shop page restrict content metabox
* @param $hide
@@ -526,8 +484,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$_um_access_roles_value = array();
if ( ! empty( $data['_um_access_roles'] ) ) {
foreach ( $data['_um_access_roles'] as $key => $value ) {
if ( $value )
if ( $value ) {
$_um_access_roles_value[] = $key;
}
}
}
@@ -681,15 +640,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
function um_category_access_fields_save( $termID ) {
// validate nonce
if ( ! isset( $_REQUEST['um_admin_save_taxonomy_restrict_content_nonce'] ) || ! wp_verify_nonce( $_REQUEST['um_admin_save_taxonomy_restrict_content_nonce'], basename( __FILE__ ) ) )
if ( ! isset( $_REQUEST['um_admin_save_taxonomy_restrict_content_nonce'] ) || ! wp_verify_nonce( $_REQUEST['um_admin_save_taxonomy_restrict_content_nonce'], basename( __FILE__ ) ) ) {
return $termID;
}
// validate user
$term = get_term( $termID );
$taxonomy = get_taxonomy( $term->taxonomy );
if ( ! current_user_can( $taxonomy->cap->edit_terms, $termID ) )
if ( ! current_user_can( $taxonomy->cap->edit_terms, $termID ) ) {
return $termID;
}
if ( ! empty( $_REQUEST['um_content_restriction'] ) ) {
update_term_meta( $termID, 'um_content_restriction', $_REQUEST['um_content_restriction'] );
@@ -1236,11 +1197,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_visibility':
?>
<p><label for="_visibility">Visibility <?php UM()->tooltip( __('Select where this field should appear. This option should only be changed on the profile form and allows you to show a field in one mode only (edit or view) or in both modes.','ultimate-member' ) ); ?></label>
<p><label for="_visibility"><?php _e( 'Visibility', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select where this field should appear. This option should only be changed on the profile form and allows you to show a field in one mode only (edit or view) or in both modes.','ultimate-member' ) ); ?></label>
<select name="_visibility" id="_visibility" style="width: 100%">
<option value="all" <?php selected( 'all', $this->edit_mode_value ); ?>>View everywhere</option>
<option value="edit" <?php selected( 'edit', $this->edit_mode_value ); ?>>Edit mode only</option>
<option value="view" <?php selected( 'view', $this->edit_mode_value ); ?>>View mode only</option>
<option value="all" <?php selected( 'all', $this->edit_mode_value ); ?>><?php _e( 'View everywhere', 'ultimate-member' ) ?></option>
<option value="edit" <?php selected( 'edit', $this->edit_mode_value ); ?>><?php _e( 'Edit mode only', 'ultimate-member' ) ?></option>
<option value="view" <?php selected( 'view', $this->edit_mode_value ); ?>><?php _e( 'View mode only', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1255,22 +1216,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p>
<select name="<?php echo $attribute; ?>" id="<?php echo $attribute; ?>" style="width: 90px">
<select name="<?php echo esc_attr( $attribute ); ?>" id="<?php echo esc_attr( $attribute ); ?>" style="width: 90px">
<option></option>
<?php
$actions = array('show','hide');
foreach( $actions as $action ) {
?>
<?php $actions = array( 'show', 'hide' );
foreach ( $actions as $action ) { ?>
<option value="<?php echo $action; ?>" <?php selected( $action, $this->edit_mode_value ); ?>><?php echo $action; ?></option>
<option value="<?php echo esc_attr( $action ); ?>" <?php selected( $action, $this->edit_mode_value ); ?>><?php echo $action; ?></option>
<?php } ?>
</select>
&nbsp;&nbsp;<?php _e('If'); ?>
&nbsp;&nbsp;<?php _e( 'If' ); ?>
</p>
<?php
@@ -1284,7 +1243,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p>
<select name="<?php echo $attribute; ?>" id="<?php echo $attribute; ?>" style="width: 150px">
<select name="<?php echo esc_attr( $attribute ); ?>" id="<?php echo esc_attr( $attribute ); ?>" style="width: 150px">
<option></option>
@@ -1294,7 +1253,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
if ( isset( $array['title'] ) &&
( ! isset( $this->edit_array['metakey'] ) || $key != $this->edit_array['metakey'] ) ) { ?>
<option value="<?php echo $key ?>" <?php selected( $key, $this->edit_mode_value ) ?>><?php echo $array['title'] ?></option>
<option value="<?php echo esc_attr( $key ) ?>" <?php selected( $key, $this->edit_mode_value ) ?>><?php echo $array['title'] ?></option>
<?php }
} ?>
@@ -1313,7 +1272,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p>
<select name="<?php echo $attribute; ?>" id="<?php echo $attribute; ?>" style="width: 150px">
<select name="<?php echo esc_attr( $attribute ); ?>" id="<?php echo esc_attr( $attribute ); ?>" style="width: 150px">
<option></option>
@@ -1329,7 +1288,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
foreach ( $operators as $operator ) { ?>
<option value="<?php echo $operator; ?>" <?php selected( $operator, $this->edit_mode_value ); ?>><?php echo $operator; ?></option>
<option value="<?php echo esc_attr( $operator ); ?>" <?php selected( $operator, $this->edit_mode_value ); ?>><?php echo $operator; ?></option>
<?php } ?>
@@ -1347,7 +1306,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p>
<input type="text" name="<?php echo $attribute; ?>" id="<?php echo $attribute; ?>" value="<?php echo isset( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" placeholder="<?php _e( 'Value', 'ultimate-member' ); ?>" style="width: 150px!important;position: relative;top: -1px;" />
<input type="text" name="<?php echo esc_attr( $attribute ); ?>" id="<?php echo esc_attr( $attribute ); ?>" value="<?php echo isset( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" placeholder="<?php esc_attr_e( 'Value', 'ultimate-member' ); ?>" style="width: 150px!important;position: relative;top: -1px;" />
</p>
<?php
@@ -1356,8 +1315,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_validate':
?>
<p><label for="_validate">Validate <?php UM()->tooltip( __( 'Does this field require a special validation', 'ultimate-member' ) ); ?></label>
<select name="_validate" id="_validate" data-placeholder="Select a validation type..." class="um-adm-conditional" data-cond1='custom' data-cond1-show='_custom_validate' style="width: 100%">
<p><label for="_validate"><?php _e( 'Validate', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Does this field require a special validation', 'ultimate-member' ) ); ?></label>
<select name="_validate" id="_validate" data-placeholder="<?php esc_attr_e( 'Select a validation type...', 'ultimate-member' ) ?>" class="um-adm-conditional" data-cond1="custom" data-cond1-show="_custom_validate" style="width: 100%">
<option value="" <?php selected( '', $this->edit_mode_value ); ?>></option>
@@ -1388,7 +1347,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
*/
$continue = apply_filters( "um_builtin_validation_types_continue_loop", true, $key, $form_id, $field_args );
if ( $continue ) { ?>
<option value="<?php echo $key; ?>" <?php selected( $key, $this->edit_mode_value ); ?>><?php echo $name; ?></option>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $this->edit_mode_value ); ?>><?php echo $name; ?></option>
<?php } ?>
<?php } ?>
@@ -1401,7 +1360,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_custom_validate':
?>
<p class="_custom_validate"><label for="_custom_validate">Custom Action <?php UM()->tooltip( __( 'If you want to apply your custom validation, you can use action hooks to add custom validation. Please refer to documentation for further details.', 'ultimate-member' ) ); ?></label>
<p class="_custom_validate"><label for="_custom_validate"><?php _e( 'Custom Action', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'If you want to apply your custom validation, you can use action hooks to add custom validation. Please refer to documentation for further details.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_custom_validate" id="_custom_validate" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1415,11 +1374,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p class="_heading_text"><label for="_icon">Icon <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
<p class="_heading_text"><label for="_icon"><?php _e( 'Icon', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo $back; ?>">Choose Icon</a>
<a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo esc_attr( $back ); ?>"><?php _e( 'Choose Icon', 'ultimate-member' ) ?></a>
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No Icon<?php } ?></span>
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?><?php _e( 'No Icon', 'ultimate-member' ) ?><?php } ?></span>
<input type="hidden" name="_icon" id="_icon" value="<?php echo (isset( $this->edit_mode_value ) ) ? $this->edit_mode_value : ''; ?>" />
@@ -1443,11 +1402,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
<div class="um-admin-tri">
<p><label for="_icon">Icon <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
<p><label for="_icon"><?php _e( 'Icon', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select an icon to appear in the field. Leave blank if you do not want an icon to show in the field.', 'ultimate-member' ) ); ?></label>
<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo $back; ?>">Choose Icon</a>
<a href="javascript:void(0);" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo esc_attr( $back ); ?>"><?php _e( 'Choose Icon', 'ultimate-member' ) ?></a>
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No Icon<?php } ?></span>
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?><?php _e( 'No Icon', 'ultimate-member' ) ?><?php } ?></span>
<input type="hidden" name="_icon" id="_icon" value="<?php echo (isset( $this->edit_mode_value ) ) ? $this->edit_mode_value : ''; ?>" />
@@ -1470,7 +1429,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_css_class':
?>
<p><label for="_css_class">CSS Class <?php UM()->tooltip( __( 'Specify a custom CSS class to be applied to this element', 'ultimate-member' ) ); ?></label>
<p><label for="_css_class"><?php _e( 'CSS Class', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Specify a custom CSS class to be applied to this element', 'ultimate-member' ) ); ?></label>
<input type="text" name="_css_class" id="_css_class" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1480,7 +1439,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_width':
?>
<p><label for="_width">Thickness (in pixels) <?php UM()->tooltip( __( 'This is the width in pixels, e.g. 4 or 2, etc', 'ultimate-member' ) ); ?></label>
<p><label for="_width"><?php _e( 'Thickness (in pixels)', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the width in pixels, e.g. 4 or 2, etc', 'ultimate-member' ) ); ?></label>
<input type="text" name="_width" id="_width" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 4; ?>" />
</p>
@@ -1490,7 +1449,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_divider_text':
?>
<p><label for="_divider_text">Optional Text <?php UM()->tooltip( __( 'Optional text to include with the divider', 'ultimate-member' ) ); ?></label>
<p><label for="_divider_text"><?php _e( 'Optional Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Optional text to include with the divider', 'ultimate-member' ) ); ?></label>
<input type="text" name="_divider_text" id="_divider_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1500,7 +1459,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_padding':
?>
<p><label for="_padding">Padding <?php UM()->tooltip( __( 'Set padding for this section', 'ultimate-member' ) ); ?></label>
<p><label for="_padding"><?php _e( 'Padding', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Set padding for this section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_padding" id="_padding" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '0px 0px 0px 0px'; ?>" />
</p>
@@ -1510,7 +1469,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_margin':
?>
<p><label for="_margin">Margin <?php UM()->tooltip( __( 'Set margin for this section', 'ultimate-member' ) ); ?></label>
<p><label for="_margin"><?php _e( 'Margin', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Set margin for this section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_margin" id="_margin" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '0px 0px 30px 0px'; ?>" />
</p>
@@ -1520,7 +1479,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_border':
?>
<p><label for="_border">Border <?php UM()->tooltip( __( 'Set border for this section', 'ultimate-member' ) ); ?></label>
<p><label for="_border"><?php _e( 'Border', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Set border for this section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_border" id="_border" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '0px 0px 0px 0px'; ?>" />
</p>
@@ -1530,12 +1489,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_borderstyle':
?>
<p><label for="_borderstyle">Style <?php UM()->tooltip( __( 'Choose the border style', 'ultimate-member' ) ); ?></label>
<p><label for="_borderstyle"><?php _e( 'Style', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Choose the border style', 'ultimate-member' ) ); ?></label>
<select name="_borderstyle" id="_borderstyle" style="width: 100%">
<option value="solid" <?php selected( 'solid', $this->edit_mode_value ); ?>>Solid</option>
<option value="dotted" <?php selected( 'dotted', $this->edit_mode_value ); ?>>Dotted</option>
<option value="dashed" <?php selected( 'dashed', $this->edit_mode_value ); ?>>Dashed</option>
<option value="double" <?php selected( 'double', $this->edit_mode_value ); ?>>Double</option>
<option value="solid" <?php selected( 'solid', $this->edit_mode_value ); ?>><?php _e( 'Solid', 'ultimate-member' ) ?></option>
<option value="dotted" <?php selected( 'dotted', $this->edit_mode_value ); ?>><?php _e( 'Dotted', 'ultimate-member' ) ?></option>
<option value="dashed" <?php selected( 'dashed', $this->edit_mode_value ); ?>><?php _e( 'Dashed', 'ultimate-member' ) ?></option>
<option value="double" <?php selected( 'double', $this->edit_mode_value ); ?>><?php _e( 'Double', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1545,7 +1504,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_borderradius':
?>
<p><label for="_borderradius">Border Radius <?php UM()->tooltip( __( 'Rounded corners can be applied by setting a pixels value here. e.g. 5px', 'ultimate-member' ) ); ?></label>
<p><label for="_borderradius"><?php _e( 'Border Radius', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Rounded corners can be applied by setting a pixels value here. e.g. 5px', 'ultimate-member' ) ); ?></label>
<input type="text" name="_borderradius" id="_borderradius" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '0px'; ?>" />
</p>
@@ -1555,7 +1514,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_bordercolor':
?>
<p><label for="_bordercolor">Border Color <?php UM()->tooltip( __( 'Give a color to this border', 'ultimate-member' ) ); ?></label>
<p><label for="_bordercolor"><?php _e( 'Border Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Give a color to this border', 'ultimate-member' ) ); ?></label>
<input type="text" name="_bordercolor" id="_bordercolor" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1575,7 +1534,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_heading_text':
?>
<p class="_heading_text"><label for="_heading_text">Heading Text <?php UM()->tooltip( __( 'Enter the row heading text here', 'ultimate-member' ) ); ?></label>
<p class="_heading_text"><label for="_heading_text"><?php _e( 'Heading Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enter the row heading text here', 'ultimate-member' ) ); ?></label>
<input type="text" name="_heading_text" id="_heading_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1585,7 +1544,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_background':
?>
<p><label for="_background">Background Color <?php UM()->tooltip( __( 'This will be the background of entire section', 'ultimate-member' ) ); ?></label>
<p><label for="_background"><?php _e( 'Background Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This will be the background of entire section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_background" id="_background" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1595,7 +1554,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_heading_background_color':
?>
<p class="_heading_text"><label for="_heading_background_color">Heading Background Color <?php UM()->tooltip( __( 'This will be the background of the heading section', 'ultimate-member' ) ); ?></label>
<p class="_heading_text"><label for="_heading_background_color"><?php _e( 'Heading Background Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This will be the background of the heading section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_heading_background_color" id="_heading_background_color" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1605,7 +1564,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_heading_text_color':
?>
<p class="_heading_text"><label for="_heading_text_color">Heading Text Color <?php UM()->tooltip( __( 'This will be the text color of heading part only', 'ultimate-member' ) ); ?></label>
<p class="_heading_text"><label for="_heading_text_color"><?php _e( 'Heading Text Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This will be the text color of heading part only', 'ultimate-member' ) ); ?></label>
<input type="text" name="_heading_text_color" id="_heading_text_color" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1615,7 +1574,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_text_color':
?>
<p><label for="_text_color">Text Color <?php UM()->tooltip( __( 'This will be the text color of entire section', 'ultimate-member' ) ); ?></label>
<p><label for="_text_color"><?php _e( 'Text Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This will be the text color of entire section', 'ultimate-member' ) ); ?></label>
<input type="text" name="_text_color" id="_text_color" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1625,7 +1584,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_icon_color':
?>
<p class="_heading_text"><label for="_icon_color">Icon Color <?php UM()->tooltip( __( 'This will be the color of selected icon. By default It will be the same color as heading text color', 'ultimate-member' ) ); ?></label>
<p class="_heading_text"><label for="_icon_color"><?php _e( 'Icon Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This will be the color of selected icon. By default It will be the same color as heading text color', 'ultimate-member' ) ); ?></label>
<input type="text" name="_icon_color" id="_icon_color" class="um-admin-colorpicker" data-default-color="" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1635,7 +1594,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_color':
?>
<p><label for="_color">Color <?php UM()->tooltip( __( 'Select a color for this divider', 'ultimate-member' ) ); ?></label>
<p><label for="_color"><?php _e( 'Color', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select a color for this divider', 'ultimate-member' ) ); ?></label>
<input type="text" name="_color" id="_color" class="um-admin-colorpicker" data-default-color="#eeeeee" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '#eeeeee'; ?>" />
</p>
@@ -1645,7 +1604,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_url_text':
?>
<p><label for="_url_text">URL Alt Text <?php UM()->tooltip( __( 'Entering custom text here will replace the url with a text link', 'ultimate-member' ) ); ?></label>
<p><label for="_url_text"><?php _e( 'URL Alt Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Entering custom text here will replace the url with a text link', 'ultimate-member' ) ); ?></label>
<input type="text" name="_url_text" id="_url_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : ''; ?>" />
</p>
@@ -1655,10 +1614,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_url_target':
?>
<p><label for="_url_target">Link Target <?php UM()->tooltip( __( 'Choose whether to open this link in same window or in a new window', 'ultimate-member' ) ); ?></label>
<p><label for="_url_target"><?php _e( 'Link Target', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Choose whether to open this link in same window or in a new window', 'ultimate-member' ) ); ?></label>
<select name="_url_target" id="_url_target" style="width: 100%">
<option value="_blank" <?php selected( '_blank', $this->edit_mode_value ); ?>>Open in new window</option>
<option value="_self" <?php selected( '_self', $this->edit_mode_value ); ?>>Same window</option>
<option value="_blank" <?php selected( '_blank', $this->edit_mode_value ); ?>><?php _e( 'Open in new window', 'ultimate-member' ) ?></option>
<option value="_self" <?php selected( '_self', $this->edit_mode_value ); ?>><?php _e( 'Same window', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1668,10 +1627,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_url_rel':
?>
<p><label for="_url_rel">SEO Follow <?php UM()->tooltip( __( 'Whether to follow or nofollow this link by search engines', 'ultimate-member' ) ); ?></label>
<p><label for="_url_rel"><?php _e( 'SEO Follow', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Whether to follow or nofollow this link by search engines', 'ultimate-member' ) ); ?></label>
<select name="_url_rel" id="_url_rel" style="width: 100%">
<option value="follow" <?php selected( 'follow', $this->edit_mode_value ); ?>>Follow</option>
<option value="nofollow" <?php selected( 'nofollow', $this->edit_mode_value ); ?>>No-Follow</option>
<option value="follow" <?php selected( 'follow', $this->edit_mode_value ); ?>><?php _e( 'Follow', 'ultimate-member' ) ?></option>
<option value="nofollow" <?php selected( 'nofollow', $this->edit_mode_value ); ?>><?php _e( 'No-Follow', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1681,7 +1640,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_force_good_pass':
?>
<p><label for="_force_good_pass">Force strong password? <?php UM()->tooltip( __( 'Turn on to force users to create a strong password (A combination of one lowercase letter, one uppercase letter, and one number). If turned on this option is only applied to register forms and not to login forms.', 'ultimate-member' ) ); ?></label>
<p><label for="_force_good_pass"><?php _e( 'Force strong password?', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Turn on to force users to create a strong password (A combination of one lowercase letter, one uppercase letter, and one number). If turned on this option is only applied to register forms and not to login forms.', 'ultimate-member' ) ); ?></label>
<input type="checkbox" name="_force_good_pass" id="_force_good_pass" value="1" <?php checked( isset( $this->edit_mode_value ) ? $this->edit_mode_value : 0 ) ?> />
</p>
@@ -1691,7 +1650,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_force_confirm_pass':
?>
<p><label for="_force_confirm_pass">Automatically add a confirm password field? <?php UM()->tooltip( __( 'Turn on to add a confirm password field. If turned on the confirm password field will only show on register forms and not on login forms.', 'ultimate-member' ) ); ?></label>
<p><label for="_force_confirm_pass"><?php _e( 'Automatically add a confirm password field?', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Turn on to add a confirm password field. If turned on the confirm password field will only show on register forms and not on login forms.', 'ultimate-member' ) ); ?></label>
<input type="checkbox" name="_force_confirm_pass" id="_force_confirm_pass" value="1" <?php checked( isset( $this->edit_mode_value ) ? $this->edit_mode_value : 0 ) ?> />
</p>
@@ -1701,12 +1660,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_style':
?>
<p><label for="_style">Style <?php UM()->tooltip( __( 'This is the line-style of divider', 'ultimate-member' ) ); ?></label>
<p><label for="_style"><?php _e( 'Style', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the line-style of divider', 'ultimate-member' ) ); ?></label>
<select name="_style" id="_style" style="width: 100%">
<option value="solid" <?php selected( 'solid', $this->edit_mode_value ); ?>>Solid</option>
<option value="dotted" <?php selected( 'dotted', $this->edit_mode_value ); ?>>Dotted</option>
<option value="dashed" <?php selected( 'dashed', $this->edit_mode_value ); ?>>Dashed</option>
<option value="double" <?php selected( 'double', $this->edit_mode_value ); ?>>Double</option>
<option value="solid" <?php selected( 'solid', $this->edit_mode_value ); ?>><?php _e( 'Solid', 'ultimate-member' ) ?></option>
<option value="dotted" <?php selected( 'dotted', $this->edit_mode_value ); ?>><?php _e( 'Dotted', 'ultimate-member' ) ?></option>
<option value="dashed" <?php selected( 'dashed', $this->edit_mode_value ); ?>><?php _e( 'Dashed', 'ultimate-member' ) ?></option>
<option value="double" <?php selected( 'double', $this->edit_mode_value ); ?>><?php _e( 'Double', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1717,8 +1676,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p><label for="_intervals">Time Intervals (in minutes) <?php UM()->tooltip( __( 'Choose the minutes interval between each time in the time picker.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_intervals" id="_intervals" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 60; ?>" placeholder="e.g. 30, 60, 120" />
<p><label for="_intervals"><?php _e( 'Time Intervals (in minutes)', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Choose the minutes interval between each time in the time picker.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_intervals" id="_intervals" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 60; ?>" placeholder="<?php esc_attr_e( 'e.g. 30, 60, 120', 'ultimate-member' ) ?>" />
</p>
<?php
@@ -1730,7 +1689,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
if ( $this->set_field_type == 'date' ) {
?>
<p><label for="_format">Date User-Friendly Format <?php UM()->tooltip( __( 'The display format of the date which is visible to user.', 'ultimate-member' ) ); ?></label>
<p><label for="_format"><?php _e( 'Date User-Friendly Format', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The display format of the date which is visible to user.', 'ultimate-member' ) ); ?></label>
<select name="_format" id="_format" style="width: 100%">
<option value="j M Y" <?php selected( 'j M Y', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('j M Y'); ?></option>
<option value="M j Y" <?php selected( 'M j Y', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('M j Y'); ?></option>
@@ -1741,11 +1700,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
<?php } else { ?>
<p><label for="_format">Time Format <?php UM()->tooltip( __( 'Choose the displayed time-format for this field', 'ultimate-member' ) ); ?></label>
<p><label for="_format"><?php _e( 'Time Format', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Choose the displayed time-format for this field', 'ultimate-member' ) ); ?></label>
<select name="_format" id="_format" style="width: 100%">
<option value="g:i a" <?php selected( 'g:i a', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('g:i a'); ?> ( 12-hr format )</option>
<option value="g:i A" <?php selected( 'g:i A', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('g:i A'); ?> ( 12-hr format )</option>
<option value="H:i" <?php selected( 'H:i', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('H:i'); ?> ( 24-hr format )</option>
<option value="g:i a" <?php selected( 'g:i a', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('g:i a'); ?><?php _e( '( 12-hr format )', 'ultimate-member' ) ?></option>
<option value="g:i A" <?php selected( 'g:i A', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('g:i A'); ?><?php _e( '( 12-hr format )', 'ultimate-member' ) ?></option>
<option value="H:i" <?php selected( 'H:i', $this->edit_mode_value ); ?>><?php echo UM()->datetime()->get_time('H:i'); ?><?php _e( '( 24-hr format )', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1756,10 +1715,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_pretty_format':
?>
<p><label for="_pretty_format">Displayed Date Format <?php UM()->tooltip( __( 'Whether you wish to show the date in full or only show the years e.g. 25 Years', 'ultimate-member' ) ); ?></label>
<p><label for="_pretty_format"><?php _e( 'Displayed Date Format', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Whether you wish to show the date in full or only show the years e.g. 25 Years', 'ultimate-member' ) ); ?></label>
<select name="_pretty_format" id="_pretty_format" style="width: 100%">
<option value="0" <?php selected( 0, $this->edit_mode_value ); ?>>Show full date</option>
<option value="1" <?php selected( 1, $this->edit_mode_value ); ?>>Show years only</option>
<option value="0" <?php selected( 0, $this->edit_mode_value ); ?>><?php _e( 'Show full date', 'ultimate-member' ) ?></option>
<option value="1" <?php selected( 1, $this->edit_mode_value ); ?>><?php _e( 'Show years only', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1775,15 +1734,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
}
?>
<p><label for="_disabled_weekdays">Disable specific weekdays <?php UM()->tooltip( __( 'Disable specific week days from being available for selection in this date picker', 'ultimate-member' ) ); ?></label>
<p><label for="_disabled_weekdays"><?php _e( 'Disable specific weekdays', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Disable specific week days from being available for selection in this date picker', 'ultimate-member' ) ); ?></label>
<select name="_disabled_weekdays[]" id="_disabled_weekdays" multiple="multiple" style="width: 100%">
<option value="1" <?php if ( in_array( 1, $values ) ) { echo 'selected'; } ?>>Sunday</option>
<option value="2" <?php if ( in_array( 2, $values ) ) { echo 'selected'; } ?>>Monday</option>
<option value="3" <?php if ( in_array( 3, $values ) ) { echo 'selected'; } ?>>Tuesday</option>
<option value="4" <?php if ( in_array( 4, $values ) ) { echo 'selected'; } ?>>Wednesday</option>
<option value="5" <?php if ( in_array( 5, $values ) ) { echo 'selected'; } ?>>Thursday</option>
<option value="6" <?php if ( in_array( 6, $values ) ) { echo 'selected'; } ?>>Friday</option>
<option value="7" <?php if ( in_array( 7, $values ) ) { echo 'selected'; } ?>>Saturday</option>
<option value="1" <?php if ( in_array( 1, $values ) ) { echo 'selected'; } ?>><?php _e( 'Sunday', 'ultimate-member' ) ?></option>
<option value="2" <?php if ( in_array( 2, $values ) ) { echo 'selected'; } ?>><?php _e( 'Monday', 'ultimate-member' ) ?></option>
<option value="3" <?php if ( in_array( 3, $values ) ) { echo 'selected'; } ?>><?php _e( 'Tuesday', 'ultimate-member' ) ?></option>
<option value="4" <?php if ( in_array( 4, $values ) ) { echo 'selected'; } ?>><?php _e( 'Wednesday', 'ultimate-member' ) ?></option>
<option value="5" <?php if ( in_array( 5, $values ) ) { echo 'selected'; } ?>><?php _e( 'Thursday', 'ultimate-member' ) ?></option>
<option value="6" <?php if ( in_array( 6, $values ) ) { echo 'selected'; } ?>><?php _e( 'Friday', 'ultimate-member' ) ?></option>
<option value="7" <?php if ( in_array( 7, $values ) ) { echo 'selected'; } ?>><?php _e( 'Saturday', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1793,7 +1752,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_years':
?>
<p class="_years"><label for="_years">Number of Years to pick from <?php UM()->tooltip( __( 'Number of years available for the date selection. Default to last 50 years', 'ultimate-member' ) ); ?></label>
<p class="_years"><label for="_years"><?php _e( 'Number of Years to pick from', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Number of years available for the date selection. Default to last 50 years', 'ultimate-member' ) ); ?></label>
<input type="text" name="_years" id="_years" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 50; ?>" />
</p>
@@ -1803,11 +1762,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_years_x':
?>
<p class="_years"><label for="_years_x">Years Selection <?php UM()->tooltip( __( 'This decides which years should be shown relative to today date', 'ultimate-member' ) ); ?></label>
<p class="_years"><label for="_years_x"><?php _e( 'Years Selection', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This decides which years should be shown relative to today date', 'ultimate-member' ) ); ?></label>
<select name="_years_x" id="_years_x" style="width: 100%">
<option value="equal" <?php selected( 'equal', $this->edit_mode_value ); ?>>Equal years before / after today</option>
<option value="past" <?php selected( 'past', $this->edit_mode_value ); ?>>Past years only</option>
<option value="future" <?php selected( 'future', $this->edit_mode_value ); ?>>Future years only</option>
<option value="equal" <?php selected( 'equal', $this->edit_mode_value ); ?>><?php _e( 'Equal years before / after today', 'ultimate-member' ) ?></option>
<option value="past" <?php selected( 'past', $this->edit_mode_value ); ?>><?php _e( 'Past years only', 'ultimate-member' ) ?></option>
<option value="future" <?php selected( 'future', $this->edit_mode_value ); ?>><?php _e( 'Future years only', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1817,8 +1776,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_range_start':
?>
<p class="_date_range"><label for="_range_start">Date Range Start <?php UM()->tooltip( __( 'Set the minimum date/day in range in the format YYYY/MM/DD', 'ultimate-member' ) ); ?></label>
<input type="text" name="_range_start" id="_range_start" value="<?php echo $this->edit_mode_value; ?>" placeholder="YYYY/MM/DD" />
<p class="_date_range"><label for="_range_start"><?php _e( 'Date Range Start', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Set the minimum date/day in range in the format YYYY/MM/DD', 'ultimate-member' ) ); ?></label>
<input type="text" name="_range_start" id="_range_start" value="<?php echo $this->edit_mode_value; ?>" placeholder="<?php esc_attr_e( 'YYYY/MM/DD', 'ultimate-member' ) ?>" />
</p>
<?php
@@ -1827,8 +1786,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_range_end':
?>
<p class="_date_range"><label for="_range_end">Date Range End <?php UM()->tooltip( __( 'Set the maximum date/day in range in the format YYYY/MM/DD', 'ultimate-member' ) ); ?></label>
<input type="text" name="_range_end" id="_range_end" value="<?php echo $this->edit_mode_value; ?>" placeholder="YYYY/MM/DD" />
<p class="_date_range"><label for="_range_end"><?php _e( 'Date Range End', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Set the maximum date/day in range in the format YYYY/MM/DD', 'ultimate-member' ) ); ?></label>
<input type="text" name="_range_end" id="_range_end" value="<?php echo $this->edit_mode_value; ?>" placeholder="<?php esc_attr_e( 'YYYY/MM/DD', 'ultimate-member' ) ?>" />
</p>
<?php
@@ -1837,10 +1796,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_range':
?>
<p><label for="_range">Set Date Range <?php UM()->tooltip( __( 'Whether to show a specific number of years or specify a date range to be available for the date picker.', 'ultimate-member' ) ); ?></label>
<p><label for="_range"><?php _e( 'Set Date Range', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Whether to show a specific number of years or specify a date range to be available for the date picker.', 'ultimate-member' ) ); ?></label>
<select name="_range" id="_range" class="um-adm-conditional" data-cond1='years' data-cond1-show='_years' data-cond2="date_range" data-cond2-show="_date_range" style="width: 100%">
<option value="years" <?php selected( 'years', $this->edit_mode_value ); ?>>Fixed Number of Years</option>
<option value="date_range" <?php selected( 'date_range', $this->edit_mode_value ); ?>>Specific Date Range</option>
<option value="years" <?php selected( 'years', $this->edit_mode_value ); ?>><?php _e( 'Fixed Number of Years', 'ultimate-member' ) ?></option>
<option value="date_range" <?php selected( 'date_range', $this->edit_mode_value ); ?>><?php _e( 'Specific Date Range', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1853,8 +1812,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p><label for="_content">Enter Shortcode <?php UM()->tooltip( __( 'Enter the shortcode in the following textarea and it will be displayed on the fields', 'ultimate-member' ) ); ?></label>
<textarea name="_content" id="_content" placeholder="e.g. [my_custom_shortcode]"><?php echo $this->edit_mode_value; ?></textarea>
<p><label for="_content"><?php _e( 'Enter Shortcode', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enter the shortcode in the following textarea and it will be displayed on the fields', 'ultimate-member' ) ); ?></label>
<textarea name="_content" id="_content" placeholder="<?php esc_attr_e( 'e.g. [my_custom_shortcode]', 'ultimate-member' ) ?>"><?php echo $this->edit_mode_value; ?></textarea>
</p>
<?php
@@ -1863,7 +1822,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<div class="um-admin-editor-h"><label>Content Editor <?php UM()->tooltip( __( 'Edit the content of this field here', 'ultimate-member' ) ); ?></label></div>
<div class="um-admin-editor-h"><label><?php _e( 'Content Editor', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Edit the content of this field here', 'ultimate-member' ) ); ?></label></div>
<div class="um-admin-editor"><!-- editor dynamically loaded here --></div>
@@ -1876,11 +1835,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_crop':
?>
<p><label for="_crop">Crop Feature <?php UM()->tooltip( __( 'Enable/disable crop feature for this image upload and define ratio', 'ultimate-member' ) ); ?></label>
<p><label for="_crop"><?php _e( 'Crop Feature', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enable/disable crop feature for this image upload and define ratio', 'ultimate-member' ) ); ?></label>
<select name="_crop" id="_crop" style="width: 100%">
<option value="0" <?php selected( '0', $this->edit_mode_value ); ?>>Turn Off (Default)</option>
<option value="1" <?php selected( '1', $this->edit_mode_value ); ?>>Crop and force 1:1 ratio</option>
<option value="3" <?php selected( '3', $this->edit_mode_value ); ?>>Crop and force user-defined ratio</option>
<option value="0" <?php selected( '0', $this->edit_mode_value ); ?>><?php _e( 'Turn Off (Default)', 'ultimate-member' ) ?></option>
<option value="1" <?php selected( '1', $this->edit_mode_value ); ?>><?php _e( 'Crop and force 1:1 ratio', 'ultimate-member' ) ?></option>
<option value="3" <?php selected( '3', $this->edit_mode_value ); ?>><?php _e( 'Crop and force user-defined ratio', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -1894,11 +1853,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
if ( isset( $this->edit_mode_value ) && is_array( $this->edit_mode_value ) ) {
$values = $this->edit_mode_value;
} else {
$values = array('png','jpeg','jpg','gif');
}
?>
$values = array( 'png','jpeg','jpg','gif' );
} ?>
<p><label for="_allowed_types">Allowed Image Types <?php UM()->tooltip( __( 'Select the image types that you want to allow to be uploaded via this field.', 'ultimate-member' ) ); ?></label>
<p><label for="_allowed_types"><?php _e( 'Allowed Image Types', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select the image types that you want to allow to be uploaded via this field.', 'ultimate-member' ) ); ?></label>
<select name="_allowed_types[]" id="_allowed_types" multiple="multiple" style="width: 100%">
<?php foreach( UM()->files()->allowed_image_types() as $e => $n ) { ?>
<option value="<?php echo $e; ?>" <?php if ( in_array( $e, $values ) ) { echo 'selected'; } ?>><?php echo $n; ?></option>
@@ -1913,12 +1871,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
if ( isset( $this->edit_mode_value ) && is_array( $this->edit_mode_value ) ) {
$values = $this->edit_mode_value;
} else {
$values = array('pdf','txt');
}
$values = array( 'pdf', 'txt' );
} ?>
?>
<p><label for="_allowed_types">Allowed File Types <?php UM()->tooltip( __( 'Select the image types that you want to allow to be uploaded via this field.', 'ultimate-member' ) ); ?></label>
<p><label for="_allowed_types"><?php _e( 'Allowed File Types', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select the image types that you want to allow to be uploaded via this field.', 'ultimate-member' ) ); ?></label>
<select name="_allowed_types[]" id="_allowed_types" multiple="multiple" style="width: 100%">
<?php foreach( UM()->files()->allowed_file_types() as $e => $n ) { ?>
<option value="<?php echo $e; ?>" <?php if ( in_array( $e, $values ) ) { echo 'selected'; } ?>><?php echo $n; ?></option>
@@ -1934,12 +1890,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_upload_text':
if ( $this->set_field_type == 'image' ) $value = 'Drag &amp; Drop Photo';
if ( $this->set_field_type == 'file' ) $value = 'Drag &amp; Drop File';
if ( $this->set_field_type == 'image' ) {
$value = __( 'Drag &amp; Drop Photo', 'ultimate-member' );
}
if ( $this->set_field_type == 'file' ) {
$value = __( 'Drag &amp; Drop File', 'ultimate-member' );
}
?>
<p><label for="_upload_text">Upload Box Text <?php UM()->tooltip( __( 'This is the headline that appears in the upload box for this field', 'ultimate-member' ) ); ?></label>
<p><label for="_upload_text"><?php _e( 'Upload Box Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the headline that appears in the upload box for this field', 'ultimate-member' ) ); ?></label>
<input type="text" name="_upload_text" id="_upload_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : $value; ?>" />
</p>
@@ -1949,7 +1909,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_upload_help_text':
?>
<p><label for="_upload_help_text">Additional Instructions Text <?php UM()->tooltip( __( 'If you need to add information or secondary line below the headline of upload box, enter it here', 'ultimate-member' ) ); ?></label>
<p><label for="_upload_help_text"><?php _e( 'Additional Instructions Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'If you need to add information or secondary line below the headline of upload box, enter it here', 'ultimate-member' ) ); ?></label>
<input type="text" name="_upload_help_text" id="_upload_help_text" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -1959,8 +1919,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_button_text':
?>
<p><label for="_button_text">Upload Box Text <?php UM()->tooltip( __( 'The text that appears on the button. e.g. Upload', 'ultimate-member' ) ); ?></label>
<input type="text" name="_button_text" id="_button_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 'Upload'; ?>" />
<p><label for="_button_text"><?php _e( 'Upload Box Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The text that appears on the button. e.g. Upload', 'ultimate-member' ) ); ?></label>
<input type="text" name="_button_text" id="_button_text" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : __( 'Upload', 'ultimate-member' ); ?>" />
</p>
<?php
@@ -1969,7 +1929,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max_size':
?>
<p><label for="_max_size">Maximum Size in bytes <?php UM()->tooltip( __( 'The maximum size for image that can be uploaded through this field. Leave empty for unlimited size.', 'ultimate-member' ) ); ?></label>
<p><label for="_max_size"><?php _e( 'Maximum Size in bytes', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The maximum size for image that can be uploaded through this field. Leave empty for unlimited size.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max_size" id="_max_size" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -1979,7 +1939,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_height':
?>
<p><label for="_height">Textarea Height <?php UM()->tooltip( __( 'The height of textarea in pixels. Default is 100 pixels', 'ultimate-member' ) ); ?></label>
<p><label for="_height"><?php _e( 'Textarea Height', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The height of textarea in pixels. Default is 100 pixels', 'ultimate-member' ) ); ?></label>
<input type="text" name="_height" id="_height" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '100px'; ?>" />
</p>
@@ -1989,7 +1949,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_spacing':
?>
<p><label for="_spacing">Spacing <?php UM()->tooltip( __( 'This is the required spacing in pixels. e.g. 20px', 'ultimate-member' ) ); ?></label>
<p><label for="_spacing"><?php _e( 'Spacing', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the required spacing in pixels. e.g. 20px', 'ultimate-member' ) ); ?></label>
<input type="text" name="_spacing" id="_spacing" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : '20px'; ?>" />
</p>
@@ -1999,7 +1959,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_is_multi':
?>
<p><label for="_is_multi">Allow multiple selections <?php UM()->tooltip( __( 'Enable/disable multiple selections for this field', 'ultimate-member' ) ); ?></label>
<p><label for="_is_multi"><?php _e( 'Allow multiple selections', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enable/disable multiple selections for this field', 'ultimate-member' ) ); ?></label>
<input type="checkbox" name="_is_multi" id="_is_multi" value="1" <?php checked( isset( $this->edit_mode_value ) ? $this->edit_mode_value : 0 ) ?> class="um-adm-conditional" data-cond1="1" data-cond1-show="_max_selections" data-cond1-hide="xxx" />
</p>
@@ -2009,7 +1969,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max_selections':
?>
<p class="_max_selections"><label for="_max_selections">Maximum number of selections <?php UM()->tooltip( __( 'Enter a number here to force a maximum number of selections by user for this field', 'ultimate-member' ) ); ?></label>
<p class="_max_selections"><label for="_max_selections"><?php _e( 'Maximum number of selections', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enter a number here to force a maximum number of selections by user for this field', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max_selections" id="_max_selections" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2019,7 +1979,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_min_selections':
?>
<p class="_min_selections"><label for="_min_selections">Minimum number of selections <?php UM()->tooltip( __( 'Enter a number here to force a minimum number of selections by user for this field', 'ultimate-member' ) ); ?></label>
<p class="_min_selections"><label for="_min_selections"><?php _e( 'Minimum number of selections', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enter a number here to force a minimum number of selections by user for this field', 'ultimate-member' ) ); ?></label>
<input type="text" name="_min_selections" id="_min_selections" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2029,7 +1989,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max_entries':
?>
<p class="_max_entries"><label for="_max_selections">Maximum number of entries <?php UM()->tooltip( __( 'This is the max number of entries the user can add via field group.', 'ultimate-member' ) ); ?></label>
<p class="_max_entries"><label for="_max_selections"><?php _e( 'Maximum number of entries', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the max number of entries the user can add via field group.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max_entries" id="_max_entries" value="<?php echo ( $this->edit_mode_value ) ? $this->edit_mode_value : 10; ?>" />
</p>
@@ -2039,7 +1999,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max_words':
?>
<p><label for="_max_words">Maximum allowed words <?php UM()->tooltip( __( 'If you want to enable a maximum number of words to be input in this textarea. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<p><label for="_max_words"><?php _e( 'Maximum allowed words', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'If you want to enable a maximum number of words to be input in this textarea. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max_words" id="_max_words" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2049,7 +2009,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_min':
?>
<p><label for="_min">Minimum Number <?php UM()->tooltip( __( 'Minimum number that can be entered in this field', 'ultimate-member' ) ); ?></label>
<p><label for="_min"><?php _e( 'Minimum Number', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Minimum number that can be entered in this field', 'ultimate-member' ) ); ?></label>
<input type="text" name="_min" id="_min" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2059,7 +2019,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max':
?>
<p><label for="_max">Maximum Number <?php UM()->tooltip( __( 'Maximum number that can be entered in this field', 'ultimate-member' ) ); ?></label>
<p><label for="_max"><?php _e( 'Maximum Number', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Maximum number that can be entered in this field', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max" id="_max" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2069,7 +2029,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_min_chars':
?>
<p><label for="_min_chars">Minimum length <?php UM()->tooltip( __( 'If you want to enable a minimum number of characters to be input in this field. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<p><label for="_min_chars"><?php _e( 'Minimum length', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'If you want to enable a minimum number of characters to be input in this field. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<input type="text" name="_min_chars" id="_min_chars" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2079,7 +2039,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_max_chars':
?>
<p><label for="_max_chars">Maximum length <?php UM()->tooltip( __( 'If you want to enable a maximum number of characters to be input in this field. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<p><label for="_max_chars"><?php _e( 'Maximum length', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'If you want to enable a maximum number of characters to be input in this field. Leave empty to disable this setting', 'ultimate-member' ) ); ?></label>
<input type="text" name="_max_chars" id="_max_chars" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2089,7 +2049,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_html':
?>
<p><label for="_html">Does this textarea accept HTML? <?php UM()->tooltip( __( 'Turn on/off HTML tags for this textarea', 'ultimate-member' ) ); ?></label>
<p><label for="_html"><?php _e( 'Does this textarea accept HTML?', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Turn on/off HTML tags for this textarea', 'ultimate-member' ) ); ?></label>
<input type="checkbox" name="_html" id="_html" value="1" <?php checked( isset( $this->edit_mode_value ) ? $this->edit_mode_value : 0 ) ?> />
</p>
@@ -2104,11 +2064,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$values = $this->edit_mode_value;
} else {
$values = '';
}
} ?>
?>
<p><label for="_options">Edit Choices <?php UM()->tooltip( __( 'Enter one choice per line. This will represent the available choices or selections available for user.', 'ultimate-member' ) ); ?></label>
<p><label for="_options"><?php _e( 'Edit Choices', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Enter one choice per line. This will represent the available choices or selections available for user.', 'ultimate-member' ) ); ?></label>
<textarea name="_options" id="_options"><?php echo $values; ?></textarea>
</p>
@@ -2118,8 +2076,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_title':
?>
<p><label for="_title">Title <?php UM()->tooltip( __( 'This is the title of the field for your reference in the backend. The title will not appear on the front-end of your website.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_title" id="_title" value="<?php echo htmlspecialchars($this->edit_mode_value, ENT_QUOTES); ?>" />
<p><label for="_title"><?php _e( 'Title', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the title of the field for your reference in the backend. The title will not appear on the front-end of your website.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_title" id="_title" value="<?php echo htmlspecialchars( $this->edit_mode_value, ENT_QUOTES ); ?>" />
</p>
<?php
@@ -2129,7 +2087,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p style="display:none"><label for="_id">Unique ID</label>
<p style="display:none"><label for="_id"><?php _e( 'Unique ID', 'ultimate-member' ) ?></label>
<input type="text" name="_id" id="_id" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2143,13 +2101,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p><label for="_metakey">Meta Key <?php UM()->tooltip( __( 'The meta key cannot be changed for duplicated fields or when editing an existing field. If you require a different meta key please create a new field.', 'ultimate-member' ) ); ?></label>
<p><label for="_metakey"><?php _e( 'Meta Key', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The meta key cannot be changed for duplicated fields or when editing an existing field. If you require a different meta key please create a new field.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_metakey_locked" id="_metakey_locked" value="<?php echo $this->edit_mode_value; ?>" disabled />
</p>
<?php } else { ?>
<p><label for="_metakey">Meta Key <?php UM()->tooltip( __( 'A meta key is required to store the entered info in this field in the database. The meta key should be unique to this field and be written in lowercase with an underscore ( _ ) separating words e.g country_list or job_title', 'ultimate-member' ) ); ?></label>
<p><label for="_metakey"><?php _e( 'Meta Key', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'A meta key is required to store the entered info in this field in the database. The meta key should be unique to this field and be written in lowercase with an underscore ( _ ) separating words e.g country_list or job_title', 'ultimate-member' ) ); ?></label>
<input type="text" name="_metakey" id="_metakey" value="" />
</p>
@@ -2162,7 +2120,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_help':
?>
<p><label for="_help">Help Text <?php UM()->tooltip( __('This is the text that appears in a tooltip when a user hovers over the info icon. Help text is useful for providing users with more information about what they should enter in the field. Leave blank if no help text is needed for field.', 'ultimate-member' ) ); ?></label>
<p><label for="_help"><?php _e( 'Help Text', 'ultimate-member' ) ?> <?php UM()->tooltip( __('This is the text that appears in a tooltip when a user hovers over the info icon. Help text is useful for providing users with more information about what they should enter in the field. Leave blank if no help text is needed for field.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_help" id="_help" value="<?php echo $this->edit_mode_value; ?>" />
</p>
@@ -2210,8 +2168,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_label':
?>
<p><label for="_label">Label <?php UM()->tooltip( __( 'The field label is the text that appears above the field on your front-end form. Leave blank to not show a label above field.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_label" id="_label" value="<?php echo htmlspecialchars($this->edit_mode_value, ENT_QUOTES); ?>" />
<p><label for="_label"><?php _e( 'Label', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'The field label is the text that appears above the field on your front-end form. Leave blank to not show a label above field.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_label" id="_label" value="<?php echo htmlspecialchars( $this->edit_mode_value, ENT_QUOTES ); ?>" />
</p>
<?php
@@ -2220,8 +2178,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_placeholder':
?>
<p><label for="_placeholder">Placeholder <?php UM()->tooltip( __( 'This is the text that appears within the field e.g please enter your email address. Leave blank to not show any placeholder text.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_placeholder" id="_placeholder" value="<?php echo htmlspecialchars($this->edit_mode_value, ENT_QUOTES); ?>" />
<p><label for="_placeholder"><?php _e( 'Placeholder', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This is the text that appears within the field e.g please enter your email address. Leave blank to not show any placeholder text.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_placeholder" id="_placeholder" value="<?php echo htmlspecialchars( $this->edit_mode_value, ENT_QUOTES ); ?>" />
</p>
<?php
@@ -2230,13 +2188,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_public':
?>
<p><label for="_public">Privacy <?php UM()->tooltip( __( 'Field privacy allows you to select who can view this field on the front-end. The site admin can view all fields regardless of the option set here.', 'ultimate-member' ) ); ?></label>
<p><label for="_public"><?php _e( 'Privacy', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Field privacy allows you to select who can view this field on the front-end. The site admin can view all fields regardless of the option set here.', 'ultimate-member' ) ); ?></label>
<select name="_public" id="_public" class="um-adm-conditional" data-cond1='-2' data-cond1-show='_roles' data-cond2='-3' data-cond2-show='_roles' style="width: 100%">
<option value="1" <?php selected( 1, $this->edit_mode_value ); ?>>Everyone</option>
<option value="2" <?php selected( 2, $this->edit_mode_value ); ?>>Members</option>
<option value="-1" <?php selected( -1, $this->edit_mode_value ); ?>>Only visible to profile owner and admins</option>
<option value="-3" <?php selected( -3, $this->edit_mode_value ); ?>>Only visible to profile owner and specific roles</option>
<option value="-2" <?php selected( -2, $this->edit_mode_value ); ?>>Only specific member roles</option>
<option value="1" <?php selected( 1, $this->edit_mode_value ); ?>><?php _e( 'Everyone', 'ultimate-member' ) ?></option>
<option value="2" <?php selected( 2, $this->edit_mode_value ); ?>><?php _e( 'Members', 'ultimate-member' ) ?></option>
<option value="-1" <?php selected( -1, $this->edit_mode_value ); ?>><?php _e( 'Only visible to profile owner and admins', 'ultimate-member' ) ?></option>
<option value="-3" <?php selected( -3, $this->edit_mode_value ); ?>><?php _e( 'Only visible to profile owner and specific roles', 'ultimate-member' ) ?></option>
<option value="-2" <?php selected( -2, $this->edit_mode_value ); ?>><?php _e( 'Only specific member roles', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -2253,10 +2211,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
?>
<p class="_roles"><label for="_roles">Select member roles <?php UM()->tooltip( __( 'Select the member roles that can view this field on the front-end.', 'ultimate-member' ) ); ?></label>
<p class="_roles"><label for="_roles"><?php _e( 'Select member roles', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Select the member roles that can view this field on the front-end.', 'ultimate-member' ) ); ?></label>
<select name="_roles[]" id="_roles" style="width: 100%" multiple="multiple">
<?php foreach( UM()->roles()->get_roles() as $key => $value) { ?>
<?php foreach ( UM()->roles()->get_roles() as $key => $value) { ?>
<option value="<?php echo $key; ?>" <?php if ( in_array( $key, $values ) ) { echo 'selected'; } ?>><?php echo $value; ?></option>
@@ -2279,7 +2237,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
<div class="um-admin-tri">
<p><label for="_required">Is this field required? <?php UM()->tooltip( __( 'This option allows you to set whether the field must be filled in before the form can be processed.', 'ultimate-member' ) ); ?></label>
<p><label for="_required"><?php _e( 'Is this field required?', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This option allows you to set whether the field must be filled in before the form can be processed.', 'ultimate-member' ) ); ?></label>
<input type="checkbox" name="_required" id="_required" value="1" <?php checked( isset( $this->edit_mode_value ) ? $this->edit_mode_value : $def_required ) ?> />
</p>
@@ -2293,7 +2251,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
<div class="um-admin-tri">
<p><label for="_editable">Can user edit this field? <?php UM()->tooltip( __( 'This option allows you to set whether or not the user can edit the information in this field.', 'ultimate-member' ) ); ?></label>
<p><label for="_editable"><?php _e( 'Can user edit this field?', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'This option allows you to set whether or not the user can edit the information in this field.', 'ultimate-member' ) ); ?></label>
<input type="hidden" name="_editable" id="_editable_hidden" value="0" />
<input type="checkbox" name="_editable" id="_editable" value="1" <?php checked( null === $this->edit_mode_value || $this->edit_mode_value ) ?> />
</p>
@@ -2306,10 +2264,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_number':
?>
<p><label for="_number">Rating System <?php UM()->tooltip( __( 'Choose whether you want a 5-stars or 10-stars ratings based here.', 'ultimate-member' ) ); ?></label>
<p><label for="_number"><?php _e( 'Rating System', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Choose whether you want a 5-stars or 10-stars ratings based here.', 'ultimate-member' ) ); ?></label>
<select name="_number" id="_number" style="width: 100%">
<option value="5" <?php selected( 5, $this->edit_mode_value ); ?>>5 stars rating system</option>
<option value="10" <?php selected( 10, $this->edit_mode_value ); ?>>10 stars rating system</option>
<option value="5" <?php selected( 5, $this->edit_mode_value ); ?>><?php _e( '5 stars rating system', 'ultimate-member' ) ?></option>
<option value="10" <?php selected( 10, $this->edit_mode_value ); ?>><?php _e( '10 stars rating system', 'ultimate-member' ) ?></option>
</select>
</p>
@@ -2319,7 +2277,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
case '_custom_dropdown_options_source':
?>
<p><label for="_custom_dropdown_options_source">Choices Callback<?php UM()->tooltip( __( 'Add a callback source to retrieve choices.', 'ultimate-member' ) ); ?></label>
<p><label for="_custom_dropdown_options_source"><?php _e( 'Choices Callback', 'ultimate-member' ) ?> <?php UM()->tooltip( __( 'Add a callback source to retrieve choices.', 'ultimate-member' ) ); ?></label>
<input type="text" name="_custom_dropdown_options_source" id="_custom_dropdown_options_source" value="<?php echo htmlspecialchars($this->edit_mode_value, ENT_QUOTES); ?>" />
</p>
+8 -4
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
@@ -34,6 +35,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
/**
*
*/
function create_list() {
$this->old_extensions_notice();
$this->install_core_page_notice();
@@ -195,7 +199,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
ob_start(); ?>
<div class="<?php echo esc_attr( $class ) ?> um-admin-notice notice <?php echo $dismissible ? 'is-dismissible' : '' ?>" data-key="<?php echo $key ?>">
<div class="<?php echo esc_attr( $class ) ?> um-admin-notice notice <?php echo $dismissible ? 'is-dismissible' : '' ?>" data-key="<?php echo esc_attr( $key ) ?>">
<?php echo ! empty( $notice_data['message'] ) ? $notice_data['message'] : '' ?>
</div>
@@ -301,7 +305,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
</p>
<p>
<a href="<?php echo esc_attr( add_query_arg( 'um_adm_action', 'install_core_pages' ) ); ?>" class="button button-primary"><?php _e( 'Create Pages', 'ultimate-member' ) ?></a>
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'install_core_pages' ) ); ?>" class="button button-primary"><?php _e( 'Create Pages', 'ultimate-member' ) ?></a>
&nbsp;
<a href="javascript:void(0);" class="button-secondary um_secondary_dimiss"><?php _e( 'No thanks', 'ultimate-member' ) ?></a>
</p>
@@ -384,7 +388,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
}
$ignore = admin_url('users.php');
$ignore = admin_url( 'users.php' );
$messages[0]['err_content'] = sprintf( __( 'Are you sure you want to delete the selected user(s)? The following users will be deleted: <p>%s</p> <strong>This cannot be undone!</strong>','ultimate-member'), $users);
$messages[0]['err_content'] .= '<p><a href="'. esc_html( $confirm_uri ) .'" class="button-primary">' . __( 'Remove', 'ultimate-member' ) . '</a>&nbsp;&nbsp;<a href="'.$ignore.'" class="button">' . __('Undo','ultimate-member') . '</a></p>';
+220 -219
View File
@@ -2,7 +2,6 @@
namespace um\admin\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
@@ -87,10 +86,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
function init_variables() {
$general_pages_fields = array(
array(
'id' => 'pages_settings',
'type' => 'hidden',
'default' => true,
'is_option' => false
'id' => 'pages_settings',
'type' => 'hidden',
'default' => true,
'is_option' => false
)
);
@@ -104,21 +103,21 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
if ( 'reached_maximum_limit' == $have_pages ) {
$general_pages_fields[] = array(
'id' => $page_id,
'type' => 'text',
'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
'placeholder' => __('Add page ID','ultimate-member'),
'compiler' => true,
'id' => $page_id,
'type' => 'text',
'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
'placeholder' => __( 'Add page ID', 'ultimate-member' ),
'compiler' => true,
'size' => 'small'
);
} else {
$general_pages_fields[] = array(
'id' => $page_id,
'type' => 'select',
'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
'options' => UM()->query()->wp_pages(),
'placeholder' => __('Choose a page...','ultimate-member'),
'compiler' => true,
'id' => $page_id,
'type' => 'select',
'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
'options' => UM()->query()->wp_pages(),
'placeholder' => __( 'Choose a page...', 'ultimate-member' ),
'compiler' => true,
'size' => 'small'
);
}
@@ -129,7 +128,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
array(
'id' => 'profile_menu',
'type' => 'checkbox',
'label' => __('Enable profile menu','ultimate-member'),
'label' => __( 'Enable profile menu', 'ultimate-member' ),
)
);
@@ -181,10 +180,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'id' => 'profile_tab_' . $id . '_roles',
'type' => 'select',
'multi' => true,
'label' => __( 'Allowed roles','ultimate-member' ),
'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ),
'label' => __( 'Allowed roles', 'ultimate-member' ),
'tooltip' => __( 'Select the the user roles allowed to view this tab.', 'ultimate-member' ),
'options' => UM()->roles()->get_roles(),
'placeholder' => __( 'Choose user roles...','ultimate-member' ),
'placeholder' => __( 'Choose user roles...', 'ultimate-member' ),
'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ),
'size' => 'small'
)
@@ -259,57 +258,58 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$access_fields = array(
array(
'id' => 'accessible',
'type' => 'select',
'label' => __( 'Global Site Access','ultimate-member' ),
'tooltip' => __('Globally control the access of your site, you can have seperate restrict options per post/page by editing the desired item.','ultimate-member'),
'options' => array(
0 => 'Site accessible to Everyone',
2 => 'Site accessible to Logged In Users'
'id' => 'accessible',
'type' => 'select',
'label' => __( 'Global Site Access', 'ultimate-member' ),
'tooltip' => __( 'Globally control the access of your site, you can have seperate restrict options per post/page by editing the desired item.', 'ultimate-member' ),
'options' => array(
0 => __( 'Site accessible to Everyone', 'ultimate-member' ),
2 => __( 'Site accessible to Logged In Users', 'ultimate-member' ),
),
'size' => 'medium'
'size' => 'medium',
),
array(
'id' => 'access_redirect',
'type' => 'text',
'label' => __( 'Custom Redirect URL','ultimate-member' ),
'tooltip' => __('A logged out user will be redirected to this url If he is not permitted to access the site','ultimate-member'),
'conditional' => array( 'accessible', '=', 2 ),
'id' => 'access_redirect',
'type' => 'text',
'label' => __( 'Custom Redirect URL', 'ultimate-member' ),
'tooltip' => __( 'A logged out user will be redirected to this url If he is not permitted to access the site', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
),
array(
'id' => 'access_exclude_uris',
'type' => 'multi_text',
'label' => __( 'Exclude the following URLs','ultimate-member' ),
'tooltip' => __( 'Here you can exclude URLs beside the redirect URI to be accessible to everyone','ultimate-member' ),
'add_text' => __('Add New URL','ultimate-member'),
'conditional' => array( 'accessible', '=', 2 ),
'show_default_number' => 1,
'id' => 'access_exclude_uris',
'type' => 'multi_text',
'label' => __( 'Exclude the following URLs', 'ultimate-member' ),
'tooltip' => __( 'Here you can exclude URLs beside the redirect URI to be accessible to everyone', 'ultimate-member' ),
'add_text' => __( 'Add New URL', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
'show_default_number' => 1,
),
array(
'id' => 'home_page_accessible',
'type' => 'checkbox',
'label' => __( 'Allow Homepage to be accessible','ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
'id' => 'home_page_accessible',
'type' => 'checkbox',
'label' => __( 'Allow Homepage to be accessible', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
),
array(
'id' => 'category_page_accessible',
'type' => 'checkbox',
'label' => __( 'Allow Category pages to be accessible','ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
'id' => 'category_page_accessible',
'type' => 'checkbox',
'label' => __( 'Allow Category pages to be accessible', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
),
array(
'id' => 'restricted_access_message',
'type' => 'wp_editor',
'label' => __( 'Restricted Access Message','ultimate-member' ),
'tooltip' => __( 'This is the message shown to users that do not have permission to view the content','ultimate-member' ),
'label' => __( 'Restricted Access Message', 'ultimate-member' ),
'tooltip' => __( 'This is the message shown to users that do not have permission to view the content', 'ultimate-member' ),
)
);
global $wp_version;
if ( version_compare( $wp_version, '5.0', '>=' ) ) {
$access_fields = array_merge( $access_fields, array( array(
'id' => 'restricted_blocks',
'type' => 'checkbox',
'label' => __( 'Allow Gutenberg Blocks restriction options', 'ultimate-member' ),
'id' => 'restricted_blocks',
'type' => 'checkbox',
'label' => __( 'Allow Gutenberg Blocks restriction options', 'ultimate-member' ),
),
array(
'id' => 'restricted_block_message',
@@ -319,35 +319,36 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'conditional' => array( 'restricted_blocks', '=', 1 ),
) ) );
}
$access_fields = array_merge( $access_fields, array( array(
'id' => 'restricted_access_post_metabox',
'type' => 'hidden',
'value' => '',
),
$access_fields = array_merge( $access_fields, array(
array(
'id' => 'restricted_access_taxonomy_metabox',
'type' => 'hidden',
'value' => '',
'id' => 'restricted_access_post_metabox',
'type' => 'hidden',
'value' => '',
),
array(
'id' => 'restricted_access_post_metabox',
'type' => 'multi_checkbox',
'label' => __( 'Restricted Access to Posts','ultimate-member' ),
'tooltip' => __( 'Restriction content of the current Posts','ultimate-member' ),
'options' => $post_types_options,
'columns' => 3,
'value' => $restricted_access_post_metabox_value,
'default' => UM()->options()->get_default( 'restricted_access_post_metabox' ),
'id' => 'restricted_access_taxonomy_metabox',
'type' => 'hidden',
'value' => '',
),
array(
'id' => 'restricted_access_taxonomy_metabox',
'type' => 'multi_checkbox',
'label' => __( 'Restricted Access to Taxonomies','ultimate-member' ),
'tooltip' => __( 'Restriction content of the current Taxonomies','ultimate-member' ),
'options' => $taxonomies_options,
'columns' => 3,
'value' => $restricted_access_taxonomy_metabox_value,
'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ),
'id' => 'restricted_access_post_metabox',
'type' => 'multi_checkbox',
'label' => __( 'Restricted Access to Posts', 'ultimate-member' ),
'tooltip' => __( 'Restriction content of the current Posts', 'ultimate-member' ),
'options' => $post_types_options,
'columns' => 3,
'value' => $restricted_access_post_metabox_value,
'default' => UM()->options()->get_default( 'restricted_access_post_metabox' ),
),
array(
'id' => 'restricted_access_taxonomy_metabox',
'type' => 'multi_checkbox',
'label' => __( 'Restricted Access to Taxonomies', 'ultimate-member' ),
'tooltip' => __( 'Restriction content of the current Taxonomies', 'ultimate-member' ),
'options' => $taxonomies_options,
'columns' => 3,
'value' => $restricted_access_taxonomy_metabox_value,
'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ),
) ) );
@@ -373,8 +374,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*/
$this->settings_structure = apply_filters( 'um_settings_structure', array(
'' => array(
'title' => __( 'General', 'ultimate-member' ),
'sections' => array(
'title' => __( 'General', 'ultimate-member' ),
'sections' => array(
'' => array(
'title' => __( 'Pages', 'ultimate-member' ),
'fields' => $general_pages_fields
@@ -383,19 +384,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'title' => __( 'Users', 'ultimate-member' ),
'fields' => array(
array(
'id' => 'permalink_base',
'type' => 'select',
'id' => 'permalink_base',
'type' => 'select',
'size' => 'small',
'label' => __( 'Profile Permalink Base','ultimate-member' ),
'tooltip' => __( 'Here you can control the permalink structure of the user profile URL globally e.g. ' . trailingslashit( um_get_core_page('user') ) . '<strong>username</strong>/','ultimate-member' ),
'options' => array(
'user_login' => __('Username','ultimate-member'),
'name' => __('First and Last Name with \'.\'','ultimate-member'),
'name_dash' => __('First and Last Name with \'-\'','ultimate-member'),
'name_plus' => __('First and Last Name with \'+\'','ultimate-member'),
'user_id' => __('User ID','ultimate-member'),
'label' => __( 'Profile Permalink Base','ultimate-member' ),
'tooltip' => __( 'Here you can control the permalink structure of the user profile URL globally e.g. ' . trailingslashit( um_get_core_page('user') ) . '<strong>username</strong>/','ultimate-member' ),
'options' => array(
'user_login' => __( 'Username', 'ultimate-member' ),
'name' => __( 'First and Last Name with \'.\'', 'ultimate-member' ),
'name_dash' => __( 'First and Last Name with \'-\'', 'ultimate-member' ),
'name_plus' => __( 'First and Last Name with \'+\'', 'ultimate-member' ),
'user_id' => __( 'User ID', 'ultimate-member' ),
),
'placeholder' => __('Select...','ultimate-member'),
'placeholder' => __( 'Select...', 'ultimate-member' ),
),
array(
'id' => 'display_name',
@@ -623,59 +624,59 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
)
),
'access' => array(
'title' => __( 'Access', 'ultimate-member' ),
'sections' => array(
'title' => __( 'Access', 'ultimate-member' ),
'sections' => array(
'' => array(
'title' => __( 'Restriction Content', 'ultimate-member' ),
'fields' => $access_fields
),
'other' => array(
'title' => __( 'Other', 'ultimate-member' ),
'fields' => array(
'fields' => array(
array(
'id' => 'enable_reset_password_limit',
'type' => 'checkbox',
'label' => __( 'Enable the Reset Password Limit?','ultimate-member' ),
'id' => 'enable_reset_password_limit',
'type' => 'checkbox',
'label' => __( 'Enable the Reset Password Limit?', 'ultimate-member' ),
),
array(
'id' => 'reset_password_limit_number',
'type' => 'text',
'label' => __( 'Reset Password Limit','ultimate-member' ),
'tooltip' => __('Set the maximum reset password limit. If reached the maximum limit, user will be locked from using this.','ultimate-member'),
'validate' => 'numeric',
'conditional' => array('enable_reset_password_limit','=',1),
'size' => 'um-small-field',
'id' => 'reset_password_limit_number',
'type' => 'text',
'label' => __( 'Reset Password Limit', 'ultimate-member' ),
'tooltip' => __( 'Set the maximum reset password limit. If reached the maximum limit, user will be locked from using this.', 'ultimate-member' ),
'validate' => 'numeric',
'conditional' => array( 'enable_reset_password_limit', '=', 1 ),
'size' => 'small',
),
array(
'id' => 'blocked_emails',
'type' => 'textarea',
'label' => __( 'Blocked Email Addresses','ultimate-member' ),
'tooltip' => __('This will block the specified e-mail addresses from being able to sign up or sign in to your site. To block an entire domain, use something like *@domain.com','ultimate-member'),
'id' => 'blocked_emails',
'type' => 'textarea',
'label' => __( 'Blocked Email Addresses', 'ultimate-member' ),
'tooltip' => __( 'This will block the specified e-mail addresses from being able to sign up or sign in to your site. To block an entire domain, use something like *@domain.com', 'ultimate-member' ),
),
array(
'id' => 'blocked_words',
'type' => 'textarea',
'label' => __( 'Blacklist Words','ultimate-member' ),
'tooltip' => __('This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username','ultimate-member'),
'id' => 'blocked_words',
'type' => 'textarea',
'label' => __( 'Blacklist Words', 'ultimate-member' ),
'tooltip' => __( 'This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username', 'ultimate-member' ),
)
)
),
)
),
'email' => array(
'title' => __( 'Email', 'ultimate-member' ),
'fields' => array(
'title' => __( 'Email', 'ultimate-member' ),
'fields' => array(
array(
'id' => 'admin_email',
'type' => 'text',
'label' => __( 'Admin E-mail Address', 'ultimate-member' ),
'id' => 'admin_email',
'type' => 'text',
'label' => __( 'Admin E-mail Address', 'ultimate-member' ),
'tooltip' => __( 'e.g. admin@companyname.com','ultimate-member' ),
),
array(
'id' => 'mail_from',
'type' => 'text',
'label' => __( 'Mail appears from','ultimate-member' ),
'tooltip' => __( 'e.g. Site Name','ultimate-member' ),
'id' => 'mail_from',
'type' => 'text',
'label' => __( 'Mail appears from','ultimate-member' ),
'tooltip' => __( 'e.g. Site Name','ultimate-member' ),
),
array(
'id' => 'mail_from_addr',
@@ -692,8 +693,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
)
),
'appearance' => array(
'title' => __( 'Appearance', 'ultimate-member' ),
'sections' => array(
'title' => __( 'Appearance', 'ultimate-member' ),
'sections' => array(
'' => array(
'title' => __( 'Profile', 'ultimate-member' ),
'fields' => array(
@@ -1080,32 +1081,32 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
)
),
'extensions' => array(
'title' => __( 'Extensions', 'ultimate-member' )
'title' => __( 'Extensions', 'ultimate-member' )
),
'licenses' => array(
'title' => __( 'Licenses', 'ultimate-member' ),
'title' => __( 'Licenses', 'ultimate-member' ),
),
'misc' => array(
'title' => __( 'Misc', 'ultimate-member' ),
'fields' => array(
'title' => __( 'Misc', 'ultimate-member' ),
'fields' => array(
array(
'id' => 'form_asterisk',
'type' => 'checkbox',
'label' => __( 'Show an asterisk for required fields','ultimate-member' ),
'id' => 'form_asterisk',
'type' => 'checkbox',
'label' => __( 'Show an asterisk for required fields', 'ultimate-member' ),
),
array(
'id' => 'profile_title',
'type' => 'text',
'label' => __('User Profile Title','ultimate-member'),
'tooltip' => __('This is the title that is displayed on a specific user profile','ultimate-member'),
'size' => 'medium'
'id' => 'profile_title',
'type' => 'text',
'label' => __( 'User Profile Title', 'ultimate-member' ),
'tooltip' => __( 'This is the title that is displayed on a specific user profile', 'ultimate-member' ),
'size' => 'medium'
),
array(
'id' => 'profile_desc',
'type' => 'textarea',
'label' => __( 'User Profile Dynamic Meta Description','ultimate-member' ),
'tooltip' => __('This will be used in the meta description that is available for search-engines.','ultimate-member'),
'args' => array(
'id' => 'profile_desc',
'type' => 'textarea',
'label' => __( 'User Profile Dynamic Meta Description', 'ultimate-member' ),
'tooltip' => __( 'This will be used in the meta description that is available for search-engines.', 'ultimate-member' ),
'args' => array(
'textarea_rows' => 6
)
),
@@ -1132,18 +1133,18 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
),
),
array(
'id' => 'uninstall_on_delete',
'type' => 'checkbox',
'label' => __( 'Remove Data on Uninstall?', 'ultimate-member' ),
'tooltip' => __( 'Check this box if you would like Ultimate Member to completely remove all of its data when the plugin/extensions are deleted.', 'ultimate-member' ),
'id' => 'uninstall_on_delete',
'type' => 'checkbox',
'label' => __( 'Remove Data on Uninstall?', 'ultimate-member' ),
'tooltip' => __( 'Check this box if you would like Ultimate Member to completely remove all of its data when the plugin/extensions are deleted.', 'ultimate-member' ),
)
)
),
'install_info' => array(
'title' => __( 'Install Info', 'ultimate-member' ),
'fields' => array(
'title' => __( 'Install Info', 'ultimate-member' ),
'fields' => array(
array(
'type' => 'install_info',
'type' => 'install_info',
),
)
),
@@ -1238,20 +1239,23 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
//remove not option hidden fields
if ( ! empty( $settings_struct['fields'] ) ) {
foreach ( $settings_struct['fields'] as $field_key=>$field_options ) {
foreach ( $settings_struct['fields'] as $field_key => $field_options ) {
if ( isset( $field_options['is_option'] ) && $field_options['is_option'] === false )
unset( $settings_struct['fields'][$field_key] );
if ( isset( $field_options['is_option'] ) && $field_options['is_option'] === false ) {
unset( $settings_struct['fields'][ $field_key ] );
}
}
}
if ( empty( $settings_struct['fields'] ) && empty( $settings_struct['sections'] ) )
if ( empty( $settings_struct['fields'] ) && empty( $settings_struct['sections'] ) ) {
um_js_redirect( add_query_arg( array( 'page' => 'um_options' ), admin_url( 'admin.php' ) ) );
}
if ( ! empty( $settings_struct['sections'] ) ) {
if ( empty( $settings_struct['sections'][$current_subtab] ) )
if ( empty( $settings_struct['sections'][ $current_subtab ] ) ) {
um_js_redirect( add_query_arg( array( 'page' => 'um_options', 'tab' => $current_tab ), admin_url( 'admin.php' ) ) );
}
}
echo '<div id="um-settings-wrap" class="wrap"><h2>' . __( 'Ultimate Member - Settings', 'ultimate-member' ) . '</h2>';
@@ -1330,14 +1334,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
} else { ?>
<!-- <?php /*if ( empty( $settings_struct['sections'][$current_subtab] ) )
$title = $this->settings_structure[$current_tab]['title'];
else
$title = $this->settings_structure[$current_tab]['sections'][$current_subtab]['title'];
*/?>
<h3><?php /*echo $title */?></h3>-->
<form method="post" action="" name="um-settings-form" id="um-settings-form">
<input type="hidden" value="save" name="um-settings-action" />
@@ -1388,24 +1384,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
echo apply_filters( 'um_settings_section_' . $current_tab . '_' . $current_subtab . '_content',
$settings_section,
$section_fields
);
?>
); ?>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'ultimate-member' ) ?>" />
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e( 'Save Changes', 'ultimate-member' ) ?>" />
<?php $um_settings_nonce = wp_create_nonce( 'um-settings-nonce' ); ?>
<input type="hidden" name="__umnonce" value="<?php echo $um_settings_nonce; ?>" />
<input type="hidden" name="__umnonce" value="<?php echo esc_attr( $um_settings_nonce ); ?>" />
</p>
</form>
<?php }
/*echo '</div>';*/
}
/**
* Generate pages tabs
*
@@ -1421,21 +1413,22 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$menu_tabs = array();
foreach ( $this->settings_structure as $slug => $tab ) {
if ( ! empty( $tab['fields'] ) ) {
foreach ( $tab['fields'] as $field_key=>$field_options ) {
foreach ( $tab['fields'] as $field_key => $field_options ) {
if ( isset( $field_options['is_option'] ) && $field_options['is_option'] === false ) {
unset( $tab['fields'][$field_key] );
unset( $tab['fields'][ $field_key ] );
}
}
}
if ( ! empty( $tab['fields'] ) || ! empty( $tab['sections'] ) )
$menu_tabs[$slug] = $tab['title'];
if ( ! empty( $tab['fields'] ) || ! empty( $tab['sections'] ) ) {
$menu_tabs[ $slug ] = $tab['title'];
}
}
$current_tab = empty( $_GET['tab'] ) ? '' : urldecode( $_GET['tab'] );
foreach ( $menu_tabs as $name=>$label ) {
foreach ( $menu_tabs as $name => $label ) {
$active = ( $current_tab == $name ) ? 'nav-tab-active' : '';
$tabs .= '<a href="' . admin_url( 'admin.php?page=um_options' . ( empty( $name ) ? '' : '&tab=' . $name ) ) . '" class="nav-tab ' . $active . '">' .
$tabs .= '<a href="' . esc_url( admin_url( 'admin.php?page=um_options' . ( empty( $name ) ? '' : '&tab=' . $name ) ) ) . '" class="nav-tab ' . $active . '">' .
$label .
'</a>';
}
@@ -1476,12 +1469,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
* @return string
*/
function generate_subtabs_menu( $tab = '' ) {
if ( empty( $this->settings_structure[$tab]['sections'] ) )
if ( empty( $this->settings_structure[ $tab ]['sections'] ) ) {
return '';
}
$menu_subtabs = array();
foreach ( $this->settings_structure[$tab]['sections'] as $slug => $subtab ) {
$menu_subtabs[$slug] = $subtab['title'];
foreach ( $this->settings_structure[ $tab ]['sections'] as $slug => $subtab ) {
$menu_subtabs[ $slug ] = $subtab['title'];
}
$subtabs = '<div><ul class="subsubsub">';
@@ -1490,7 +1484,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$current_subtab = empty( $_GET['section'] ) ? '' : urldecode( $_GET['section'] );
foreach ( $menu_subtabs as $name => $label ) {
$active = ( $current_subtab == $name ) ? 'current' : '';
$subtabs .= '<a href="' . admin_url( 'admin.php?page=um_options' . ( empty( $current_tab ) ? '' : '&tab=' . $current_tab ) . ( empty( $name ) ? '' : '&section=' . $name ) ) . '" class="' . $active . '">'
$subtabs .= '<a href="' . esc_url( admin_url( 'admin.php?page=um_options' . ( empty( $current_tab ) ? '' : '&tab=' . $current_tab ) . ( empty( $name ) ? '' : '&section=' . $name ) ) ) . '" class="' . $active . '">'
. $label .
'</a> | ';
}
@@ -1510,7 +1504,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$nonce = ! empty( $_POST['__umnonce'] ) ? $_POST['__umnonce'] : '';
if ( ( ! wp_verify_nonce( $nonce, 'um-settings-nonce' ) || empty( $nonce ) ) || ! current_user_can('manage_options') ) {
if ( ( ! wp_verify_nonce( $nonce, 'um-settings-nonce' ) || empty( $nonce ) ) || ! current_user_can( 'manage_options' ) ) {
// This nonce is not valid.
wp_die( 'Security Check' );
}
@@ -1577,18 +1571,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
* }
* ?>
*/
do_action( "um_settings_save" );
do_action( 'um_settings_save' );
//redirect after save settings
$arg = array(
'page' => 'um_options',
);
if ( ! empty( $_GET['tab'] ) )
if ( ! empty( $_GET['tab'] ) ) {
$arg['tab'] = $_GET['tab'];
}
if ( ! empty( $_GET['section'] ) )
if ( ! empty( $_GET['section'] ) ) {
$arg['section'] = $_GET['section'];
}
um_js_redirect( add_query_arg( $arg, admin_url( 'admin.php' ) ) );
}
@@ -1603,30 +1599,34 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*/
function remove_empty_values( $settings ) {
$tab = '';
if ( ! empty( $_GET['tab'] ) )
if ( ! empty( $_GET['tab'] ) ) {
$tab = $_GET['tab'];
}
$section = '';
if ( ! empty( $_GET['section'] ) )
if ( ! empty( $_GET['section'] ) ) {
$section = $_GET['section'];
}
if ( isset( $this->settings_structure[$tab]['sections'][$section]['fields'] ) )
$fields = $this->settings_structure[$tab]['sections'][$section]['fields'];
else
$fields = $this->settings_structure[$tab]['fields'];
if ( isset( $this->settings_structure[ $tab ]['sections'][ $section ]['fields'] ) ) {
$fields = $this->settings_structure[ $tab ]['sections'][ $section ]['fields'];
} else {
$fields = $this->settings_structure[ $tab ]['fields'];
}
if ( empty( $fields ) )
if ( empty( $fields ) ) {
return $settings;
}
$filtered_settings = array();
foreach ( $settings as $key=>$value ) {
foreach ( $settings as $key => $value ) {
$filtered_settings[$key] = $value;
$filtered_settings[ $key ] = $value;
foreach( $fields as $field ) {
foreach ( $fields as $field ) {
if ( $field['id'] == $key && isset( $field['type'] ) && $field['type'] == 'multi_text' ) {
$filtered_settings[$key] = array_filter( $settings[$key] );
$filtered_settings[ $key ] = array_filter( $settings[ $key ] );
}
}
}
@@ -1697,8 +1697,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*
*/
function before_licenses_save() {
if ( empty( $_POST['um_options'] ) || empty( $_POST['licenses_settings'] ) )
if ( empty( $_POST['um_options'] ) || empty( $_POST['licenses_settings'] ) ) {
return;
}
foreach ( $_POST['um_options'] as $key => $value ) {
$this->previous_licenses[ $key ] = UM()->options()->get( $key );
@@ -1828,30 +1829,30 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*/
$section_fields = apply_filters( 'um_admin_settings_email_section_fields', array(
array(
'id' => 'um_email_template',
'type' => 'hidden',
'value' => $email_key,
'id' => 'um_email_template',
'type' => 'hidden',
'value' => $email_key,
),
array(
'id' => $email_key . '_on',
'type' => 'checkbox',
'label' => $emails[$email_key]['title'],
'tooltip' => $emails[$email_key]['description'],
'id' => $email_key . '_on',
'type' => 'checkbox',
'label' => $emails[ $email_key ]['title'],
'tooltip' => $emails[ $email_key ]['description'],
),
array(
'id' => $email_key . '_sub',
'type' => 'text',
'label' => __( 'Subject Line','ultimate-member' ),
'conditional' => array( $email_key . '_on', '=', 1 ),
'tooltip' => __('This is the subject line of the e-mail','ultimate-member'),
'id' => $email_key . '_sub',
'type' => 'text',
'label' => __( 'Subject Line', 'ultimate-member' ),
'conditional' => array( $email_key . '_on', '=', 1 ),
'tooltip' => __( 'This is the subject line of the e-mail', 'ultimate-member' ),
),
array(
'id' => $email_key,
'type' => 'email_template',
'label' => __( 'Message Body','ultimate-member' ),
'label' => __( 'Message Body', 'ultimate-member' ),
'conditional' => array( $email_key . '_on', '=', 1 ),
'tooltip' => __('This is the content of the e-mail','ultimate-member'),
'value' => UM()->mail()->get_email_template( $email_key ),
'tooltip' => __( 'This is the content of the e-mail', 'ultimate-member' ),
'value' => UM()->mail()->get_email_template( $email_key ),
'in_theme' => $in_theme
),
), $email_key );
@@ -1880,7 +1881,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
<div class="wrap-licenses">
<input type="hidden" id="licenses_settings" name="licenses_settings" value="1">
<?php $um_settings_nonce = wp_create_nonce( 'um-settings-nonce' ); ?>
<input type="hidden" name="__umnonce" value="<?php echo $um_settings_nonce; ?>" />
<input type="hidden" name="__umnonce" value="<?php echo esc_attr( $um_settings_nonce ); ?>" />
<table class="form-table um-settings-section">
<tbody>
<?php foreach ( $section_fields as $field_data ) {
@@ -2137,29 +2138,29 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
} ?>
<tr class="um-settings-line">
<th><label for="um_options_<?php echo $field_data['id'] ?>"><?php echo $field_data['label'] ?></label></th>
<th><label for="um_options_<?php echo esc_attr( $field_data['id'] ) ?>"><?php echo esc_html( $field_data['label'] ) ?></label></th>
<td>
<form method="post" action="" name="um-settings-form" class="um-settings-form">
<input type="hidden" value="save" name="um-settings-action" />
<input type="hidden" name="licenses_settings" value="1" />
<?php $um_settings_nonce = wp_create_nonce( 'um-settings-nonce' ); ?>
<input type="hidden" name="__umnonce" value="<?php echo $um_settings_nonce; ?>" />
<input type="text" id="um_options_<?php echo $field_data['id'] ?>" name="um_options[<?php echo $field_data['id'] ?>]" value="<?php echo $value ?>" class="um-option-field um-long-field" data-field_id="<?php echo $field_data['id'] ?>" />
<input type="hidden" name="__umnonce" value="<?php echo esc_attr( $um_settings_nonce ); ?>" />
<input type="text" id="um_options_<?php echo esc_attr( $field_data['id'] ) ?>" name="um_options[<?php echo esc_attr( $field_data['id'] ) ?>]" value="<?php echo $value ?>" class="um-option-field um-long-field" data-field_id="<?php echo esc_attr( $field_data['id'] ) ?>" />
<?php if ( ! empty( $field_data['description'] ) ) { ?>
<div class="description"><?php echo $field_data['description'] ?></div>
<?php } ?>
<?php if ( ! empty( $value ) && ( ( is_object( $license ) && 'valid' == $license->license ) || 'valid' == $license ) ) { ?>
<input type="button" class="button um_license_deactivate" id="<?php echo $field_data['id'] ?>_deactivate" value="<?php _e( 'Clear License', 'ultimate-member' ) ?>"/>
<input type="button" class="button um_license_deactivate" id="<?php echo esc_attr( $field_data['id'] ) ?>_deactivate" value="<?php esc_attr_e( 'Clear License', 'ultimate-member' ) ?>"/>
<?php } elseif ( empty( $value ) ) { ?>
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Activate', 'ultimate-member' ) ?>" />
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e( 'Activate', 'ultimate-member' ) ?>" />
<?php } else { ?>
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Re-Activate', 'ultimate-member' ) ?>" />
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e( 'Re-Activate', 'ultimate-member' ) ?>" />
<?php }
if ( ! empty( $messages ) ) {
foreach ( $messages as $message ) { ?>
<div class="edd-license-data edd-license-<?php echo $class . ' ' . $license_status ?>">
<div class="edd-license-data edd-license-<?php echo esc_attr( $class . ' ' . $license_status ) ?>">
<p><?php echo $message ?></p>
</div>
<?php }
@@ -2188,14 +2189,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
require_once um_path . 'includes/lib/browser.php';
// Detect browser
$browser = new \Browser();
$browser = new \Browser();
// Get theme info
$theme_data = wp_get_theme();
$theme = $theme_data->Name . ' ' . $theme_data->Version;
// Identify Hosting Provider
$host = um_get_host();
$host = um_get_host();
um_fetch_user( get_current_user_id() );
@@ -2625,8 +2626,8 @@ Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ?
ob_start();
UM()->admin_forms_settings( array(
'class' => 'um_options-' . $current_tab . '-' . $current_subtab . ' um-third-column',
'prefix_id' => 'um_options',
'class' => 'um_options-' . $current_tab . '-' . $current_subtab . ' um-third-column',
'prefix_id' => 'um_options',
'fields' => $section_fields
) )->render_form(); ?>
+4 -3
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
@@ -271,7 +272,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
um_add_upgrade_log( 'Get Upgrades Packages...' );
jQuery.ajax({
url: '<?php echo admin_url( 'admin-ajax.php' ) ?>',
url: '<?php echo esc_js( admin_url( 'admin-ajax.php' ) ) ?>',
type: 'POST',
dataType: 'json',
data: {
@@ -301,7 +302,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
um_add_upgrade_log( '<br />=================================================================' );
um_add_upgrade_log( '<h4 style="font-weight: bold;">Prepare package "' + pack + '" version...</h4>' );
jQuery.ajax({
url: '<?php echo admin_url( 'admin-ajax.php' ) ?>',
url: '<?php echo esc_js( admin_url( 'admin-ajax.php' ) ) ?>',
type: 'POST',
dataType: 'html',
data: {
+11 -7
View File
@@ -1,9 +1,10 @@
<?php
namespace um\admin\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
@@ -120,7 +121,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
<?php echo $this->get_bulk_admin_actions(); ?>
</select>
<input name="um_bulkedit" id="um_bulkedit" class="button" value="<?php _e( 'Apply', 'ultimate-member' ); ?>" type="submit" />
<input name="um_bulkedit" id="um_bulkedit" class="button" value="<?php esc_attr_e( 'Apply', 'ultimate-member' ); ?>" type="submit" />
</div>
@@ -204,7 +205,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
$submitted = get_user_meta( $user_id, 'submitted', true );
if ( ! empty( $submitted ) )
$actions['view_info'] = '<a href="#" data-modal="UM_preview_registration" data-modal-size="smaller" data-dynamic-content="um_admin_review_registration" data-arg1="' . $user_id . '" data-arg2="edit_registration">' . __( 'Info', 'ultimate-member' ) . '</a>';
$actions['view_info'] = '<a href="javascript:void(0);" data-modal="UM_preview_registration" data-modal-size="smaller"
data-dynamic-content="um_admin_review_registration" data-arg1="' . esc_attr( $user_id ) . '" data-arg2="edit_registration">' . __( 'Info', 'ultimate-member' ) . '</a>';
/**
* UM hook
@@ -325,7 +327,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
$current = '';
}
$views[$k] = '<a href="' . admin_url( 'users.php' ) . '?status=' . $k . '" ' . $current . '>'. $v . ' <span class="count">('.UM()->query()->count_users_by_status( $k ).')</span></a>';
$views[ $k ] = '<a href="' . esc_url( admin_url( 'users.php' ) . '?status=' . $k ) . '" ' . $current . '>'. $v . ' <span class="count">('.UM()->query()->count_users_by_status( $k ).')</span></a>';
}
/**
@@ -442,7 +444,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
exit;
}*/
} else if ( ! empty( $_REQUEST['um_bulkedit'] ) ) {
} elseif ( ! empty( $_REQUEST['um_bulkedit'] ) ) {
$uri = $this->set_redirect_uri( admin_url( 'users.php' ) );
wp_redirect( $uri );
@@ -460,11 +462,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Users' ) ) {
*/
function set_redirect_uri( $uri ) {
if ( ! empty( $_REQUEST['s'] ) )
if ( ! empty( $_REQUEST['s'] ) ) {
$uri = add_query_arg( 's', $_REQUEST['s'], $uri );
}
if ( ! empty( $_REQUEST['status'] ) )
if ( ! empty( $_REQUEST['status'] ) ) {
$uri = add_query_arg( 'status', $_REQUEST['status'], $uri );
}
return $uri;
@@ -1,5 +1,4 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php if ( ! defined( 'ABSPATH' ) ) exit;
global $wpdb;
@@ -18,14 +17,15 @@ if ( isset( $_GET['action'] ) ) {
$role_keys = array();
if ( isset( $_REQUEST['id'] ) ) {
check_admin_referer( 'um_role_delete' . $_REQUEST['id'] . get_current_user_id() );
$role_keys = (array)$_REQUEST['id'];
$role_keys = (array) $_REQUEST['id'];
} elseif( isset( $_REQUEST['item'] ) ) {
check_admin_referer( 'bulk-' . sanitize_key( __( 'Roles', 'ultimate-member' ) ) );
$role_keys = $_REQUEST['item'];
}
if ( ! count( $role_keys ) )
if ( ! count( $role_keys ) ) {
um_js_redirect( $redirect );
}
$um_roles = get_option( 'um_roles' );
@@ -69,8 +69,9 @@ if ( isset( $_GET['action'] ) ) {
}
//update user role if it's empty
if ( empty( $object_user->roles ) )
if ( empty( $object_user->roles ) ) {
wp_update_user( array( 'ID' => $user_id, 'role' => 'subscriber' ) );
}
}
}
@@ -83,20 +84,21 @@ if ( isset( $_GET['action'] ) ) {
$role_keys = array();
if ( isset( $_REQUEST['id'] ) ) {
check_admin_referer( 'um_role_reset' . $_REQUEST['id'] . get_current_user_id() );
$role_keys = (array)$_REQUEST['id'];
$role_keys = (array) $_REQUEST['id'];
} elseif( isset( $_REQUEST['item'] ) ) {
check_admin_referer( 'bulk-' . sanitize_key( __( 'Roles', 'ultimate-member' ) ) );
$role_keys = $_REQUEST['item'];
}
if ( ! count( $role_keys ) )
if ( ! count( $role_keys ) ) {
um_js_redirect( $redirect );
}
foreach ( $role_keys as $k=>$role_key ) {
$role_meta = get_option( "um_role_{$role_key}_meta" );
if ( ! empty( $role_meta['_um_is_custom'] ) ) {
unset( $role_keys[array_search( $role_key, $role_keys )] );
unset( $role_keys[ array_search( $role_key, $role_keys ) ] );
continue;
}
@@ -110,14 +112,16 @@ if ( isset( $_GET['action'] ) ) {
}
//remove extra query arg
if ( ! empty( $_GET['_wp_http_referer'] ) )
if ( ! empty( $_GET['_wp_http_referer'] ) ) {
um_js_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
}
$order_by = 'name';
$order = ( isset( $_GET['order'] ) && 'asc' == strtolower( $_GET['order'] ) ) ? 'ASC' : 'DESC';
if( ! class_exists( 'WP_List_Table' ) )
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
/**
@@ -477,7 +481,7 @@ $ListTable->um_set_pagination_args( array( 'total_items' => count( $roles ), 'pe
<div class="wrap">
<h2>
<?php _e( 'User Roles', 'ultimate-member' ) ?>
<a class="add-new-h2" href="<?php echo add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ?>">
<a class="add-new-h2" href="<?php echo esc_url( add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ) ?>">
<?php _e( 'Add New', 'ultimate-member' ) ?>
</a>
</h2>
+5 -2
View File
@@ -1,4 +1,7 @@
<?php global $wpdb;
<?php if ( ! defined( 'ABSPATH' ) ) exit;
global $wpdb;
$count = $wpdb->get_var(
"SELECT COUNT( option_id )
@@ -8,7 +11,7 @@ $count = $wpdb->get_var(
<p><?php _e( 'Run this task from time to time to keep your DB clean.', 'ultimate-member' ) ?></p>
<p>
<a href="<?php echo add_query_arg( 'um_adm_action', 'user_cache' ); ?>" class="button">
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'user_cache' ) ); ?>" class="button">
<?php printf( __( 'Clear cache of %s users', 'ultimate-member' ), $count ) ?>
</a>
</p>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="rss-widget">
<?php wp_widget_rss_output(array(
'url' => 'https://ultimatemember.com/blog/feed/',
+5 -2
View File
@@ -1,11 +1,14 @@
<?php if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
<?php if ( ! defined( 'ABSPATH' ) ) exit;
if ( $this->dir_size( 'temp' ) > 0.1 ) { ?>
<p>
<?php printf( __( 'You can free up <span class="red">%s MB</span> by purging your temp upload directory.', 'ultimate-member' ), $this->dir_size( 'temp' ) ); ?>
</p>
<p>
<a href="<?php echo add_query_arg( 'um_adm_action', 'purge_temp' ); ?>" class="button">
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'purge_temp' ) ); ?>" class="button">
<?php _e( 'Purge Temp', 'ultimate-member' ); ?>
</a>
</p>
@@ -1,6 +1,9 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<p><?php _e( 'Run this task from time to time if you have issues with WP Cron and need to get UM extension updates.', 'ultimate-member' ) ?></p>
<p>
<a href="<?php echo add_query_arg( 'um_adm_action', 'manual_upgrades_request' ); ?>" class="button">
<a href="<?php echo esc_url( add_query_arg( 'um_adm_action', 'manual_upgrades_request' ) ); ?>" class="button">
<?php _e( 'Get latest versions', 'ultimate-member' ) ?>
</a>
</p>
+63 -12
View File
@@ -1,19 +1,46 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="table">
<table>
<tr class="first">
<td class="first b"><a href="<?php echo admin_url('users.php'); ?>"><?php echo UM()->query()->count_users(); ?></a></td>
<td class="t"><a href="<?php echo admin_url('users.php'); ?>"><?php _e('Users','ultimate-member'); ?></a></td>
<td class="first b">
<a href="<?php echo esc_url( admin_url( 'users.php' ) ); ?>">
<?php echo UM()->query()->count_users(); ?>
</a>
</td>
<td class="t">
<a href="<?php echo esc_url( admin_url( 'users.php' ) ); ?>">
<?php _e( 'Users', 'ultimate-member' ); ?>
</a>
</td>
</tr>
<tr>
<td class="first b"><a href="<?php echo admin_url('users.php?status=approved'); ?>"><?php echo UM()->query()->count_users_by_status('approved'); ?></a></td>
<td class="t"><a href="<?php echo admin_url('users.php?status=approved'); ?>"><?php _e('Approved','ultimate-member'); ?></a></td>
<td class="first b">
<a href="<?php echo esc_url( admin_url( 'users.php?status=approved' ) ); ?>">
<?php echo UM()->query()->count_users_by_status( 'approved' ); ?>
</a>
</td>
<td class="t">
<a href="<?php echo esc_url( admin_url( 'users.php?status=approved' ) ); ?>">
<?php _e( 'Approved', 'ultimate-member' ); ?>
</a>
</td>
</tr>
<tr>
<td class="first b"><a href="<?php echo admin_url('users.php?status=rejected'); ?>"><?php echo UM()->query()->count_users_by_status('rejected'); ?></a></td>
<td class="t"><a href="<?php echo admin_url('users.php?status=rejected'); ?>"><?php _e('Rejected','ultimate-member'); ?></a></td>
<td class="first b">
<a href="<?php echo esc_url( admin_url( 'users.php?status=rejected' ) ); ?>">
<?php echo UM()->query()->count_users_by_status( 'rejected' ); ?>
</a>
</td>
<td class="t">
<a href="<?php echo esc_url( admin_url( 'users.php?status=rejected' ) ); ?>">
<?php _e( 'Rejected', 'ultimate-member' ); ?>
</a>
</td>
</tr>
</table>
@@ -23,18 +50,42 @@
<table>
<tr class="first">
<td class="b"><a href="<?php echo admin_url('users.php?status=awaiting_admin_review'); ?>"><?php echo UM()->query()->count_users_by_status('awaiting_admin_review'); ?></a></td>
<td class="last t"><a href="<?php echo admin_url('users.php?status=awaiting_admin_review'); ?>" class="warning"><?php _e('Pending Review','ultimate-member'); ?></a></td>
<td class="b">
<a href="<?php echo esc_url( admin_url( 'users.php?status=awaiting_admin_review' ) ); ?>">
<?php echo UM()->query()->count_users_by_status( 'awaiting_admin_review' ); ?>
</a>
</td>
<td class="last t">
<a href="<?php echo esc_url( admin_url( 'users.php?status=awaiting_admin_review' ) ); ?>" class="warning">
<?php _e( 'Pending Review', 'ultimate-member' ); ?>
</a>
</td>
</tr>
<tr>
<td class="b"><a href="<?php echo admin_url('users.php?status=awaiting_email_confirmation'); ?>"><?php echo UM()->query()->count_users_by_status('awaiting_email_confirmation'); ?></a></td>
<td class="last t"><a href="<?php echo admin_url('users.php?status=awaiting_email_confirmation'); ?>" class="warning"><?php _e('Awaiting E-mail Confirmation','ultimate-member'); ?></a></td>
<td class="b">
<a href="<?php echo esc_url( admin_url( 'users.php?status=awaiting_email_confirmation' ) ); ?>">
<?php echo UM()->query()->count_users_by_status( 'awaiting_email_confirmation' ); ?>
</a>
</td>
<td class="last t">
<a href="<?php echo esc_url( admin_url( 'users.php?status=awaiting_email_confirmation' ) ); ?>" class="warning">
<?php _e( 'Awaiting E-mail Confirmation', 'ultimate-member' ); ?>
</a>
</td>
</tr>
<tr>
<td class="first b"><a href="<?php echo admin_url('users.php?status=inactive'); ?>"><?php echo UM()->query()->count_users_by_status('inactive'); ?></a></td>
<td class="t"><a href="<?php echo admin_url('users.php?status=inactive'); ?>"><?php _e('Inactive','ultimate-member'); ?></a></td>
<td class="first b">
<a href="<?php echo esc_url( admin_url( 'users.php?status=inactive' ) ); ?>">
<?php echo UM()->query()->count_users_by_status( 'inactive' ); ?>
</a>
</td>
<td class="t">
<a href="<?php echo esc_url( admin_url( 'users.php?status=inactive' ) ); ?>">
<?php _e( 'Inactive', 'ultimate-member' ); ?>
</a>
</td>
</tr>
</table>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php UM()->admin_forms( array(
'class' => 'um-member-directory-appearance um-top-label',
@@ -1,4 +1,6 @@
<?php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
$meta = get_post_custom( get_the_ID() );
foreach( $meta as $k => $v ) {
if ( strstr( $k, '_um_' ) && !is_array( $v[0] ) ) {
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php UM()->admin_forms( array(
'class' => 'um-member-directory-pagination um-half-column',
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $user_fields = array();
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php
$can_search_array = array();
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php /*UM()->admin_forms( array(
'class' => 'um-member-directory-shortcode um-top-label',
+9 -9
View File
@@ -188,11 +188,11 @@ $free['terms-conditions'] = array(
foreach ( $premium as $key => $info ) { ?>
<div class="plugin-card">
<a href="<?php echo esc_attr( $info['url'] ); ?>" class="plugin-image">
<img src="<?php echo esc_attr( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image">
<img src="<?php echo esc_url( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
</a>
<div class="plugin-card-top">
<h3><a href="<?php echo esc_attr( $info['url'] ); ?>"><?php echo $info['name']; ?></a></h3>
<h3><a href="<?php echo esc_url( $info['url'] ); ?>"><?php echo $info['name']; ?></a></h3>
<div class="desc column-description">
<?php echo $info['desc']; ?>
@@ -201,12 +201,12 @@ $free['terms-conditions'] = array(
<div class="action-links">
<ul class="plugin-action-buttons">
<li>
<a class="install-now button" href="<?php echo $info['url']; ?>">
<a class="install-now button" href="<?php echo esc_url( $info['url'] ); ?>">
<?php _e( 'Get this Add on', 'ultimate-member' ) ?>
</a>
</li>
<li>
<a href="<?php echo $info['url']; ?>">
<a href="<?php echo esc_url( $info['url'] ); ?>">
<?php _e( 'More Details', 'ultimate-member' ) ?>
</a>
</li>
@@ -222,11 +222,11 @@ $free['terms-conditions'] = array(
foreach ( $free as $key => $info ) { ?>
<div class="plugin-card">
<a href="<?php echo $info['url']; ?>" class="plugin-image">
<img src="<?php echo esc_attr( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image">
<img src="<?php echo esc_url( um_url . 'assets/img/extensions/' . $key . '.png' ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
</a>
<div class="plugin-card-top">
<h3><a href="<?php echo $info['url']; ?>"><?php echo $info['name']; ?></a></h3>
<h3><a href="<?php echo esc_url( $info['url'] ); ?>"><?php echo $info['name']; ?></a></h3>
<div class="desc column-description">
<?php echo $info['desc']; ?>
@@ -235,7 +235,7 @@ $free['terms-conditions'] = array(
<div class="action-links">
<ul class="plugin-action-buttons">
<li>
<a class="install-now button" href="<?php echo $info['url']; ?>">
<a class="install-now button" href="<?php echo esc_url( $info['url'] ); ?>">
<?php _e( 'Get this Add on', 'ultimate-member' ) ?>
</a>
</li>
+21 -14
View File
@@ -1,27 +1,34 @@
<?php if ( empty( UM()->builder()->form_id ) ) {
<?php if ( ! defined( 'ABSPATH' ) ) exit;
if ( empty( UM()->builder()->form_id ) ) {
UM()->builder()->form_id = $this->form_id;
} ?>
<div class="um-admin-builder" data-form_id="<?php echo UM()->builder()->form_id; ?>">
<div class="um-admin-builder" data-form_id="<?php echo esc_attr( UM()->builder()->form_id ); ?>">
<div class="um-admin-drag-ctrls-demo um-admin-drag-ctrls">
<a href="#" class="active" data-modal="UM_preview_form" data-modal-size="smaller" data-dynamic-content="um_admin_preview_form" data-arg1="<?php the_ID(); ?>" data-arg2=""><?php _e('Live Preview','ultimate-member'); ?></a>
<a href="javascript:void(0);" class="active" data-modal="UM_preview_form" data-modal-size="smaller" data-dynamic-content="um_admin_preview_form"
data-arg1="<?php esc_attr( the_ID() ); ?>" data-arg2=""><?php _e('Live Preview','ultimate-member'); ?></a>
</div>
<div class="um-admin-clear"></div>
<div class="um-admin-drag">
<div class="um-admin-drag-ajax" data-form_id="<?php echo UM()->builder()->form_id; ?>">
<div class="um-admin-drag-ajax" data-form_id="<?php echo esc_attr( UM()->builder()->form_id ); ?>">
<?php UM()->builder()->show_builder(); ?>
</div>
<div class="um-admin-drag-addrow um-admin-tipsy-n" title="<?php _e('Add Master Row','ultimate-member'); ?>" data-row_action="add_row"><i class="um-icon-plus"></i></div>
<div class="um-admin-drag-addrow um-admin-tipsy-n" title="<?php esc_attr_e( 'Add Master Row', 'ultimate-member' ); ?>"
data-row_action="add_row">
<i class="um-icon-plus"></i>
</div>
</div>
</div>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php UM()->admin_forms( array(
'class' => 'um-form-login-customize um-top-label',
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php UM()->admin_forms( array(
'class' => 'um-form-login-settings um-top-label',
+14 -10
View File
@@ -1,17 +1,21 @@
<?php $is_core = get_post_meta( get_the_ID(), '_um_core', true ); ?>
<?php if ( ! defined( 'ABSPATH' ) ) exit;
$is_core = get_post_meta( get_the_ID(), '_um_core', true ); ?>
<div class="um-admin-boxed-links um-admin-ajaxlink <?php if ( $is_core ) echo 'is-core-form'; ?>">
<?php if ( $is_core ) { ?>
<p><?php _e( '<strong>Note:</strong> Form type cannot be changed for the default forms.', 'ultimate-member' ); ?></p>
<?php } ?>
<a href="#" data-role="register"><?php _e('Registration Form','ultimate-member'); ?></a>
<a href="#" data-role="profile"><?php _e('Profile Form','ultimate-member'); ?></a>
<a href="#" data-role="login"><?php _e('Login Form','ultimate-member'); ?></a>
<input type="hidden" name="form[_um_mode]" id="form__um_mode" value="<?php echo UM()->query()->get_meta_value( '_um_mode', null, 'register' ); ?>" />
</div><div class="um-admin-clear"></div>
<a href="javascript:void(0);" data-role="register"><?php _e( 'Registration Form', 'ultimate-member' ); ?></a>
<a href="javascript:void(0);" data-role="profile"><?php _e('Profile Form', 'ultimate-member' ); ?></a>
<a href="javascript:void(0);" data-role="login"><?php _e( 'Login Form', 'ultimate-member' ); ?></a>
<input type="hidden" name="form[_um_mode]" id="form__um_mode" value="<?php echo esc_attr( UM()->query()->get_meta_value( '_um_mode', null, 'register' ) ); ?>" />
</div>
<div class="um-admin-clear"></div>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $profile_role_array = array();
@@ -1,5 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $user_fields = array();
foreach ( UM()->builtin()->all_user_fields() as $key => $arr ) {
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php foreach ( UM()->roles()->get_roles( __( 'Default', 'ultimate-member' ) ) as $key => $value ) {
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php /*UM()->admin_forms( array(
'class' => 'um-form-shortcode um-top-label',
@@ -1,20 +1,23 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_edit_field" style="display:none">
<form action="" method="post" class="um_add_field">
<div class="um-admin-modal-head">
<h3><?php _e('Edit Field','ultimate-member'); ?></h3>
<h3><?php _e( 'Edit Field', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body um-admin-metabox"></div>
<div class="um-admin-modal-foot">
<input type="submit" value="<?php _e('Update','ultimate-member'); ?>" class="button-primary" />
<input type="submit" value="<?php esc_attr_e( 'Update', 'ultimate-member' ); ?>" class="button-primary" />
<input type="hidden" name="action" value="um_update_field" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<a href="#" data-action="UM_remove_modal" class="button"><?php _e('Cancel','ultimate-member'); ?></a>
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<a href="javascript:void(0);" data-action="UM_remove_modal" class="button"><?php _e( 'Cancel', 'ultimate-member' ); ?></a>
</div>
</form>
</div>
@@ -1,20 +1,23 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_edit_row" style="display:none">
<form action="" method="post" class="um_add_field">
<div class="um-admin-modal-head">
<h3><?php _e('Edit Row Settings','ultimate-member'); ?></h3>
<h3><?php _e( 'Edit Row Settings', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body um-admin-metabox"></div>
<div class="um-admin-modal-foot">
<input type="submit" value="<?php _e('Update','ultimate-member'); ?>" class="button-primary" />
<input type="submit" value="<?php esc_attr_e( 'Update', 'ultimate-member' ); ?>" class="button-primary" />
<input type="hidden" name="action" value="um_update_field" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<a href="#" data-action="UM_remove_modal" class="button"><?php _e('Cancel','ultimate-member'); ?></a>
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<a href="javascript:void(0);" data-action="UM_remove_modal" class="button"><?php _e( 'Cancel', 'ultimate-member' ); ?></a>
</div>
</form>
</div>
@@ -1,13 +1,16 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_preview_form" style="display:none">
<div class="um-admin-modal-head">
<h3><?php _e('Live Form Preview','ultimate-member'); ?></h3>
<h3><?php _e( 'Live Form Preview', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body"></div>
<div class="um-admin-modal-foot">
<a href="#" class="button-primary" data-action="UM_remove_modal"><?php _e('Continue editing','ultimate-member'); ?></a>
<a href="javascript:void(0);" class="button-primary" data-action="UM_remove_modal"><?php _e( 'Continue editing', 'ultimate-member' ); ?></a>
</div>
</div>
@@ -1,20 +1,23 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_add_divider" style="display:none">
<form action="" method="post" class="um_add_field">
<div class="um-admin-modal-head">
<h3><?php _e('Add a New Divider','ultimate-member'); ?></h3>
<h3><?php _e( 'Add a New Divider', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body um-admin-metabox"></div>
<div class="um-admin-modal-foot">
<input type="submit" value="<?php _e('Add','ultimate-member'); ?>" class="button-primary" />
<input type="submit" value="<?php esc_attr_e( 'Add', 'ultimate-member' ); ?>" class="button-primary" />
<input type="hidden" name="action" value="um_update_field" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<a href="#" data-action="UM_remove_modal" class="button"><?php _e('Cancel','ultimate-member'); ?></a>
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<a href="javascript:void(0);" data-action="UM_remove_modal" class="button"><?php _e( 'Cancel', 'ultimate-member' ); ?></a>
</div>
</form>
</div>
@@ -1,20 +1,23 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_add_field" style="display:none">
<form action="" method="post" class="um_add_field">
<div class="um-admin-modal-head">
<h3><?php _e('Add a New Field','ultimate-member'); ?></h3>
<h3><?php _e( 'Add a New Field', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body um-admin-metabox"></div>
<div class="um-admin-modal-foot">
<input type="submit" value="<?php _e('Add','ultimate-member'); ?>" class="button-primary" />
<input type="submit" value="<?php esc_attr_e( 'Add', 'ultimate-member' ); ?>" class="button-primary" />
<input type="hidden" name="action" value="um_update_field" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<a href="#" data-modal="UM_fields" class="button"><?php _e('Cancel','ultimate-member'); ?></a>
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<a href="javascript:void(0);" data-modal="UM_fields" class="button"><?php _e( 'Cancel', 'ultimate-member' ); ?></a>
</div>
</form>
</div>
@@ -1,20 +1,23 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_add_group" style="display:none">
<form action="" method="post" class="um_add_field">
<div class="um-admin-modal-head">
<h3><?php _e('Add a New Field Group','ultimate-member'); ?></h3>
<h3><?php _e( 'Add a New Field Group', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body um-admin-metabox"></div>
<div class="um-admin-modal-foot">
<input type="submit" value="<?php _e('Add','ultimate-member'); ?>" class="button-primary" />
<input type="submit" value="<?php esc_attr_e( 'Add', 'ultimate-member' ); ?>" class="button-primary" />
<input type="hidden" name="action" value="um_update_field" />
<input type="hidden" name="nonce" value="<?php echo wp_create_nonce( 'um-admin-nonce' ) ?>" />
<a href="#" data-action="UM_remove_modal" class="button"><?php _e('Cancel','ultimate-member'); ?></a>
<input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-admin-nonce' ) ) ?>" />
<a href="javascript:void(0);" data-action="UM_remove_modal" class="button"><?php _e( 'Cancel', 'ultimate-member' ); ?></a>
</div>
</form>
</div>
@@ -1,11 +1,14 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_preview_registration" style="display:none">
<div class="um-admin-modal-head">
<h3><?php _e('Review Registration Details','ultimate-member'); ?></h3>
<h3><?php _e( 'Review Registration Details', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body"></div>
<div class="um-admin-modal-foot"></div>
</div>
+6 -3
View File
@@ -1,9 +1,12 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_fields" style="display:none">
<div class="um-admin-modal-head">
<h3><?php _e('Fields Manager','ultimate-member'); ?></h3>
<h3><?php _e( 'Fields Manager', 'ultimate-member' ); ?></h3>
</div>
<div class="um-admin-modal-body"></div>
</div>
+7 -4
View File
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div id="UM_fonticons" style="display:none">
<div class="um-admin-modal-head">
@@ -5,10 +8,10 @@
</div>
<div class="um-admin-modal-body"></div>
<div class="um-admin-modal-foot">
<a href="#" class="button-primary um-admin-modal-back" data-code=""><?php _e( 'Finish', 'ultimate-member' ) ?></a>
<a href="#" class="button um-admin-modal-back um-admin-modal-cancel"><?php _e( 'Cancel', 'ultimate-member' ) ?></a>
<a href="javascript:void(0);" class="button-primary um-admin-modal-back" data-code=""><?php _e( 'Finish', 'ultimate-member' ) ?></a>
<a href="javascript:void(0);" class="button um-admin-modal-back um-admin-modal-cancel"><?php _e( 'Cancel', 'ultimate-member' ) ?></a>
</div>
</div>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+3
View File
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+3
View File
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+3
View File
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+3
View File
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+12 -12
View File
@@ -1,27 +1,27 @@
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php if ( ! defined( 'ABSPATH' ) ) exit;
$role = $object['data']; ?>
<div class="um-admin-metabox">
<?php UM()->admin_forms( array(
'class' => 'um-role-publish um-top-label',
'prefix_id' => 'role',
'fields' => array(
'class' => 'um-role-publish um-top-label',
'prefix_id' => 'role',
'fields' => array(
array(
'id' => '_um_priority',
'type' => 'text',
'label' => __( 'Role Priority', 'ultimate-member' ),
'tooltip' => __( 'The higher the number, the higher the priority', 'ultimate-member' ),
'value' => ! empty( $role['_um_priority'] ) ? $role['_um_priority'] : '',
'id' => '_um_priority',
'type' => 'text',
'label' => __( 'Role Priority', 'ultimate-member' ),
'tooltip' => __( 'The higher the number, the higher the priority', 'ultimate-member' ),
'value' => ! empty( $role['_um_priority'] ) ? $role['_um_priority'] : '',
),
)
) )->render_form(); ?>
</div>
<div class="submitbox" id="submitpost">
<div id="major-publishing-actions">
<input type="submit" value="<?php echo ! empty( $_GET['id'] ) ? __( 'Update Role', 'ultimate-member' ) : __( 'Create Role', 'ultimate-member' ) ?>" class="button-primary" id="create_role" name="create_role">
<input type="button" class="cancel_popup button" value="<?php _e( 'Cancel', 'ultimate-member' ) ?>" onclick="window.location = '<?php echo add_query_arg( array( 'page' => 'um_roles' ), admin_url( 'admin.php' ) ) ?>';" />
<input type="submit" value="<?php echo ! empty( $_GET['id'] ) ? esc_attr__( 'Update Role', 'ultimate-member' ) : esc_attr__( 'Create Role', 'ultimate-member' ) ?>" class="button-primary" id="create_role" name="create_role">
<input type="button" class="cancel_popup button" value="<?php esc_attr_e( 'Cancel', 'ultimate-member' ) ?>" onclick="window.location = '<?php echo add_query_arg( array( 'page' => 'um_roles' ), admin_url( 'admin.php' ) ) ?>';" />
<div class="clear"></div>
</div>
</div>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<?php $role = $object['data'];
+8 -10
View File
@@ -1,7 +1,4 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
<?php if ( ! defined( 'ABSPATH' ) ) exit;
wp_enqueue_script( 'postbox' );
wp_enqueue_media();
@@ -52,8 +49,9 @@ global $wp_roles;
if ( ! empty( $_GET['id'] ) ) {
$data = get_option( "um_role_{$_GET['id']}_meta" );
if ( empty( $data['_um_is_custom'] ) )
if ( empty( $data['_um_is_custom'] ) ) {
$data['name'] = $wp_roles->roles[ $_GET['id'] ]['name'];
}
}
@@ -144,7 +142,7 @@ $screen_id = $current_screen->id; ?>
<script type="text/javascript">
jQuery( document ).ready( function() {
postboxes.add_postbox_toggles( '<?php echo $screen_id; ?>' );
postboxes.add_postbox_toggles( '<?php echo esc_js( $screen_id ); ?>' );
});
</script>
@@ -152,7 +150,7 @@ $screen_id = $current_screen->id; ?>
<h2>
<?php echo ( 'add' == $_GET['tab'] ) ? __( 'Add New Role', 'ultimate-member' ) : __( 'Edit Role', 'ultimate-member' ) ?>
<?php if ( 'edit' == $_GET['tab'] ) { ?>
<a class="add-new-h2" href="<?php echo add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ?>"><?php _e( 'Add New', 'ultimate-member' ) ?></a>
<a class="add-new-h2" href="<?php echo esc_url( add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ) ?>"><?php _e( 'Add New', 'ultimate-member' ) ?></a>
<?php } ?>
</h2>
@@ -177,10 +175,10 @@ $screen_id = $current_screen->id; ?>
<input type="hidden" name="role[id]" value="<?php echo isset( $_GET['id'] ) ? esc_attr( $_GET['id'] ) : '' ?>" />
<?php if ( 'add' == $_GET['tab'] ) { ?>
<input type="hidden" name="role[_um_is_custom]" value="1" />
<input type="hidden" name="um_nonce" value="<?php echo wp_create_nonce( 'um-add-role' ) ?>" />
<input type="hidden" name="um_nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-add-role' ) ) ?>" />
<?php } else { ?>
<input type="hidden" name="role[_um_is_custom]" value="<?php echo ! empty( $data['_um_is_custom'] ) ? 1 : 0 ?>" />
<input type="hidden" name="um_nonce" value="<?php echo wp_create_nonce( 'um-edit-role' ) ?>" />
<input type="hidden" name="um_nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-edit-role' ) ) ?>" />
<?php } ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<div id="poststuff">
@@ -190,7 +188,7 @@ $screen_id = $current_screen->id; ?>
<div id="titlewrap">
<?php if ( 'add' == $_GET['tab'] ) { ?>
<label for="title" class="screen-reader-text"><?php _e( 'Title', 'ultimate-member' ) ?></label>
<input type="text" name="role[name]" placeholder="<?php _e( 'Enter Title Here', 'ultimate-member' ) ?>" id="title" value="<?php echo isset( $data['name'] ) ? $data['name'] : '' ?>" />
<input type="text" name="role[name]" placeholder="<?php esc_attr_e( 'Enter Title Here', 'ultimate-member' ) ?>" id="title" value="<?php echo isset( $data['name'] ) ? $data['name'] : '' ?>" />
<?php } else { ?>
<span style="float: left;width:100%;"><?php echo isset( $data['name'] ) ? $data['name'] : '' ?></span>
<?php } ?>
@@ -1,3 +1,6 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="um-admin-metabox">
<script type="text/javascript">
-14
View File
@@ -1224,20 +1224,6 @@ if ( ! class_exists( 'UM' ) ) {
}
/**
* @since 2.0
*
* @return um\core\Chart
*/
function chart() {
if ( empty( $this->classes['chart'] ) ) {
$this->classes['chart'] = new um\core\Chart();
}
return $this->classes['chart'];
}
/**
* @since 2.0
*
+33 -25
View File
@@ -1,9 +1,10 @@
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Account' ) ) {
@@ -158,9 +159,9 @@ if ( ! class_exists( 'um\core\Account' ) ) {
ob_start();
$defaults = array(
'template' => 'account',
'mode' => 'account',
'form_id' => 'um_account_id',
'template' => 'account',
'mode' => 'account',
'form_id' => 'um_account_id',
);
$args = wp_parse_args( $args, $defaults );
@@ -188,8 +189,9 @@ if ( ! class_exists( 'um\core\Account' ) ) {
if ( ! empty( $args['tab'] ) ) {
if ( $args['tab'] == 'account' )
if ( $args['tab'] == 'account' ) {
$args['tab'] = 'general';
}
$this->init_tabs( $args );
@@ -219,7 +221,8 @@ if ( ! class_exists( 'um\core\Account' ) ) {
* ?>
*/
do_action( 'um_account_page_hidden_fields', $args );
$this->render_account_tab( $args['tab'], $this->tabs[$args['tab']], $args ); ?>
$this->render_account_tab( $args['tab'], $this->tabs[ $args['tab'] ], $args ); ?>
</form>
</div>
<?php }
@@ -269,7 +272,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
* }
* ?>
*/
do_action( "um_before_form_is_loaded", $args );
do_action( 'um_before_form_is_loaded', $args );
/**
* UM hook
*
@@ -328,8 +331,8 @@ if ( ! class_exists( 'um\core\Account' ) ) {
UM()->fields()->set_mode = 'account';
UM()->fields()->editing = true;
if ( get_query_var('um_tab') ) {
$this->current_tab = get_query_var('um_tab');
if ( get_query_var( 'um_tab' ) ) {
$this->current_tab = get_query_var( 'um_tab' );
}
}
@@ -426,11 +429,11 @@ if ( ! class_exists( 'um\core\Account' ) ) {
* @return array
*/
function predefined_fields_hook( $predefined_fields ) {
$account_hide_in_directory = UM()->options()->get( 'account_hide_in_directory' );
if ( ! $account_hide_in_directory )
if ( ! $account_hide_in_directory ) {
unset( $predefined_fields['hide_in_members'] );
}
return $predefined_fields;
}
@@ -443,14 +446,14 @@ if ( ! class_exists( 'um\core\Account' ) ) {
*/
function tab_link( $id ) {
if ( get_option('permalink_structure') ) {
if ( get_option( 'permalink_structure' ) ) {
$url = trailingslashit( untrailingslashit( um_get_core_page('account') ) );
$url = trailingslashit( untrailingslashit( um_get_core_page( 'account' ) ) );
$url = $url . $id . '/';
} else {
$url = add_query_arg( 'um_tab', $id, um_get_core_page('account') );
$url = add_query_arg( 'um_tab', $id, um_get_core_page( 'account' ) );
}
@@ -465,8 +468,9 @@ if ( ! class_exists( 'um\core\Account' ) ) {
*/
function filter_fields_by_attrs( $fields, $shortcode_args ) {
foreach ( $fields as $k => $field ) {
if ( isset( $shortcode_args[ $field['metakey'] ] ) && 0 == $shortcode_args[ $field['metakey'] ] )
if ( isset( $shortcode_args[ $field['metakey'] ] ) && 0 == $shortcode_args[ $field['metakey'] ] ) {
unset( $fields[ $k ] );
}
}
return $fields;
@@ -474,10 +478,10 @@ if ( ! class_exists( 'um\core\Account' ) ) {
/**
* @param $fields
* @param array $fields
* @param $id
*
* @return mixed|void
* @return array
*/
function account_secure_fields( $fields, $id ) {
/**
@@ -507,11 +511,13 @@ if ( ! class_exists( 'um\core\Account' ) ) {
/**
* * Get Tab Output
* Get Tab Output
*
* @param integer $id
* @param array $shortcode_args
* @return mixed|null|string|void
* @param $id
* @param $shortcode_args
*
* @return mixed|string|null
* @throws \Exception
*/
function get_tab_fields( $id, $shortcode_args ) {
$output = null;
@@ -521,7 +527,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
if ( ! empty( $this->tab_output[$id]['content'] ) && ! empty( $this->tab_output[$id]['hash'] ) &&
$this->tab_output[$id]['hash'] == md5( json_encode( $shortcode_args ) ) ) {
return $this->tab_output[$id]['content'];
return $this->tab_output[ $id ]['content'];
}
switch ( $id ) {
@@ -712,7 +718,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
}
$this->tab_output[$id] = array( 'content' => $output, 'hash' => md5( json_encode( $shortcode_args ) ) );
$this->tab_output[ $id ] = array( 'content' => $output, 'hash' => md5( json_encode( $shortcode_args ) ) );
return $output;
}
@@ -723,6 +729,8 @@ if ( ! class_exists( 'um\core\Account' ) ) {
* @param $tab_id
* @param $tab_data
* @param $args
*
* @throws \Exception
*/
function render_account_tab( $tab_id, $tab_data, $args ) {
@@ -732,7 +740,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
if ( ! empty ( $tab_data['with_header'] ) ) { ?>
<div class="um-account-heading uimob340-hide uimob500-hide"><i class="<?php echo $tab_data['icon'] ?>"></i><?php echo $tab_data['title']; ?></div>
<div class="um-account-heading uimob340-hide uimob500-hide"><i class="<?php echo esc_attr( $tab_data['icon'] ) ?>"></i><?php echo esc_html( $tab_data['title'] ); ?></div>
<?php }
@@ -786,7 +794,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
<div class="um-left">
<?php $submit_title = ! empty( $tab_data['submit_title'] ) ? $tab_data['submit_title'] : $tab_data['title']; ?>
<input type="hidden" name="um_account_nonce_<?php echo esc_attr( $tab_id ) ?>" value="<?php echo esc_attr( wp_create_nonce( 'um_update_account_' . $tab_id ) ) ?>" />
<input type="submit" name="um_account_submit" id="um_account_submit_<?php echo $tab_id ?>" class="um-button" value="<?php echo esc_attr( $submit_title ) ?>" />
<input type="submit" name="um_account_submit" id="um_account_submit_<?php echo esc_attr( $tab_id ) ?>" class="um-button" value="<?php echo esc_attr( $submit_title ) ?>" />
</div>
<?php
-156
View File
@@ -1,156 +0,0 @@
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Chart' ) ) {
/**
* Class Chart
* @package um\core
*/
class Chart {
/**
* Chart constructor.
*/
function __construct() {
}
/**
* Create a new chart
*
* @param array $args
*/
function create( $args = array() ) {
$defaults = array(
'id' => 0,
'type' => 'LineChart',
'data' => null,
'x_label' => null,
'y_label' => null,
'vertical_max_lines' => 6,
'colors' => '#0085ba',
'backgroundcolor' => 'transparent',
'basetextcolor' => '#666',
'basebordercolor' => '#bbb',
'days' => 30
);
$args = wp_parse_args( $args, $defaults );
/**
* @var $type
*/
extract( $args );
if ( $type == 'LineChart' ) {
$this->linechart( $args );
}
}
/**
* LineChart
*
* @param $args
*/
function linechart( $args ) {
/**
* @var $x_label
* @var $y_label
* @var $vertical_max_lines
* @var $backgroundcolor
* @var $colors
* @var $basebordercolor
* @var $basetextcolor
* @var $data
* @var $id
*/
extract( $args ); ?>
<script type="text/javascript">
google.load( "visualization", "1", {packages:["corechart"]});
function draw_linechart() {
var data = new google.visualization.DataTable();
data.addColumn('string', '<?php echo $x_label; ?>');
data.addColumn('number', '<?php echo $y_label; ?>');
<?php /*if ( ! empty( $data_y ) ) {
foreach ( $data_y as $key => $val ) {
}
}*/ ?>
var min_data = 0;
var max_data = data.getColumnRange(1).max;
var vgrid_count = <?php echo $vertical_max_lines; ?>;
var hgrid_count = Math.floor( data.getNumberOfRows() / 4 );
/* Options */
var options = {
backgroundColor: '<?php echo $backgroundcolor; ?>',
colors: ['<?php echo $colors; ?>'],
curveType: 'function',
pointSize: 8,
lineWidth: 4,
vAxis:{
baselineColor: '<?php echo $basebordercolor; ?>',
gridlineColor: '<?php echo $basebordercolor; ?>',
gridlines: {color: 'transparent', count: vgrid_count},
textStyle: {color: '<?php echo $basetextcolor; ?>', fontSize: 12 },
format: '#',
viewWindow: {min: min_data, max: max_data + 10}
},
hAxis:{
textStyle: {color: '<?php echo $basetextcolor; ?>', fontSize: 12, italic: true },
showTextEvery: hgrid_count,
maxAlternation: 1,
maxTextLines: 1
},
legend: {
position: 'top',
alignment: 'start',
textStyle: {color: '<?php echo $basetextcolor; ?>', fontSize: 13}
},
tooltip: {
textStyle: {color: '<?php echo $basetextcolor; ?>', fontSize: 12}
},
chartArea: {
top:50,left:30,width: '95%', 'height' : ( vgrid_count * 50 ) - 100,
backgroundColor: {
stroke: '<?php echo $basebordercolor; ?>',
strokeWidth: 1
}
},
width: '100%',
height: ( vgrid_count * 50 )
};
var chart = new google.visualization.LineChart( document.getElementById( 'chart_<?php echo $data . $id; ?>' ) );
chart.draw( data, options );
}
</script>
<div id="chart_<?php echo $data . $id; ?>"></div>
<?php
}
}
}
File diff suppressed because it is too large Load Diff
+38 -38
View File
@@ -4,6 +4,7 @@ namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Members' ) ) {
@@ -26,8 +27,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
function __construct() {
add_filter( 'user_search_columns', array( &$this, 'user_search_columns' ), 99 );
add_action( 'template_redirect', array( &$this, 'access_members' ), 555);
add_action( 'template_redirect', array( &$this, 'access_members' ), 555 );
$this->core_search_fields = array(
'user_login',
@@ -36,7 +36,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
'user_email',
);
add_filter( 'um_search_select_fields', array(&$this, 'um_search_select_fields'), 10, 1 );
add_filter( 'um_search_select_fields', array( &$this, 'um_search_select_fields' ), 10, 1 );
}
@@ -60,7 +60,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
* Members page allowed?
*/
function access_members() {
if ( UM()->options()->get('members_page') == 0 && um_is_core_page( 'members' ) ) {
if ( UM()->options()->get( 'members_page' ) == 0 && um_is_core_page( 'members' ) ) {
um_redirect_home();
}
}
@@ -84,7 +84,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$array['total_users'],
);
$string = str_replace($search, $replace, $string);
$string = str_replace( $search, $replace, $string );
return $string;
}
@@ -253,7 +253,8 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$label = isset( $attrs['title'] ) ? $attrs['title'] : '';
} ?>
<select name="<?php echo $filter; ?>" id="<?php echo $filter; ?>" class="um-s1" style="width: 100%" data-placeholder="<?php echo __( stripslashes( $label ), 'ultimate-member' ); ?>" <?php if ( ! empty( $attrs['custom_dropdown_options_source'] ) ) { ?> data-um-parent="<?php echo $attrs['parent_dropdown_relationship']; ?>" data-mebers-directory="yes" data-um-ajax-source="<?php echo $attrs['custom_dropdown_options_source'] ?>"<?php } ?>>
<select name="<?php echo esc_attr( $filter ); ?>" id="<?php echo esc_attr( $filter ); ?>" class="um-s1"
style="width: 100%" data-placeholder="<?php esc_attr_e( stripslashes( $label ), 'ultimate-member' ); ?>" <?php if ( ! empty( $attrs['custom_dropdown_options_source'] ) ) { ?> data-um-parent="<?php echo esc_attr( $attrs['parent_dropdown_relationship'] ); ?>" data-mebers-directory="yes" data-um-ajax-source="<?php echo esc_attr( $attrs['custom_dropdown_options_source'] ) ?>"<?php } ?>>
<option></option>
@@ -263,33 +264,32 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$opt = $v;
if ( strstr( $filter, 'role_' ) )
if ( strstr( $filter, 'role_' ) ) {
$opt = $k;
}
if ( isset( $attrs['custom'] ) )
if ( isset( $attrs['custom'] ) ) {
$opt = $k;
} ?>
?>
<option value="<?php echo $opt; ?>" <?php um_select_if_in_query_params( $filter, $opt ); ?> <?php selected( isset( $_GET[$filter] ) && $_GET[$filter] == $v ) ?>><?php echo __( $v, 'ultimate-member'); ?></option>
<option value="<?php echo esc_attr( $opt ); ?>" <?php um_select_if_in_query_params( $filter, $opt ); ?> <?php selected( isset( $_GET[ $filter ] ) && $_GET[ $filter ] == $v ) ?>><?php esc_html_e( $v, 'ultimate-member'); ?></option>
<?php } ?>
</select>
</select>
<?php
break;
case 'text':
?>
<input type="text" autocomplete="off" name="<?php echo $filter; ?>" id="<?php echo $filter; ?>" placeholder="<?php echo isset( $attrs['label'] ) ? __( $attrs['label'], 'ultimate-member') : ''; ?>" value='<?php echo esc_attr( um_queried_search_value( $filter, false ) ); ?>' />
<input type="text" autocomplete="off" name="<?php echo esc_attr( $filter ); ?>" id="<?php echo esc_attr( $filter ); ?>"
placeholder="<?php echo isset( $attrs['label'] ) ? esc_attr__( $attrs['label'], 'ultimate-member' ) : ''; ?>"
value="<?php echo esc_attr( um_queried_search_value( $filter, false ) ); ?>" />
<?php
break;
}
@@ -306,12 +306,12 @@ if ( ! class_exists( 'um\core\Members' ) ) {
*/
function um_search_select_fields( $attrs ) {
if( !empty($attrs['metakey']) && strstr( $attrs['metakey'], 'role_' ) ){
if ( ! empty( $attrs['metakey'] ) && strstr( $attrs['metakey'], 'role_' ) ) {
$shortcode_roles = get_post_meta( UM()->shortcodes()->form_id, '_um_roles', true );
$um_roles = UM()->roles()->get_roles( false );
if( ! empty( $shortcode_roles ) && is_array( $shortcode_roles ) ){
if ( ! empty( $shortcode_roles ) && is_array( $shortcode_roles ) ) {
$attrs['options'] = array();
@@ -371,22 +371,22 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$query_args = apply_filters( 'um_prepare_user_query_args', array(), $args );
// Prepare for BIG SELECT query
$wpdb->query('SET SQL_BIG_SELECTS=1');
$wpdb->query( 'SET SQL_BIG_SELECTS=1' );
// number of profiles for mobile
if ( UM()->mobile()->isMobile() && isset( $profiles_per_page_mobile ) ){
if ( UM()->mobile()->isMobile() && isset( $profiles_per_page_mobile ) ) {
$profiles_per_page = $profiles_per_page_mobile;
}
$query_args['number'] = $profiles_per_page;
if( isset( $args['number'] ) ){
if ( isset( $args['number'] ) ) {
$query_args['number'] = $args['number'];
}
if( isset( $args['page'] ) ){
if ( isset( $args['page'] ) ) {
$members_page = $args['page'];
}else{
} else {
$members_page = isset( $_REQUEST['members_page'] ) ? $_REQUEST['members_page'] : 1;
}
@@ -478,18 +478,18 @@ if ( ! class_exists( 'um\core\Members' ) ) {
if ( isset( $pages_to_add ) ) {
asort( $pages_to_add );
$pages_to_show = array_merge( (array)$pages_to_add, $pages_to_show );
$pages_to_show = array_merge( (array) $pages_to_add, $pages_to_show );
if ( count( $pages_to_show ) < 5 ) {
if ( max($pages_to_show) - $array['page'] >= 2 ) {
$pages_to_show[] = max($pages_to_show) + 1;
if ( max( $pages_to_show ) - $array['page'] >= 2 ) {
$pages_to_show[] = max( $pages_to_show ) + 1;
if ( count( $pages_to_show ) < 5 ) {
$pages_to_show[] = max($pages_to_show) + 1;
$pages_to_show[] = max( $pages_to_show ) + 1;
}
} else if ( $array['page'] - min($pages_to_show) >= 2 ) {
$pages_to_show[] = min($pages_to_show) - 1;
} else if ( $array['page'] - min( $pages_to_show ) >= 2 ) {
$pages_to_show[] = min( $pages_to_show ) - 1;
if ( count( $pages_to_show ) < 5 ) {
$pages_to_show[] = min($pages_to_show) - 1;
$pages_to_show[] = min( $pages_to_show ) - 1;
}
}
}
@@ -528,7 +528,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
if ( $array['total_pages'] < count( $array['pages_to_show'] ) ) {
foreach ( $array['pages_to_show'] as $k => $v ) {
if ( $v > $array['total_pages'] ) unset( $array['pages_to_show'][$k] );
if ( $v > $array['total_pages'] ) unset( $array['pages_to_show'][ $k ] );
}
}
@@ -576,13 +576,13 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$arr_where = explode("\n", $vars->query_where );
$arr_left_join = explode("LEFT JOIN", $vars->query_from );
$arr_user_photo_key = array('synced_profile_photo','profile_photo','synced_gravatar_hashed_id');
$arr_user_photo_key = array( 'synced_profile_photo', 'profile_photo', 'synced_gravatar_hashed_id' );
foreach ( $arr_where as $where ) {
foreach( $arr_user_photo_key as $key ){
foreach ( $arr_user_photo_key as $key ) {
if( strpos( $where , "'".$key."'" ) > -1 ){
if ( strpos( $where, "'" . $key . "'" ) > -1 ) {
// find usermeta key
preg_match("#mt[0-9]+.#", $where, $meta_key );
@@ -597,9 +597,9 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$where_exists = 'um_exist EXISTS( SELECT '.$wpdb->usermeta.'.umeta_id FROM '.$wpdb->usermeta.' WHERE '.$wpdb->usermeta.'.user_id = '.$wpdb->users.'.ID AND '.$wpdb->usermeta.'.meta_key IN("'.implode('","', $arr_user_photo_key ).'") AND '.$wpdb->usermeta.'.meta_value != "" )';
// Replace LEFT JOIN clauses with EXISTS and remove duplicates
if( strpos( $vars->query_where, 'um_exist' ) === FALSE ){
if ( strpos( $vars->query_where, 'um_exist' ) === FALSE ) {
$vars->query_where = str_replace( $where , $where_exists, $vars->query_where );
}else{
} else {
$vars->query_where = str_replace( $where , '1=0', $vars->query_where );
}
}
@@ -608,8 +608,8 @@ if ( ! class_exists( 'um\core\Members' ) ) {
}
$vars->query_where = str_replace("\n", "", $vars->query_where );
$vars->query_where = str_replace("um_exist", "", $vars->query_where );
$vars->query_where = str_replace( "\n", "", $vars->query_where );
$vars->query_where = str_replace( "um_exist", "", $vars->query_where );
return $vars;
+7 -5
View File
@@ -52,8 +52,9 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
*/
extract( $_REQUEST );
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) )
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
die( __( 'You can not edit this user' ) );
}
UM()->files()->delete_core_user_photo( $user_id, 'profile_photo' );
}
@@ -70,8 +71,9 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
*/
extract( $_REQUEST );
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) )
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
die( __( 'You can not edit this user' ) );
}
UM()->files()->delete_core_user_photo( $user_id, 'cover_photo' );
}
@@ -355,8 +357,8 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
$this->active_subnav = null;
if ( get_query_var('subnav') ) {
$this->active_subnav = get_query_var('subnav');
if ( get_query_var( 'subnav' ) ) {
$this->active_subnav = get_query_var( 'subnav' );
}
return $this->active_subnav;
@@ -420,7 +422,7 @@ if ( ! class_exists( 'um\core\Profile' ) ) {
function new_ui( $position, $element, $trigger, $items ) {
?>
<div class="um-dropdown" data-element="<?php echo $element; ?>" data-position="<?php echo $position; ?>" data-trigger="<?php echo $trigger; ?>">
<div class="um-dropdown" data-element="<?php echo esc_attr( $element ); ?>" data-position="<?php echo esc_attr( $position ); ?>" data-trigger="<?php echo esc_attr( $trigger ); ?>">
<div class="um-dropdown-b">
<div class="um-dropdown-arr"><i class=""></i></div>
<ul>
+1 -1
View File
@@ -337,7 +337,7 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
$allowed_image_mimes[ $atype['ext'] ] = $atype['type'];
}
$image_compression = UM()->options()->get('image_compression');
$image_compression = UM()->options()->get( 'image_compression' );
$upload_overrides = array(
'test_form' => false,
+86 -73
View File
@@ -53,18 +53,18 @@ if ( ! class_exists( 'um\core\User' ) ) {
$this->target_id = null;
// When the cache should be cleared
add_action('um_delete_user_hook', array(&$this, 'remove_cached_queue') );
add_action('um_delete_user', array( &$this, 'remove_cache' ), 10, 1 );
add_action( 'um_delete_user_hook', array( &$this, 'remove_cached_queue' ) );
add_action( 'um_delete_user', array( &$this, 'remove_cache' ), 10, 1 );
add_action('um_after_user_status_is_changed_hook', array(&$this, 'remove_cached_queue') );
add_action( 'um_after_user_status_is_changed_hook', array( &$this, 'remove_cached_queue' ) );
// When user cache should be cleared
add_action('um_after_user_updated', array(&$this, 'remove_cache') );
add_action('um_after_user_account_updated', array(&$this, 'remove_cache') );
add_action('personal_options_update', array(&$this, 'remove_cache') );
add_action( 'um_after_user_updated', array( &$this, 'remove_cache' ) );
add_action( 'um_after_user_account_updated', array( &$this, 'remove_cache' ) );
add_action( 'personal_options_update', array( &$this, 'remove_cache' ) );
//add_action('edit_user_profile_update', array(&$this, 'remove_cache') );
add_action('um_when_role_is_set', array(&$this, 'remove_cache') );
add_action('um_when_status_is_set', array(&$this, 'remove_cache') );
add_action( 'um_when_role_is_set', array( &$this, 'remove_cache' ) );
add_action( 'um_when_status_is_set', array( &$this, 'remove_cache' ) );
add_action( 'show_user_profile', array( $this, 'profile_form_additional_section' ), 10 );
add_action( 'user_new_form', array( $this, 'profile_form_additional_section' ), 10 );
@@ -164,8 +164,9 @@ if ( ! class_exists( 'um\core\User' ) ) {
*
*/
function check_membership() {
if ( ! is_user_logged_in() )
if ( ! is_user_logged_in() ) {
return;
}
um_fetch_user( get_current_user_id() );
$status = um_user( 'account_status' );
@@ -209,8 +210,9 @@ if ( ! class_exists( 'um\core\User' ) ) {
*/
function add_um_role_wpmu_new_user( $user_id ) {
// Bail if no user ID was passed
if ( empty( $user_id ) )
if ( empty( $user_id ) ) {
return;
}
if ( ! empty( $_POST['um-role'] ) ) {
if ( ! user_can( $user_id, $_POST['um-role'] ) ) {
@@ -289,7 +291,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
//get default username permalink if it's empty then return false
if ( empty( $profile_slug ) ) {
if ( $permalink_base != 'user_login' ) {
$profile_slug = get_user_meta( $user_id, "um_user_profile_url_slug_user_login", true );
$profile_slug = get_user_meta( $user_id, 'um_user_profile_url_slug_user_login', true );
}
if ( empty( $profile_slug ) ) {
@@ -581,29 +583,32 @@ if ( ! class_exists( 'um\core\User' ) ) {
$role_meta = get_option( "um_role_{$role_key}_meta" );
if ( $role_meta ) {
//$role_meta['name'] = 'UM ' . $role_meta['name'];
$roles['um_' . $role_key] = $role_meta;
$roles[ 'um_' . $role_key ] = $role_meta;
}
}
}
if ( empty( $roles ) )
if ( empty( $roles ) ) {
return $content;
}
global $pagenow;
if ( 'profile.php' == $pagenow )
if ( 'profile.php' == $pagenow ) {
return $content;
}
$style = '';
$user_role = false;
if ( $userdata !== 'add-new-user' && $userdata !== 'add-existing-user' ) {
// Bail if current user cannot edit users
if ( ! current_user_can( 'edit_user', $userdata->ID ) )
if ( ! current_user_can( 'edit_user', $userdata->ID ) ) {
return $content;
}
$user_role = UM()->roles()->get_um_user_role( $userdata->ID );
if ( $user_role && ! empty( $userdata->roles ) && count( $userdata->roles ) == 1 )
if ( $user_role && ! empty( $userdata->roles ) && count( $userdata->roles ) == 1 ) {
$style = 'style="display:none;"';
}
}
@@ -611,7 +616,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
ob_start(); ?>
<div id="<?php echo $class ?>" <?php echo $style ?>>
<div id="<?php echo esc_attr( $class ) ?>" <?php echo $style ?>>
<table class="form-table">
<tbody>
<tr>
@@ -620,7 +625,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
<select name="um-role" id="um-role">
<option value="" <?php selected( empty( $user_role ) ) ?>><?php esc_html_e( '&mdash; No role for Ultimate Member &mdash;', 'ultimate-member' ); ?></option>
<?php foreach ( $roles as $role_id => $details ) { ?>
<option <?php selected( $user_role, $role_id ); ?> value="<?php echo esc_attr( $role_id ); ?>"><?php echo $details['name']; ?></option>
<option <?php selected( $user_role, $role_id ); ?> value="<?php echo esc_attr( $role_id ); ?>"><?php echo esc_html( $details['name'] ); ?></option>
<?php } ?>
</select>
</td>
@@ -651,7 +656,9 @@ if ( ! class_exists( 'um\core\User' ) ) {
* @return array
*/
function toArray( $obj ) {
if ( is_object( $obj ) ) $obj = (array)$obj;
if ( is_object( $obj ) ) {
$obj = (array) $obj;
}
if ( is_array( $obj ) ) {
$new = array();
foreach ( $obj as $key => $val ) {
@@ -668,17 +675,17 @@ if ( ! class_exists( 'um\core\User' ) ) {
/**
* @param $user_id
*
* @return mixed|string|void
* @return mixed|string
*/
function get_cached_data( $user_id ) {
$disallow_cache = UM()->options()->get( 'um_profile_object_cache_stop' );
if( $disallow_cache ){
if ( $disallow_cache ) {
return '';
}
if ( is_numeric( $user_id ) && $user_id > 0 ) {
$find_user = get_option("um_cache_userdata_{$user_id}");
$find_user = get_option( "um_cache_userdata_{$user_id}" );
if ( $find_user ) {
/**
* UM hook
@@ -916,10 +923,11 @@ if ( ! class_exists( 'um\core\User' ) ) {
* Clean user profile
*/
function clean() {
foreach($this->profile as $key => $value){
foreach($this->banned_keys as $ban){
if (strstr($key, $ban) || is_numeric($key) )
unset($this->profile[$key]);
foreach ( $this->profile as $key => $value ) {
foreach ( $this->banned_keys as $ban ) {
if ( strstr( $key, $ban ) || is_numeric( $key ) ) {
unset( $this->profile[ $key ] );
}
}
}
}
@@ -949,7 +957,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
wp_set_auth_cookie( $user_id, $rememberme );
$user = get_user_by('ID', $user_id );
$user = get_user_by( 'ID', $user_id );
do_action( 'wp_login', $user->user_login, $user );
@@ -1197,21 +1205,21 @@ if ( ! class_exists( 'um\core\User' ) ) {
* Password reset email
*/
function password_reset() {
$userdata = get_userdata( um_user('ID') );
$userdata = get_userdata( um_user( 'ID' ) );
get_password_reset_key( $userdata );
add_filter( 'um_template_tags_patterns_hook', array( UM()->password(), 'add_placeholder' ), 10, 1 );
add_filter( 'um_template_tags_replaces_hook', array( UM()->password(), 'add_replace_placeholder' ), 10, 1 );
UM()->mail()->send( um_user('user_email'), 'resetpw_email' );
UM()->mail()->send( um_user( 'user_email' ), 'resetpw_email' );
}
/**
* Password changed email
*/
function password_changed(){
UM()->mail()->send( um_user('user_email'), 'changedpw_email' );
function password_changed() {
UM()->mail()->send( um_user( 'user_email' ), 'changedpw_email' );
}
@@ -1242,19 +1250,19 @@ if ( ! class_exists( 'um\core\User' ) ) {
delete_option( "um_cache_userdata_{$user_id}" );
if ( um_user('account_status') == 'awaiting_admin_review' ) {
if ( um_user( 'account_status' ) == 'awaiting_admin_review' ) {
$userdata = get_userdata( $user_id );
get_password_reset_key( $userdata );
UM()->mail()->send( um_user('user_email'), 'approved_email' );
UM()->mail()->send( um_user( 'user_email' ), 'approved_email' );
} else {
$userdata = get_userdata( $user_id );
get_password_reset_key( $userdata );
UM()->mail()->send( um_user('user_email'), 'welcome_email');
UM()->mail()->send( um_user( 'user_email' ), 'welcome_email' );
}
$this->set_status('approved');
$this->delete_meta('account_secret_hash');
$this->set_status( 'approved' );
$this->delete_meta( 'account_secret_hash' );
/**
* UM hook
@@ -1284,8 +1292,8 @@ if ( ! class_exists( 'um\core\User' ) ) {
*/
function email_pending() {
$this->assign_secretkey();
$this->set_status('awaiting_email_confirmation');
UM()->mail()->send( um_user('user_email'), 'checkmail_email' );
$this->set_status( 'awaiting_email_confirmation' );
UM()->mail()->send( um_user( 'user_email' ), 'checkmail_email' );
}
@@ -1327,8 +1335,8 @@ if ( ! class_exists( 'um\core\User' ) ) {
*
*/
function reject() {
$this->set_status('rejected');
UM()->mail()->send( um_user('user_email'), 'rejected_email' );
$this->set_status( 'rejected' );
UM()->mail()->send( um_user( 'user_email' ), 'rejected_email' );
}
@@ -1452,7 +1460,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
function update_usermeta_info( $key ) {
// delete the key first just in case
delete_user_meta( $this->id, $key );
update_user_meta( $this->id, $key, $this->profile[$key] );
update_user_meta( $this->id, $key, $this->profile[ $key ] );
}
@@ -1474,7 +1482,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
*
*/
function delete_meta( $key ){
function delete_meta( $key ) {
delete_user_meta( $this->id, $key );
}
@@ -1518,7 +1526,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
$url = add_query_arg( array( 'um_action' => $id, 'uid' => um_profile_id() ) );
/*$url = add_query_arg( 'um_action', $id );
$url = add_query_arg( 'uid', um_profile_id(), $url );*/
$items[] = '<a href="' . $url .'" class="real_url ' . esc_attr( $id ) . '-item">' . $arr['label'] . '</a>';
$items[] = '<a href="' . esc_url( $url ) .'" class="real_url ' . esc_attr( $id ) . '-item">' . esc_html( $arr['label'] ) . '</a>';
}
return $items;
}
@@ -1548,7 +1556,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
*/
function is_private_profile( $user_id ) {
$privacy = get_user_meta( $user_id, 'profile_privacy', true );
if ( $privacy == __('Only me','ultimate-member') || $privacy == 'Only me' ) {
if ( $privacy == __( 'Only me', 'ultimate-member' ) || $privacy == 'Only me' ) {
return true;
}
return false;
@@ -1730,17 +1738,24 @@ if ( ! class_exists( 'um\core\User' ) ) {
$value = UM()->validation()->safe_name_in_url( $value );
$ids = get_users(array( 'fields' => 'ID', 'meta_key' => $key,'meta_value' => $value,'meta_compare' => '=') );
if ( !isset( $ids ) || empty( $ids ) ) return false;
foreach( $ids as $k => $id ) {
if ( $id == um_user('ID') ){
unset( $ids[$k] );
$ids = get_users( array( 'fields' => 'ID', 'meta_key' => $key, 'meta_value' => $value, 'meta_compare' => '=' ) );
if ( ! isset( $ids ) || empty( $ids ) ) {
return false;
}
foreach ( $ids as $k => $id ) {
if ( $id == um_user('ID') ) {
unset( $ids[ $k ] );
} else {
$duplicates[] = $id;
}
}
if ( isset( $duplicates ) && !empty( $duplicates ) )
if ( ! empty( $duplicates ) ) {
return count( $duplicates );
}
return false;
}
@@ -1763,57 +1778,55 @@ if ( ! class_exists( 'um\core\User' ) ) {
// Search by Profile Slug
$args = array(
"fields" => array("ID"),
'fields' => array( 'ID' ),
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'um_user_profile_url_slug_'.$permalink_base,
'value' => strtolower( $raw_value ),
'compare' => '='
)
)
'key' => 'um_user_profile_url_slug_' . $permalink_base,
'value' => strtolower( $raw_value ),
'compare' => '=',
),
),
);
$ids = new \WP_User_Query( $args );
if( $ids->total_users > 0 ){
if ( $ids->total_users > 0 ) {
$um_user_query = current( $ids->get_results() );
return $um_user_query->ID;
}
// Search by Display Name or ID
$args = array(
"fields" => array("ID"),
"search" => $value,
'search_columns' => array( 'display_name','ID' )
'fields' => array( 'ID' ),
'search' => $value,
'search_columns' => array( 'display_name', 'ID' ),
);
$ids = new \WP_User_Query( $args );
if( $ids->total_users > 0 ){
if ( $ids->total_users > 0 ) {
$um_user_query = current( $ids->get_results() );
return $um_user_query->ID;
}
// Search By User Login
$value = str_replace(".", "_", $value );
$value = str_replace(" ", "", $value );
$value = str_replace( ".", "_", $value );
$value = str_replace( " ", "", $value );
$args = array(
"fields" => array("ID"),
"search" => $value,
'search_columns' => array(
'fields' => array( 'ID' ),
'search' => $value,
'search_columns' => array(
'user_login',
)
);
$ids = new \WP_User_Query( $args );
if( $ids->total_users > 0 ){
if ( $ids->total_users > 0 ) {
$um_user_query = current( $ids->get_results() );
return $um_user_query->ID;
}
@@ -1846,7 +1859,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
*/
function user_exists_by_id( $user_id ) {
$aux = get_userdata( intval( $user_id ) );
if( $aux == false ) {
if ( $aux == false ) {
return false;
} else {
return $user_id;
@@ -1878,8 +1891,8 @@ if ( ! class_exists( 'um\core\User' ) ) {
$user_id = false;
$ids = get_users( array( 'fields' => 'ID', 'meta_key' => 'um_email_as_username_'.$slug ) );
if ( isset( $ids[0] ) && ! empty( $ids[0] ) ){
$ids = get_users( array( 'fields' => 'ID', 'meta_key' => 'um_email_as_username_' . $slug ) );
if ( ! empty( $ids[0] ) ) {
$user_id = $ids[0];
}
+42 -30
View File
@@ -211,10 +211,12 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
*/
$regex_safe_username = apply_filters('um_validation_safe_username_regex',$this->regex_safe );
if ( is_email( $string ) )
if ( is_email( $string ) ) {
return true;
if ( !is_email( $string) && !preg_match( $regex_safe_username, $string ) )
}
if ( ! is_email( $string ) && ! preg_match( $regex_safe_username, $string ) ) {
return false;
}
return true;
}
@@ -249,9 +251,9 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
* }
* ?>
*/
$regex_safe_string = apply_filters('um_validation_safe_string_regex',$this->regex_safe );
$regex_safe_string = apply_filters( 'um_validation_safe_string_regex', $this->regex_safe );
if ( !preg_match( $regex_safe_string, $string) ){
if ( ! preg_match( $regex_safe_string, $string ) ) {
return false;
}
return true;
@@ -266,10 +268,12 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
* @return bool
*/
function is_phone_number( $string ) {
if ( !$string )
if ( ! $string ) {
return true;
if ( !preg_match( $this->regex_phone_number, $string) )
}
if ( ! preg_match( $this->regex_phone_number, $string ) ) {
return false;
}
return true;
}
@@ -283,19 +287,21 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
* @return bool
*/
function is_url( $url, $social = false ){
if ( !$url ) return true;
if ( ! $url ) {
return true;
}
if ( $social ) {
if ( !filter_var($url, FILTER_VALIDATE_URL) && strstr( $url, $social ) ) { // starts with social requested
if ( ! filter_var( $url, FILTER_VALIDATE_URL ) && strstr( $url, $social ) ) { // starts with social requested
return true;
} else {
if ( filter_var($url, FILTER_VALIDATE_URL) && strstr( $url, $social ) ) {
if ( filter_var( $url, FILTER_VALIDATE_URL ) && strstr( $url, $social ) ) {
return true;
} elseif ( preg_match( $this->regex_safe, $url) ) {
} elseif ( preg_match( $this->regex_safe, $url ) ) {
if ( strstr( $url, '.com' ) ){
if ( strstr( $url, '.com' ) ) {
return false;
} else {
return true;
@@ -307,8 +313,9 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
} else {
if ( strstr( $url, 'http://') || strstr( $url, 'https://') )
if ( strstr( $url, 'http://' ) || strstr( $url, 'https://' ) ) {
return true;
}
}
@@ -326,8 +333,8 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
function randomize( $length = 10 ) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$result = '';
for ($i = 0; $i < $length; $i++) {
$result .= $characters[rand(0, strlen($characters) - 1)];
for ( $i = 0; $i < $length; $i++ ) {
$result .= $characters[ rand( 0, strlen( $characters ) - 1 ) ];
}
return $result;
}
@@ -354,22 +361,19 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
*/
function random_number( $len = false ) {
$ints = array();
$len = $len ? $len : rand(2,9);
if($len > 9)
{
trigger_error('Maximum length should not exceed 9');
$len = $len ? $len : rand( 2, 9 );
if ( $len > 9 ) {
trigger_error( 'Maximum length should not exceed 9' );
return 0;
}
while(true)
{
while( true ) {
$current = rand(0,9);
if(!in_array($current,$ints))
{
if ( ! in_array( $current, $ints ) ) {
$ints[] = $current;
}
if(count($ints) == $len)
{
return implode($ints);
if ( count( $ints ) == $len ) {
return implode( $ints );
}
}
}
@@ -383,11 +387,19 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
*
* @return bool
*/
function validate_date( $date, $format='YYYY/MM/D' ) {
if ( strlen( $date ) < strlen($format) ) return false;
if ( $date[4] != '/' ) return false;
if ( $date[7] != '/' ) return false;
if ( false === strtotime($date) ) return false;
function validate_date( $date, $format = 'YYYY/MM/D' ) {
if ( strlen( $date ) < strlen( $format ) ) {
return false;
}
if ( $date[4] != '/' ) {
return false;
}
if ( $date[7] != '/' ) {
return false;
}
if ( false === strtotime( $date ) ) {
return false;
}
return true;
}
+9 -10
View File
@@ -1,6 +1,5 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Validate for errors in account form
@@ -250,7 +249,7 @@ function um_submit_account_details( $args ) {
* ?>
*/
$secure_fields = apply_filters( 'um_secure_account_fields', $account_fields, um_user( 'ID' ) );
if ( is_array( $secure_fields ) ) {
foreach ( $secure_fields as $tab_key => $fields ) {
foreach ( $fields as $key => $value ) {
@@ -259,17 +258,17 @@ function um_submit_account_details( $args ) {
}
}
$changes = array();
foreach ( $_POST as $k => $v ) {
if ( strstr( $k, 'password' ) || strstr( $k, 'um_account' ) || ! in_array( $k, $arr_fields ) )
if ( strstr( $k, 'password' ) || strstr( $k, 'um_account' ) || ! in_array( $k, $arr_fields ) ) {
continue;
}
$changes[ $k ] = $v;
}
if ( isset( $changes['hide_in_members'] ) && ( $changes['hide_in_members'] == __('No','ultimate-member') || $changes['hide_in_members'] == 'No' ) ) {
delete_user_meta( um_user('ID'), 'hide_in_members' );
if ( isset( $changes['hide_in_members'] ) && ( $changes['hide_in_members'] == __( 'No', 'ultimate-member' ) || $changes['hide_in_members'] == 'No' ) ) {
delete_user_meta( um_user( 'ID' ), 'hide_in_members' );
unset( $changes['hide_in_members'] );
}
@@ -391,7 +390,7 @@ function um_account_page_hidden_fields( $args ) {
?>
<input type="hidden" name="_um_account" id="_um_account" value="1" />
<input type="hidden" name="_um_account_tab" id="_um_account_tab" value="<?php echo UM()->account()->current_tab;?>" />
<input type="hidden" name="_um_account_tab" id="_um_account_tab" value="<?php echo esc_attr( UM()->account()->current_tab ); ?>" />
<?php
}
@@ -433,7 +432,7 @@ add_action( 'um_before_account_notifications', 'um_before_account_notifications'
*/
function um_account_secure_registered_fields(){
$secure_fields = UM()->account()->register_fields;
update_user_meta( um_user('ID'), 'um_account_secure_fields', $secure_fields );
update_user_meta( um_user( 'ID' ), 'um_account_secure_fields', $secure_fields );
}
add_action( 'wp_footer', 'um_account_secure_registered_fields' );
+12 -13
View File
@@ -450,23 +450,23 @@ function um_submit_form_errors_hook_( $args ) {
}
if ( isset( $array['min_chars'] ) && $array['min_chars'] > 0 ) {
if ( $args[$key] && strlen( utf8_decode( $args[$key] ) ) < $array['min_chars'] ) {
if ( $args[$key] && strlen( utf8_decode( $args[ $key ] ) ) < $array['min_chars'] ) {
UM()->form()->add_error($key, sprintf(__('Your %s must contain at least %s characters','ultimate-member'), $array['label'], $array['min_chars']) );
}
}
if ( isset( $array['max_chars'] ) && $array['max_chars'] > 0 ) {
if ( $args[$key] && strlen( utf8_decode( $args[$key] ) ) > $array['max_chars'] ) {
if ( $args[$key] && strlen( utf8_decode( $args[ $key ] ) ) > $array['max_chars'] ) {
UM()->form()->add_error($key, sprintf(__('Your %s must contain less than %s characters','ultimate-member'), $array['label'], $array['max_chars']) );
}
}
$profile_show_html_bio = UM()->options()->get('profile_show_html_bio');
if( $profile_show_html_bio == 1 && $key !== "description" ){
if ( $profile_show_html_bio == 1 && $key !== "description" ) {
if ( isset( $array['html'] ) && $array['html'] == 0 ) {
if ( wp_strip_all_tags( $args[$key] ) != trim( $args[$key] ) ) {
UM()->form()->add_error($key, __('You can not use HTML tags here','ultimate-member') );
if ( wp_strip_all_tags( $args[$key] ) != trim( $args[ $key ] ) ) {
UM()->form()->add_error( $key, __( 'You can not use HTML tags here', 'ultimate-member' ) );
}
}
}
@@ -708,7 +708,7 @@ function um_submit_form_errors_hook_( $args ) {
case 'alphabetic':
if ( $args[$key] != '' ) {
if ( $args[ $key ] != '' ) {
if( ! ctype_alpha( str_replace(' ', '', $args[$key] ) ) ){
UM()->form()->add_error( $key , __('You must provide alphabetic letters','ultimate-member') );
@@ -718,9 +718,9 @@ function um_submit_form_errors_hook_( $args ) {
case 'lowercase':
if ( $args[$key] != '' ) {
if ( $args[ $key ] != '' ) {
if( ! ctype_lower( str_replace(' ', '',$args[$key] ) ) ){
if ( ! ctype_lower( str_replace(' ', '',$args[$key] ) ) ){
UM()->form()->add_error( $key , __('You must provide lowercase letters.','ultimate-member') );
}
}
@@ -734,12 +734,11 @@ function um_submit_form_errors_hook_( $args ) {
}
if ( isset( $args['description'] ) ) {
$max_chars = UM()->options()->get('profile_bio_maxchars');
$profile_show_bio = UM()->options()->get('profile_show_bio');
$max_chars = UM()->options()->get( 'profile_bio_maxchars' );
$profile_show_bio = UM()->options()->get( 'profile_show_bio' );
if( $profile_show_bio ){
if( strlen( utf8_decode( str_replace( array( "\r\n", "\n", "\r\t", "\t" ), ' ', $args[ 'description' ] ) ) ) > $max_chars && $max_chars ) {
if ( $profile_show_bio ) {
if ( strlen( utf8_decode( str_replace( array( "\r\n", "\n", "\r\t", "\t" ), ' ', $args['description'] ) ) ) > $max_chars && $max_chars ) {
UM()->form()->add_error( 'description', sprintf( __( 'Your user description must contain less than %s characters', 'ultimate-member' ), $max_chars ) );
}
}
+7 -7
View File
@@ -8,7 +8,7 @@
*/
function um_add_form_identifier( $args ) {
?>
<input type="hidden" name="form_id" id="form_id_<?php echo $args['form_id']; ?>" value="<?php echo $args['form_id']; ?>" />
<input type="hidden" name="form_id" id="form_id_<?php echo esc_attr( $args['form_id'] ); ?>" value="<?php echo esc_attr( $args['form_id'] ); ?>" />
<?php
}
add_action( 'um_after_form_fields', 'um_add_form_identifier' );
@@ -24,11 +24,11 @@ function um_add_security_checks( $args ) {
return;
} ?>
<input type="hidden" name="timestamp" class="um_timestamp" value="<?php echo current_time( 'timestamp' ) ?>" />
<input type="hidden" name="timestamp" class="um_timestamp" value="<?php echo esc_attr( current_time( 'timestamp' ) ) ?>" />
<p class="<?php echo UM()->honeypot; ?>_name">
<label for="<?php echo UM()->honeypot . '_' . $args['form_id']; ?>"><?php _e( 'Only fill in if you are not human' ); ?></label>
<input type="text" name="<?php echo UM()->honeypot; ?>" id="<?php echo UM()->honeypot . '_' . $args['form_id']; ?>" class="input" value="" size="25" autocomplete="off" />
<p class="<?php echo esc_attr( UM()->honeypot ); ?>_name">
<label for="<?php echo esc_attr( UM()->honeypot ) . '_' . $args['form_id']; ?>"><?php _e( 'Only fill in if you are not human' ); ?></label>
<input type="text" name="<?php echo esc_attr( UM()->honeypot ); ?>" id="<?php echo esc_attr( UM()->honeypot ) . '_' . $args['form_id']; ?>" class="input" value="" size="25" autocomplete="off" />
</p>
<?php
@@ -43,7 +43,7 @@ add_action( 'um_account_page_hidden_fields', 'um_add_security_checks' );
function um_add_form_honeypot_css() {
?>
<style type="text/css">
.<?php echo UM()->honeypot; ?>_name {
.<?php echo esc_attr( UM()->honeypot ); ?>_name {
display: none !important;
}
</style>
@@ -57,7 +57,7 @@ add_action( 'wp_head', 'um_add_form_honeypot_css' );
function um_add_form_honeypot_js() {
?>
<script type="text/javascript">
jQuery( '#<?php echo UM()->honeypot; ?>' ).val( '' );
jQuery( '#<?php echo esc_js( UM()->honeypot ); ?>' ).val( '' );
</script>
<?php
}
+24 -36
View File
@@ -15,15 +15,15 @@ function um_submit_form_errors_hook_login( $args ) {
if ( isset( $args['username'] ) && $args['username'] == '' ) {
UM()->form()->add_error( 'username', __('Please enter your username or email','ultimate-member') );
UM()->form()->add_error( 'username', __( 'Please enter your username or email', 'ultimate-member' ) );
}
if ( isset( $args['user_login'] ) && $args['user_login'] == '' ) {
UM()->form()->add_error( 'user_login', __('Please enter your username','ultimate-member') );
UM()->form()->add_error( 'user_login', __( 'Please enter your username', 'ultimate-member' ) );
}
if ( isset( $args['user_email'] ) && $args['user_email'] == '' ) {
UM()->form()->add_error( 'user_email', __('Please enter your email','ultimate-member') );
UM()->form()->add_error( 'user_email', __( 'Please enter your email', 'ultimate-member' ) );
}
if ( isset( $args['username'] ) ) {
@@ -35,7 +35,7 @@ function um_submit_form_errors_hook_login( $args ) {
} else {
$user_name = $args['username'];
}
} else if ( isset( $args['user_email'] ) ) {
} elseif ( isset( $args['user_email'] ) ) {
$field = 'user_email';
$is_email = true;
$data = get_user_by('email', $args['user_email'] );
@@ -45,48 +45,35 @@ function um_submit_form_errors_hook_login( $args ) {
$user_name = $args['user_login'];
}
/*if ( !username_exists( $user_name ) ) {
if ( $is_email ) {
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
} else {
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
}
} else {
}*/
if ( $args['user_password'] == '' ) {
UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
UM()->form()->add_error( 'user_password', __( 'Please enter your password', 'ultimate-member' ) );
}
$user = get_user_by( 'login', $user_name );
if ( $user && wp_check_password( $args['user_password'], $user->data->user_pass, $user->ID) ) {
if ( $user && wp_check_password( $args['user_password'], $user->data->user_pass, $user->ID ) ) {
UM()->login()->auth_id = username_exists( $user_name );
} else {
UM()->form()->add_error( 'user_password', __('Password is incorrect. Please try again.','ultimate-member') );
UM()->form()->add_error( 'user_password', __( 'Password is incorrect. Please try again.', 'ultimate-member' ) );
}
$user = apply_filters( 'authenticate', null, $user_name, $args['user_password'] );
$authenticate_user = apply_filters( 'wp_authenticate_user', $user_name, $args['user_password'] );
// @since 4.18 replacement for 'wp_login_failed' action hook
// see WP function wp_authenticate()
$ignore_codes = array('empty_username', 'empty_password');
if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
UM()->form()->add_error( $user->get_error_code(), __( $user->get_error_message() ,'ultimate-member') );
UM()->form()->add_error( $user->get_error_code(), __( $user->get_error_message(), 'ultimate-member' ) );
}
if( is_wp_error( $authenticate_user ) && ! in_array( $authenticate_user->get_error_code(), $ignore_codes ) ){
UM()->form()->add_error( $authenticate_user->get_error_code(), __( $authenticate_user->get_error_message() ,'ultimate-member') );
if ( is_wp_error( $authenticate_user ) && ! in_array( $authenticate_user->get_error_code(), $ignore_codes ) ) {
UM()->form()->add_error( $authenticate_user->get_error_code(), __( $authenticate_user->get_error_message(), 'ultimate-member' ) );
}
// if there is an error notify wp
if( UM()->form()->has_error( $field ) || UM()->form()->has_error( $user_password ) || UM()->form()->count_errors() > 0 ) {
if ( UM()->form()->has_error( $field ) || UM()->form()->has_error( $user_password ) || UM()->form()->count_errors() > 0 ) {
do_action( 'wp_login_failed', $user_name );
}
}
@@ -138,7 +125,7 @@ function um_submit_form_errors_hook_logincheck( $args ) {
$user_id = ( isset( UM()->login()->auth_id ) ) ? UM()->login()->auth_id : '';
um_fetch_user( $user_id );
$status = um_user('account_status'); // account status
$status = um_user( 'account_status' ); // account status
switch( $status ) {
// If user can't login to site...
@@ -152,7 +139,7 @@ function um_submit_form_errors_hook_logincheck( $args ) {
}
if ( isset( $args['form_id'] ) && $args['form_id'] == UM()->shortcodes()->core_login_form() && UM()->form()->errors && !isset( $_POST[ UM()->honeypot ] ) ) {
if ( isset( $args['form_id'] ) && $args['form_id'] == UM()->shortcodes()->core_login_form() && UM()->form()->errors && ! isset( $_POST[ UM()->honeypot ] ) ) {
exit( wp_redirect( um_get_core_page('login') ) );
}
@@ -226,10 +213,11 @@ function um_user_login( $args ) {
// Role redirect
$after_login = um_user( 'after_login' );
if ( empty( $after_login ) )
if ( empty( $after_login ) ) {
exit( wp_redirect( um_user_profile_url() ) );
}
switch( $after_login ) {
switch ( $after_login ) {
case 'redirect_admin':
exit( wp_redirect( admin_url() ) );
@@ -268,8 +256,8 @@ function um_user_login( $args ) {
case 'redirect_profile':
default:
exit( wp_redirect( um_user_profile_url() ) );
break;
exit( wp_redirect( um_user_profile_url() ) );
break;
}
}
@@ -389,7 +377,7 @@ function um_add_submit_button_to_login( $args ) {
*/
$secondary_btn_word = apply_filters( 'um_login_form_button_two', $args['secondary_btn_word'], $args );
$secondary_btn_url = ( isset( $args['secondary_btn_url'] ) && $args['secondary_btn_url'] ) ? $args['secondary_btn_url'] : um_get_core_page('register');
$secondary_btn_url = ! empty( $args['secondary_btn_url'] ) ? $args['secondary_btn_url'] : um_get_core_page( 'register' );
/**
* UM hook
*
@@ -412,7 +400,7 @@ function um_add_submit_button_to_login( $args ) {
* }
* ?>
*/
$secondary_btn_url = apply_filters('um_login_form_button_two_url', $secondary_btn_url, $args ); ?>
$secondary_btn_url = apply_filters( 'um_login_form_button_two_url', $secondary_btn_url, $args ); ?>
<div class="um-col-alt">
@@ -427,7 +415,7 @@ function um_add_submit_button_to_login( $args ) {
<input type="submit" value="<?php esc_attr_e( wp_unslash( $primary_btn_word ), 'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" />
</div>
<div class="um-right um-half">
<a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt">
<a href="<?php echo esc_url( $secondary_btn_url ); ?>" class="um-button um-alt">
<?php _e( wp_unslash( $secondary_btn_word ), 'ultimate-member' ); ?>
</a>
</div>
@@ -460,7 +448,7 @@ function um_after_login_submit( $args ) {
} ?>
<div class="um-col-alt-b">
<a href="<?php echo um_get_core_page('password-reset'); ?>" class="um-link-alt">
<a href="<?php echo esc_url( um_get_core_page( 'password-reset' ) ); ?>" class="um-link-alt">
<?php _e( 'Forgot your password?', 'ultimate-member' ); ?>
</a>
</div>
+59 -58
View File
@@ -9,9 +9,9 @@
function um_members_directory_search( $args ) {
$search_filters = array();
if ( isset($args['search_fields']) ) {
foreach( $args['search_fields'] as $k => $testfilter ){
if ($testfilter && !in_array( $testfilter, (array)$search_filters ) ) {
if ( isset( $args['search_fields'] ) ) {
foreach ( $args['search_fields'] as $k => $testfilter ) {
if ( $testfilter && ! in_array( $testfilter, (array) $search_filters ) ) {
$search_filters[] = $testfilter;
}
}
@@ -49,13 +49,13 @@ function um_members_directory_search( $args ) {
$count = count( $search_filters ); ?>
<div class="um-search um-search-<?php echo $count; ?>">
<div class="um-search um-search-<?php echo esc_attr( $count ); ?>">
<form method="get" action="">
<?php if ( isset( $_REQUEST['page_id'] ) && get_option('permalink_structure') == 0 ) { ?>
<?php if ( isset( $_REQUEST['page_id'] ) && get_option( 'permalink_structure' ) == 0 ) { ?>
<input type="hidden" name="page_id" id="page_id" value="<?php echo esc_attr( $_REQUEST['page_id']); ?>" />
<input type="hidden" name="page_id" id="page_id" value="<?php echo esc_attr( $_REQUEST['page_id'] ); ?>" />
<?php }
@@ -69,7 +69,7 @@ function um_members_directory_search( $args ) {
$add_class = '';
} ?>
<div class="um-search-filter <?php echo $add_class ?>">
<div class="um-search-filter <?php echo esc_attr( $add_class ) ?>">
<?php UM()->members()->show_filter( $filter ); ?>
</div>
<?php } ?>
@@ -80,15 +80,15 @@ function um_members_directory_search( $args ) {
<input type="hidden" name="um_search" id="um_search" value="1" />
<a href="#" class="um-button um-do-search"><?php _e('Search','ultimate-member'); ?></a>
<a href="<?php echo UM()->permalinks()->get_current_url( true ); ?>" class="um-button um-alt"><?php _e('Reset','ultimate-member'); ?></a>
<a href="javascript:void(0);" class="um-button um-do-search"><?php _e('Search','ultimate-member' ); ?></a>
<a href="<?php echo esc_url( UM()->permalinks()->get_current_url( true ) ); ?>" class="um-button um-alt"><?php _e( 'Reset', 'ultimate-member' ); ?></a>
</div>
<div class="um-clear"></div>
</form>
</form>
</div>
</div>
<?php
@@ -117,19 +117,19 @@ add_action( 'um_pre_directory_shortcode', 'um_pre_directory_shortcode' );
function um_members_directory_head( $args ) {
extract( $args );
if ( isset($_REQUEST['um_search']) ) {
if ( isset( $_REQUEST['um_search'] ) ) {
$is_filtering = 1;
} else if ( UM()->is_filtering == 1 ) {
} elseif ( UM()->is_filtering == 1 ) {
$is_filtering = 1;
} else {
$is_filtering = 0;
}
if ( um_members('header') && $is_filtering && um_members('users_per_page') ) { ?>
if ( um_members( 'header' ) && $is_filtering && um_members( 'users_per_page' ) ) { ?>
<div class="um-members-intro">
<div class="um-members-total"><?php echo ( um_members('total_users') > 1 ) ? um_members('header') : um_members('header_single'); ?></div>
<div class="um-members-total"><?php echo ( um_members( 'total_users' ) > 1 ) ? um_members( 'header' ) : um_members( 'header_single' ); ?></div>
</div>
@@ -147,68 +147,70 @@ function um_members_directory_pagination( $args ) {
extract( $args );
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && !isset( $_REQUEST['um_search'] ) )
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && ! isset( $_REQUEST['um_search'] ) ) {
return;
}
if ( um_members('total_pages') > 1 ) { // needs pagination
?>
<div class="um-members-pagidrop uimob340-show uimob500-show">
<div class="um-members-pagidrop uimob340-show uimob500-show">
<?php _e('Jump to page:','ultimate-member'); ?>
<?php _e( 'Jump to page:', 'ultimate-member' ); ?>
<?php if ( um_members('pages_to_show') && is_array( um_members('pages_to_show') ) ) { ?>
<select onChange="window.location.href=this.value" class="um-s2" style="width: 100px">
<?php foreach( um_members('pages_to_show') as $i ) { ?>
<option value="<?php echo UM()->permalinks()->add_query( 'members_page', $i ); ?>" <?php selected($i, um_members('page')); ?>><?php printf(__('%s of %d','ultimate-member'), $i, um_members('total_pages') ); ?></option>
<?php if ( um_members( 'pages_to_show' ) && is_array( um_members( 'pages_to_show' ) ) ) { ?>
<select onChange="window.location.href=this.value" class="um-s2" style="width: 100px">
<?php foreach( um_members( 'pages_to_show' ) as $i ) { ?>
<option value="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', $i ) ); ?>" <?php selected( $i, um_members( 'page' ) ); ?>><?php printf( __( '%s of %d', 'ultimate-member' ), $i, um_members( 'total_pages' ) ); ?></option>
<?php } ?>
</select>
</select>
<?php } ?>
</div>
</div>
<div class="um-members-pagi uimob340-hide uimob500-hide">
<div class="um-members-pagi uimob340-hide uimob500-hide">
<?php if ( um_members('page') != 1 ) { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', 1 ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php _e('First Page','ultimate-member'); ?>"><i class="um-faicon-angle-double-left"></i></a>
<?php if ( um_members( 'page' ) != 1 ) { ?>
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', 1 ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e( 'First Page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-double-left"></i></a>
<?php } else { ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-left"></i></span>
<?php } ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-left"></i></span>
<?php }
<?php if ( um_members('page') > 1 ) { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', um_members('page') - 1 ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php _e('Previous','ultimate-member'); ?>"><i class="um-faicon-angle-left"></i></a>
if ( um_members( 'page' ) > 1 ) { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', um_members( 'page' ) - 1 ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e( 'Previous', 'ultimate-member'); ?>"><i class="um-faicon-angle-left"></i></a>
<?php } else { ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-left"></i></span>
<?php } ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-left"></i></span>
<?php }
<?php if ( um_members('pages_to_show') && is_array( um_members('pages_to_show') ) ) { ?>
<?php foreach( um_members('pages_to_show') as $i ) { ?>
if ( um_members('pages_to_show') && is_array( um_members( 'pages_to_show' ) ) ) {
foreach ( um_members( 'pages_to_show' ) as $i ) {
if ( um_members('page') == $i ) { ?>
<span class="pagi current"><?php echo $i; ?></span>
<?php if ( um_members('page') == $i ) { ?>
<span class="pagi current"><?php echo $i; ?></span>
<?php } else { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', $i ); ?>" class="pagi"><?php echo $i; ?></a>
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', $i ) ); ?>" class="pagi"><?php echo $i; ?></a>
<?php } ?>
<?php }
}
}
<?php } ?>
<?php } ?>
<?php if ( um_members('page') != um_members('total_pages') ) { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', um_members('page') + 1 ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php _e('Next','ultimate-member'); ?>"><i class="um-faicon-angle-right"></i></a>
if ( um_members('page') != um_members( 'total_pages' ) ) { ?>
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', um_members( 'page' ) + 1 ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e('Next','ultimate-member'); ?>"><i class="um-faicon-angle-right"></i></a>
<?php } else { ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-right"></i></span>
<?php } ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-right"></i></span>
<?php }
<?php if ( um_members('page') != um_members('total_pages') ) { ?>
<a href="<?php echo UM()->permalinks()->add_query( 'members_page', um_members('total_pages') ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php _e('Last Page','ultimate-member'); ?>"><i class="um-faicon-angle-double-right"></i></a>
if ( um_members( 'page' ) != um_members( 'total_pages' ) ) { ?>
<a href="<?php echo esc_url( UM()->permalinks()->add_query( 'members_page', um_members( 'total_pages' ) ) ); ?>" class="pagi pagi-arrow um-tip-n" title="<?php esc_attr_e('Last Page','ultimate-member'); ?>"><i class="um-faicon-angle-double-right"></i></a>
<?php } else { ?>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-right"></i></span>
<span class="pagi pagi-arrow disabled"><i class="um-faicon-angle-double-right"></i></span>
<?php } ?>
</div>
</div>
<?php
@@ -226,16 +228,15 @@ add_action( 'um_members_directory_footer', 'um_members_directory_pagination' );
function um_members_directory_display( $args ) {
extract( $args );
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && !isset( $_REQUEST['um_search'] ) )
if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && ! isset( $_REQUEST['um_search'] ) ) {
return;
}
if ( um_members('no_users') ) {
if ( um_members( 'no_users' ) ) { ?>
?>
<div class="um-members-none">
<p><?php echo $args['no_users']; ?></p>
</div>
<div class="um-members-none">
<p><?php echo esc_html( $args['no_users'] ); ?></p>
</div>
<?php
@@ -244,7 +245,7 @@ function um_members_directory_display( $args ) {
$file = um_path . 'templates/members-grid.php';
$theme_file = get_stylesheet_directory() . '/ultimate-member/templates/members-grid.php';
if ( file_exists( $theme_file ) ){
if ( file_exists( $theme_file ) ) {
$file = $theme_file;
}
+39 -28
View File
@@ -7,6 +7,10 @@
* @param $args
*/
function um_profile_content_main( $args ) {
/**
* @var $mode
*/
extract( $args );
if ( ! UM()->options()->get( 'profile_tab_main' ) && ! isset( $_REQUEST['um_action'] ) ) {
@@ -57,7 +61,7 @@ function um_profile_content_main( $args ) {
* }
* ?>
*/
do_action( "um_before_form", $args );
do_action( 'um_before_form', $args );
/**
* UM hook
@@ -162,15 +166,17 @@ function um_profile_content_main( $args ) {
* }
* ?>
*/
do_action( "um_after_form", $args );
do_action( 'um_after_form', $args );
} else { ?>
<div class="um-profile-note">
<span>
<i class="um-faicon-lock"></i>
<?php echo $can_view; ?>
</span>
</div>
<?php }
}
add_action( 'um_profile_content_main', 'um_profile_content_main' );
@@ -551,7 +557,7 @@ add_action( 'um_after_form_fields', 'um_editing_user_id_input' );
* Meta description
*/
function um_profile_dynamic_meta_desc() {
if (um_is_core_page( 'user' ) && um_get_requested_user()) {
if ( um_is_core_page( 'user' ) && um_get_requested_user() ) {
um_fetch_user( um_get_requested_user() );
@@ -812,13 +818,13 @@ function um_profile_header( $args ) {
*/
$items = apply_filters( 'um_user_photo_menu_view', $items );
echo UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
} elseif ( UM()->fields()->editing == true ) {
$items = array(
'<a href="javascript:void(0);" class="um-manual-trigger" data-parent=".um-profile-photo" data-child=".um-btn-auto-width">' . __( 'Change photo', 'ultimate-member' ) . '</a>',
'<a href="javascript:void(0);" class="um-reset-profile-photo" data-user_id="' . um_profile_id() . '" data-default_src="' . um_get_default_avatar_uri() . '">' . __( 'Remove photo', 'ultimate-member' ) . '</a>',
'<a href="javascript:void(0);" class="um-reset-profile-photo" data-user_id="' . esc_attr( um_profile_id() ) . '" data-default_src="' . esc_url( um_get_default_avatar_uri() ) . '">' . __( 'Remove photo', 'ultimate-member' ) . '</a>',
'<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
);
@@ -845,7 +851,7 @@ function um_profile_header( $args ) {
*/
$items = apply_filters( 'um_user_photo_menu_edit', $items );
echo UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
}
@@ -960,14 +966,13 @@ function um_profile_header( $args ) {
<?php echo UM()->profile()->show_meta( $args['metafields'] ); ?>
</div>
<?php } ?>
<?php }
<?php if (UM()->fields()->viewing == true && um_user( 'description' ) && $args['show_bio']) { ?>
if ( UM()->fields()->viewing == true && um_user( 'description' ) && $args['show_bio'] ) { ?>
<div class="um-meta-text">
<?php
<?php $description = get_user_meta( um_user( 'ID' ), 'description', true );
$description = get_user_meta( um_user( 'ID' ), 'description', true );
if ( UM()->options()->get( 'profile_show_html_bio' ) ) {
echo make_clickable( wpautop( wp_kses_post( $description ) ) );
} else {
@@ -975,7 +980,7 @@ function um_profile_header( $args ) {
} ?>
</div>
<?php } else if (UM()->fields()->editing == true && $args['show_bio']) { ?>
<?php } elseif ( UM()->fields()->editing == true && $args['show_bio'] ) { ?>
<div class="um-meta-text">
<textarea id="um-meta-bio"
@@ -1072,19 +1077,23 @@ function um_pre_profile_shortcode( $args ) {
UM()->fields()->viewing = 1;
if ( um_get_requested_user() ) {
if ( ! um_can_view_profile( um_get_requested_user() ) && ! um_is_myprofile() )
if ( ! um_can_view_profile( um_get_requested_user() ) && ! um_is_myprofile() ) {
um_redirect_home( um_get_requested_user(), um_is_myprofile() );
}
if ( ! UM()->roles()->um_current_user_can( 'edit', um_get_requested_user() ) )
if ( ! UM()->roles()->um_current_user_can( 'edit', um_get_requested_user() ) ) {
UM()->user()->cannot_edit = 1;
}
um_fetch_user( um_get_requested_user() );
} else {
if ( ! is_user_logged_in() )
if ( ! is_user_logged_in() ) {
um_redirect_home( um_get_requested_user(), um_is_myprofile() );
}
if ( ! um_user( 'can_edit_profile' ) )
if ( ! um_user( 'can_edit_profile' ) ) {
UM()->user()->cannot_edit = 1;
}
}
}
@@ -1120,7 +1129,7 @@ function um_add_edit_icon( $args ) {
if ( UM()->fields()->editing == true ) { ?>
<div class="um-profile-edit um-profile-headericon">
<a href="#" class="um-profile-edit-a um-profile-save"><i class="um-faicon-check"></i></a>
<a href="javascript:void(0);" class="um-profile-edit-a um-profile-save"><i class="um-faicon-check"></i></a>
</div>
<?php return;
@@ -1134,7 +1143,7 @@ function um_add_edit_icon( $args ) {
$items = UM()->user()->get_admin_actions();
if ( UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) {
$items['editprofile'] = '<a href="' . um_edit_profile_url() . '" class="real_url">' . __( 'Edit Profile', 'ultimate-member' ) . '</a>';
$items['editprofile'] = '<a href="' . esc_url( um_edit_profile_url() ) . '" class="real_url">' . __( 'Edit Profile', 'ultimate-member' ) . '</a>';
}
/**
@@ -1161,13 +1170,13 @@ function um_add_edit_icon( $args ) {
*/
$items = apply_filters( 'um_profile_edit_menu_items', $items, um_profile_id() );
$items['cancel'] = '<a href="#" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>';
$items['cancel'] = '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>';
} else {
$items = array(
'editprofile' => '<a href="' . um_edit_profile_url() . '" class="real_url">' . __( 'Edit Profile', 'ultimate-member' ) . '</a>',
'myaccount' => '<a href="' . um_get_core_page( 'account' ) . '" class="real_url">' . __( 'My Account', 'ultimate-member' ) . '</a>',
'logout' => '<a href="' . um_get_core_page( 'logout' ) . '" class="real_url">' . __( 'Logout', 'ultimate-member' ) . '</a>',
'editprofile' => '<a href="' . esc_url( um_edit_profile_url() ) . '" class="real_url">' . __( 'Edit Profile', 'ultimate-member' ) . '</a>',
'myaccount' => '<a href="' . esc_url( um_get_core_page( 'account' ) ) . '" class="real_url">' . __( 'My Account', 'ultimate-member' ) . '</a>',
'logout' => '<a href="' . esc_url( um_get_core_page( 'logout' ) ) . '" class="real_url">' . __( 'Logout', 'ultimate-member' ) . '</a>',
'cancel' => '<a href="javascript:void(0);" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
);
@@ -1201,7 +1210,7 @@ function um_add_edit_icon( $args ) {
<div class="um-profile-edit um-profile-headericon">
<a href="#" class="um-profile-edit-a"><i class="um-faicon-cog"></i></a>
<a href="javascript:void(0);" class="um-profile-edit-a"><i class="um-faicon-cog"></i></a>
<?php UM()->profile()->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items ); ?>
@@ -1275,12 +1284,14 @@ add_action( 'um_submit_form_profile', 'um_submit_form_profile', 10 );
*/
function um_add_submit_button_to_profile( $args ) {
// DO NOT add when reviewing user's details
if (UM()->user()->preview == true && is_admin()) return;
if ( UM()->user()->preview == true && is_admin() ) {
return;
}
// only when editing
if (UM()->fields()->editing == false) return;
?>
if ( UM()->fields()->editing == false ) {
return;
} ?>
<div class="um-col-alt">
@@ -1336,7 +1347,7 @@ function um_profile_menu( $args ) {
$active_tab = UM()->profile()->active_tab();
//check here tabs with hidden also, to make correct check of active tab
if ( ! isset( $all_tabs[ $active_tab ] ) ) {
if ( ! isset( $all_tabs[ $active_tab ] ) || um_is_on_edit_profile() ) {
$active_tab = 'main';
UM()->profile()->active_tab = $active_tab;
UM()->profile()->active_subnav = null;
@@ -1446,7 +1457,7 @@ function um_profile_menu( $args ) {
<a href="<?php echo esc_url( $nav_link ); ?>" class="uimob800-hide uimob500-hide uimob340-hide"
title="<?php echo esc_attr( $tab['name'] ); ?>">
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
<span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
<?php } ?>
+1 -1
View File
@@ -16,7 +16,7 @@ function um_logout_user_links( $args ) {
</li>
<li>
<a href="<?php echo esc_url( add_query_arg( 'redirect_to', UM()->permalinks()->get_current_url( true ), um_get_core_page( 'logout' ) ) ); ?>">
<?php _e('Logout','ultimate-member'); ?>
<?php _e( 'Logout', 'ultimate-member' ); ?>
</a>
</li>
+253 -245
View File
@@ -310,293 +310,294 @@ function um_field_conditions_are_met( $data ) {
if (!isset( $data['conditions'] )) return true;
$state = ( $data['conditional_action'] == 'show' ) ? 1 : 0;
$state = ( $data['conditional_action'] == 'show' ) ? 1 : 0;
$first_group = 0;
$state_array = array();
$count = count($state_array);
foreach ($data['conditions'] as $k => $arr){
$first_group = 0;
$state_array = array();
$count = count($state_array);
foreach ($data['conditions'] as $k => $arr){
$val = $arr[3];
$op = $arr[2];
$val = $arr[3];
$op = $arr[2];
if (strstr($arr[1], 'role_'))
$arr[1] = 'role';
if (strstr($arr[1], 'role_'))
$arr[1] = 'role';
$field = um_profile($arr[1]);
$field = um_profile($arr[1]);
if( ! isset( $arr[5] ) || $arr[5] != $first_group ){
if( ! isset( $arr[5] ) || $arr[5] != $first_group ){
if ($arr[0] == 'show') {
if ($arr[0] == 'show') {
switch ($op) {
case 'equals to':
switch ($op) {
case 'equals to':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'show' : 'hide';
else
$state = ( $field == $val ) ? 'show' : 'hide';
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'show' : 'hide';
else
$state = ( $field == $val ) ? 'show' : 'hide';
break;
case 'not equals':
break;
case 'not equals':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'show' : 'hide';
else
$state = ( $field != $val ) ? 'show' : 'hide';
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'show' : 'hide';
else
$state = ( $field != $val ) ? 'show' : 'hide';
break;
case 'empty':
break;
case 'empty':
$state = ( !$field ) ? 'show' : 'hide';
$state = ( !$field ) ? 'show' : 'hide';
break;
case 'not empty':
break;
case 'not empty':
$state = ( $field ) ? 'show' : 'hide';
$state = ( $field ) ? 'show' : 'hide';
break;
case 'greater than':
if ($field > $val) {
$state = 'show';
} else {
$state = 'hide';
}
break;
case 'less than':
if ($field < $val) {
$state = 'show';
} else {
$state = 'hide';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'show';
} else {
$state = 'hide';
}
break;
}
} else if ($arr[0] == 'hide') {
break;
case 'greater than':
if ($field > $val) {
$state = 'show';
} else {
$state = 'hide';
}
break;
case 'less than':
if ($field < $val) {
$state = 'show';
} else {
$state = 'hide';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'show';
} else {
$state = 'hide';
}
break;
}
} else if ($arr[0] == 'hide') {
switch ($op) {
case 'equals to':
switch ($op) {
case 'equals to':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'hide' : 'show';
else
$state = ( $field == $val ) ? 'hide' : 'show';
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'hide' : 'show';
else
$state = ( $field == $val ) ? 'hide' : 'show';
break;
case 'not equals':
break;
case 'not equals':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'hide' : 'show';
else
$state = ( $field != $val ) ? 'hide' : 'show';
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'hide' : 'show';
else
$state = ( $field != $val ) ? 'hide' : 'show';
break;
case 'empty':
break;
case 'empty':
$state = ( !$field ) ? 'hide' : 'show';
$state = ( !$field ) ? 'hide' : 'show';
break;
case 'not empty':
break;
case 'not empty':
$state = ( $field ) ? 'hide' : 'show';
$state = ( $field ) ? 'hide' : 'show';
break;
case 'greater than':
if ($field <= $val) {
$state = 'hide';
} else {
$state = 'show';
}
break;
case 'less than':
if ($field >= $val) {
$state = 'hide';
} else {
$state = 'show';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'hide';
} else {
$state = 'show';
}
break;
}
}
$first_group++;
array_push($state_array, $state);
} else {
break;
case 'greater than':
if ($field <= $val) {
$state = 'hide';
} else {
$state = 'show';
}
break;
case 'less than':
if ($field >= $val) {
$state = 'hide';
} else {
$state = 'show';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'hide';
} else {
$state = 'show';
}
break;
}
}
$first_group++;
array_push($state_array, $state);
} else {
if ($arr[0] == 'show') {
if ($arr[0] == 'show') {
switch ($op) {
case 'equals to':
switch ($op) {
case 'equals to':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'show' : 'not_show';
else
$state = ( $field == $val ) ? 'show' : 'not_show';
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'show' : 'not_show';
else
$state = ( $field == $val ) ? 'show' : 'not_show';
break;
case 'not equals':
break;
case 'not equals':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'show' : 'not_show';
else
$state = ( $field != $val ) ? 'show' : 'not_show';
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'show' : 'not_show';
else
$state = ( $field != $val ) ? 'show' : 'not_show';
break;
case 'empty':
break;
case 'empty':
$state = ( !$field ) ? 'show' : 'not_show';
$state = ( !$field ) ? 'show' : 'not_show';
break;
case 'not empty':
break;
case 'not empty':
$state = ( $field ) ? 'show': 'not_show';
$state = ( $field ) ? 'show': 'not_show';
break;
case 'greater than':
if ($field > $val) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
case 'less than':
if ($field < $val) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
}
} else if ($arr[0] == 'hide') {
break;
case 'greater than':
if ($field > $val) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
case 'less than':
if ($field < $val) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'show';
} else {
$state = 'not_show';
}
break;
}
} else if ($arr[0] == 'hide') {
switch ($op) {
case 'equals to':
switch ($op) {
case 'equals to':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'hide' : 'not_hide';
else
$state = ( $field == $val ) ? 'hide' : 'not_hide';
if (is_array( $field ))
$state = in_array( $val, $field ) ? 'hide' : 'not_hide';
else
$state = ( $field == $val ) ? 'hide' : 'not_hide';
break;
case 'not equals':
break;
case 'not equals':
$field = maybe_unserialize( $field );
$field = maybe_unserialize( $field );
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'hide' : 'not_hide';
else
$state = ( $field != $val ) ? 'hide' : 'not_hide';
if (is_array( $field ))
$state = !in_array( $val, $field ) ? 'hide' : 'not_hide';
else
$state = ( $field != $val ) ? 'hide' : 'not_hide';
break;
case 'empty':
break;
case 'empty':
$state = ( !$field ) ? 'hide' : 'not_hide';
$state = ( !$field ) ? 'hide' : 'not_hide';
break;
case 'not empty':
break;
case 'not empty':
$state = ( $field ) ? 'hide' : 'not_hide';
$state = ( $field ) ? 'hide' : 'not_hide';
break;
case 'greater than':
if ($field <= $val) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
case 'less than':
if ($field >= $val) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
}
}
if( isset($state_array[$count]) ){
if( $state_array[$count] == 'show' || $state_array[$count] == 'not_hide' ){
if ( $state == 'show' || $state == 'not_hide' ){
$state_array[$count] = 'show';
} else {
$state_array[$count] = 'hide';
}
} else {
if ( $state == 'hide' || $state == 'not_show' ){
$state_array[$count] = 'hide';
} else {
$state_array[$count] = 'hide';
}
}
} else {
if ( $state == 'show' || $state == 'not_hide' ){
$state_array[$count] = 'show';
} else {
$state_array[$count] = 'hide';
}
}
}
break;
case 'greater than':
if ($field <= $val) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
case 'less than':
if ($field >= $val) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
case 'contains':
if (strstr( $field, $val )) {
$state = 'hide';
} else {
$state = 'not_hide';
}
break;
}
}
if( isset($state_array[$count]) ){
if( $state_array[$count] == 'show' || $state_array[$count] == 'not_hide' ){
if ( $state == 'show' || $state == 'not_hide' ){
$state_array[$count] = 'show';
} else {
$state_array[$count] = 'hide';
}
} else {
if ( $state == 'hide' || $state == 'not_show' ){
$state_array[$count] = 'hide';
} else {
$state_array[$count] = 'hide';
}
}
} else {
if ( $state == 'show' || $state == 'not_hide' ){
$state_array[$count] = 'show';
} else {
$state_array[$count] = 'hide';
}
}
}
}
$result = array_unique($state_array);
if( !in_array("show", $result) ){
return $state = false;
} else {
return $state = true;
}
}
$result = array_unique( $state_array );
if ( ! in_array( 'show', $result ) ) {
return $state = false;
} else {
return $state = true;
}
}
/**
* Exit and redirect to home
*
* @param string $requested_user_id
* @param string $is_my_profile
*/
function um_redirect_home( $requested_user_id = '', $is_my_profile = '') {
$url = apply_filters("um_redirect_home_custom_url", home_url(), $requested_user_id, $is_my_profile );
function um_redirect_home( $requested_user_id = '', $is_my_profile = '' ) {
$url = apply_filters( 'um_redirect_home_custom_url', home_url(), $requested_user_id, $is_my_profile );
exit( wp_redirect( $url ) );
}
@@ -899,30 +900,34 @@ function um_profile_id() {
/**
* Check that temp upload is valid
*
* @param $url
* @param string $url
*
* @return bool|string
*/
function um_is_temp_upload( $url ) {
if( is_string( $url ) ) {
$url = trim($url);
}
if ( is_string( $url ) ) {
$url = trim( $url );
}
if (filter_var( $url, FILTER_VALIDATE_URL ) === false)
if ( filter_var( $url, FILTER_VALIDATE_URL ) === false ) {
$url = realpath( $url );
}
if (!$url)
if ( ! $url ) {
return false;
}
$url = explode( '/ultimatemember/temp/', $url );
if (isset( $url[1] )) {
if ( isset( $url[1] ) ) {
if (strstr( $url[1], '../' ) || strstr( $url[1], '%' ))
if ( strstr( $url[1], '../' ) || strstr( $url[1], '%' ) ) {
return false;
}
$src = UM()->files()->upload_temp . $url[1];
if (!file_exists( $src ))
if ( ! file_exists( $src ) ) {
return false;
}
return $src;
}
@@ -1499,8 +1504,10 @@ function um_can_view_profile( $user_id ) {
if ( um_user( 'can_view_roles' ) && $user_id != get_current_user_id() ) {
$can_view_roles = um_user( 'can_view_roles' );
if( ! is_array( $can_view_roles ) ) $can_view_roles = array();
if ( ! is_array( $can_view_roles ) ) {
$can_view_roles = array();
}
if ( count( array_intersect( UM()->roles()->get_all_user_roles( $user_id ), $can_view_roles ) ) <= 0 ) {
um_fetch_user( $temp_id );
@@ -1592,13 +1599,14 @@ function um_edit_profile_url() {
/**
* checks if user can edit his profile
* Checks if user can edit his profile
*
* @return bool
*/
function um_can_edit_my_profile() {
if (!is_user_logged_in()) return false;
if (!um_user( 'can_edit_profile' )) return false;
if ( ! is_user_logged_in() || ! um_user( 'can_edit_profile' ) ) {
return false;
}
return true;
}
@@ -1839,8 +1847,8 @@ function um_get_cover_uri( $image, $attrs ) {
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
}elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$height}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
}
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
}
}
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
@@ -1850,8 +1858,8 @@ function um_get_cover_uri( $image, $attrs ) {
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
}elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$height}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
}
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$height}{$ext}?". current_time( 'timestamp' );
}
if ( ! empty( $uri_common ) && empty( $uri ) ) {
$uri = $uri_common;
@@ -2110,8 +2118,8 @@ function um_get_user_avatar_data( $user_id = '', $size = '96' ) {
* @return bool|string
*/
function um_get_user_avatar_url( $user_id = '', $size = '96' ) {
$data = um_get_user_avatar_data( $user_id, $size );
return $data['url'];
$data = um_get_user_avatar_data( $user_id, $size );
return $data['url'];
}
+4 -2
View File
@@ -24,7 +24,7 @@ class UM_Search_Widget extends \WP_Widget {
'um_search_widget',
// Widget name will appear in UI
__('Ultimate Member - Search', 'ultimate-member'),
__( 'Ultimate Member - Search', 'ultimate-member' ),
// Widget description
array( 'description' => __( 'Shows the search member form.', 'ultimate-member' ), )
@@ -79,7 +79,9 @@ class UM_Search_Widget extends \WP_Widget {
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'ultimate-member' ); ?>:</label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text"
value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php