请尝试以下方法:
add_action('manage_users_columns','account_verification_status_column'); function account_verification_status_column($column_headers) { unset($column_headers['posts']); $column_headers['account_verification'] = __('Verification Status'); return $column_headers; } add_filter( 'manage_users_sortable_columns', 'make_verification_status_column_sortable' ); function make_verification_status_column_sortable( $vars ) { $columns['account_verification'] = 'account_verification'; return $columns; } add_filter('manage_users_custom_column', 'add_user_column_value', 10, 3); function add_user_column_value( $value, $column_name, $user_id ){ if ( 'account_verification' == $column_name ){ if( get_user_meta( $user_id, 'is_activated', true ) == 1 ){ $value = '<span style="color:green;font-weight:bold;">Verified</span>'; } else { $value = '<span class="na" style="color:grey;"><em>Not Verified</em></span>'; } } return $value; }
代码位于活动子主题(活动主题)的function.php文件中。经过测试和工作。