Skip to content

Commit 1b0b6d2

Browse files
authored
Updates
1 parent 18de163 commit 1b0b6d2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

class-optimizations-ace-mc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public function add_user_order_count_column( $columns ) {
120120
* @return string
121121
*/
122122
public function display_user_order_count_column( $output, $column_name, $user_id ) {
123+
// Security check - only for admins with list_users capability
124+
if ( ! is_admin() || ! current_user_can( 'list_users' ) ) {
125+
return $output;
126+
}
127+
123128
if ( 'user_order_count' === $column_name ) {
124129
$order_count = wc_get_customer_order_count( absint( $user_id ) );
125130
return esc_html( number_format_i18n( $order_count ) );
@@ -224,6 +229,11 @@ public function add_user_registration_date_column( $columns ) {
224229
* @return string
225230
*/
226231
public function display_user_registration_date_column( $output, $column_name, $user_id ) {
232+
// Security check - only for admins with list_users capability
233+
if ( ! is_admin() || ! current_user_can( 'list_users' ) ) {
234+
return $output;
235+
}
236+
227237
if ( 'registration_date' === $column_name ) {
228238
$registration_date = get_the_author_meta( 'registered', absint( $user_id ) );
229239
if ( $registration_date ) {

0 commit comments

Comments
 (0)