From 9505d225020511c395a071513f4bcbeb03370161 Mon Sep 17 00:00:00 2001 From: andrewshuba Date: Tue, 23 Feb 2021 14:41:21 +0200 Subject: [PATCH] - add mycred meta data to a user meta table --- includes/admin/core/class-admin-settings.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 53a8e21e..d97c575f 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -127,6 +127,16 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { $metakeys[] = '_completed'; $metakeys[] = '_reviews_avg'; + //myCred meta + if ( function_exists( 'mycred_get_types' ) ) { + $mycred_types = mycred_get_types(); + if ( ! empty( $mycred_types ) ) { + foreach ( array_keys( $mycred_types ) as $point_type ) { + $metakeys[] = $point_type; + } + } + } + $sortby_custom_keys = $wpdb->get_col( "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key='_um_sortby_custom'" ); if ( empty( $sortby_custom_keys ) ) { $sortby_custom_keys = array();