mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed #1197;
This commit is contained in:
@@ -1,30 +1,37 @@
|
||||
<?php
|
||||
namespace um\admin\core;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* Class Admin_DragDrop
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_DragDrop {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $row_data = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $exist_rows = array();
|
||||
|
||||
/**
|
||||
* Admin_DragDrop constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
add_action( 'admin_footer', array( &$this, 'load_field_order' ), 9 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update order of fields
|
||||
* Update order of fields.
|
||||
*/
|
||||
public function update_order() {
|
||||
UM()->admin()->check_ajax_nonce();
|
||||
@@ -153,12 +160,10 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
|
||||
update_option( 'um_form_rowdata_' . $form_id, $this->row_data );
|
||||
|
||||
UM()->query()->update_attr( 'custom_fields', $form_id, $fields );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load form to maintain form order
|
||||
* Load form to maintain form order.
|
||||
*/
|
||||
public function load_field_order() {
|
||||
|
||||
@@ -233,7 +238,7 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
|
||||
|
||||
<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 esc_attr( 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">
|
||||
|
||||
@@ -244,6 +249,5 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* Class Fields
|
||||
* @package um\core
|
||||
@@ -3886,9 +3885,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$um_field_checkbox_item_title = $v;
|
||||
|
||||
$v = $this->filter_field_non_utf8_value( $v );
|
||||
$v = $this->filter_field_non_utf8_value( $v );
|
||||
$value_attr = ( ! empty( $v ) && is_string( $v ) ) ? wp_strip_all_tags( $v ) : $v;
|
||||
|
||||
$output .= '<input ' . $disabled . ' type="checkbox" name="' . esc_attr( $key ) . '[]" value="' . strip_tags( $v ) . '" ';
|
||||
$output .= '<input ' . $disabled . ' type="checkbox" name="' . esc_attr( $key ) . '[]" value="' . esc_attr( $value_attr ) . '" ';
|
||||
|
||||
if ( $this->is_selected( $key, $v, $data ) ) {
|
||||
$output .= 'checked';
|
||||
@@ -3897,10 +3897,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= ' />';
|
||||
|
||||
if ( ! empty( $disabled ) && $this->is_selected( $key, $v, $data ) ) {
|
||||
$output .= $this->disabled_hidden_field( $key . '[]', strip_tags( $v ) );
|
||||
$output .= $this->disabled_hidden_field( $key . '[]', $value_attr );
|
||||
}
|
||||
|
||||
|
||||
$output .= '<span class="um-field-checkbox-state"><i class="' . esc_attr( $class ) . '"></i></span>';
|
||||
/**
|
||||
* UM hook
|
||||
|
||||
Reference in New Issue
Block a user