DragDropBuilder
1 month ago
EmailSettings
1 year ago
Membership
1 month ago
AbstractSettingsPage.php
2 years ago
AddNewForm.php
1 year ago
AdminFooter.php
4 years ago
ExtensionsSettingsPage.php
1 year ago
FormList.php
4 months ago
Forms.php
1 year ago
FuseWP.php
3 years ago
GeneralSettings.php
9 months ago
IDUserColumn.php
5 years ago
LicenseUpgrader.php
3 years ago
MailOptin.php
3 years ago
MemberDirectories.php
1 year ago
MembersDirectoryList.php
4 years ago
ToolsSettingsPage.php
4 years ago
index.php
3 years ago
IDUserColumn.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePress\Core\Admin\SettingsPages; |
| 4 | |
| 5 | class IDUserColumn |
| 6 | { |
| 7 | public function __construct() |
| 8 | { |
| 9 | add_filter('manage_users_columns', [$this, 'add_user_id_column'], 999999); |
| 10 | add_action('manage_users_custom_column', [$this, 'show_user_id'], 10, 3); |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * @param $columns |
| 15 | * |
| 16 | * @return mixed |
| 17 | */ |
| 18 | public function add_user_id_column($columns) |
| 19 | { |
| 20 | $columns['ppress_user_id'] = __('ID', 'wp-user-avatar'); |
| 21 | |
| 22 | return $columns; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @param $value |
| 27 | * @param $column_name |
| 28 | * @param $user_id |
| 29 | * |
| 30 | * @return mixed |
| 31 | */ |
| 32 | public function show_user_id($value, $column_name, $user_id) |
| 33 | { |
| 34 | if ('ppress_user_id' == $column_name) { |
| 35 | |
| 36 | $value = $user_id; |
| 37 | } |
| 38 | |
| 39 | return $value; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @return self |
| 44 | */ |
| 45 | public static function get_instance() |
| 46 | { |
| 47 | static $instance = null; |
| 48 | |
| 49 | if (is_null($instance)) { |
| 50 | $instance = new self(); |
| 51 | } |
| 52 | |
| 53 | return $instance; |
| 54 | } |
| 55 | } |