有什么方法可以在所有注冊用戶“users.php”的串列中顯示元資料

uj5u.com熱心網友回復:
在 user.php 中添加自定義列
function new_modify_user_table( $column ) {
$column['custom_metadata'] = 'Custom Mtadata';
return $column;
}
add_filter( 'manage_users_columns', 'new_modify_user_table' );
function new_modify_user_table_row( $val, $column_name, $user_id ) {
switch ($column_name) {
case 'custom_metadata' :
$first_name = get_the_author_meta( 'first_name', $user_id );
return $first_name;
break;
default:
}
return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
https://prnt.sc/21ct42s
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/373142.html
標籤:WordPress的 用户界面 元数据 行政
