mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 21:53:43 +09:00
- added escape functions, security fix for XSS;
This commit is contained in:
@@ -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 ); ?>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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'];
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
<?php _e('If'); ?>
|
||||
<?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 & Drop Photo';
|
||||
if ( $this->set_field_type == 'file' ) $value = 'Drag & Drop File';
|
||||
if ( $this->set_field_type == 'image' ) {
|
||||
$value = __( 'Drag & Drop Photo', 'ultimate-member' );
|
||||
}
|
||||
if ( $this->set_field_type == 'file' ) {
|
||||
$value = __( 'Drag & 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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
<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> <a href="'.$ignore.'" class="button">' . __('Undo','ultimate-member') . '</a></p>';
|
||||
|
||||
@@ -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 ) ? '' : '§ion=' . $name ) ) . '" class="' . $active . '">'
|
||||
$subtabs .= '<a href="' . esc_url( admin_url( 'admin.php?page=um_options' . ( empty( $current_tab ) ? '' : '&tab=' . $current_tab ) . ( empty( $name ) ? '' : '§ion=' . $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(); ?>
|
||||
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user