Merge pull request #1190 from ultimatemember/feature/sorting_data_type

Sorting data type and order
This commit is contained in:
Mykyta Synelnikov
2023-06-12 13:21:40 +03:00
committed by GitHub
10 changed files with 228 additions and 57 deletions
+12 -3
View File
@@ -1,21 +1,18 @@
<?php
namespace um\admin;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'um\admin\Admin' ) ) {
/**
* Class Admin
* @package um\admin
*/
class Admin extends Admin_Functions {
/**
* @var string
*/
@@ -389,6 +386,12 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
'_um_sortby_custom_label' => array(
'sanitize' => 'text',
),
'_um_sortby_custom_type' => array(
'sanitize' => 'text',
),
'_um_sortby_custom_order' => array(
'sanitize' => 'text',
),
'_um_enable_sorting' => array(
'sanitize' => 'bool',
),
@@ -867,6 +870,12 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
if ( isset( $item['label'] ) ) {
$item['label'] = sanitize_text_field( $item['label'] );
}
if ( isset( $item['order'] ) ) {
$item['order'] = sanitize_text_field( $item['order'] );
}
if ( isset( $item['data_type'] ) ) {
$item['data_type'] = sanitize_text_field( $item['data_type'] );
}
return $item;
} else {