AuthorSlugFactory.php
1 day ago
CommentCountFactory.php
1 day ago
DescriptionFactory.php
1 day ago
DisplayNameFactory.php
1 day ago
FirstNameFactory.php
1 day ago
FirstPostFactory.php
1 day ago
FullNameFactory.php
1 day ago
LastNameFactory.php
1 day ago
LastPostFactory.php
1 day ago
NicknameFactory.php
1 day ago
PostCountFactory.php
1 day ago
RegisteredDateFactory.php
1 day ago
ShowToolbarFactory.php
1 day ago
UserIdFactory.php
1 day ago
UserNameFactory.php
1 day ago
UserUrlFactory.php
1 day ago
VisualEditingFactory.php
1 day ago
UserNameFactory.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\ColumnFactory\User; |
| 6 | |
| 7 | use AC; |
| 8 | use AC\Column\BaseColumnFactory; |
| 9 | use AC\FormatterCollection; |
| 10 | use AC\Setting\Config; |
| 11 | |
| 12 | class UserNameFactory extends BaseColumnFactory |
| 13 | { |
| 14 | public function get_label(): string |
| 15 | { |
| 16 | return __('Username', 'codepress-admin-columns'); |
| 17 | } |
| 18 | |
| 19 | public function get_column_type(): string |
| 20 | { |
| 21 | return 'column-user_login'; |
| 22 | } |
| 23 | |
| 24 | protected function get_formatters(Config $config): FormatterCollection |
| 25 | { |
| 26 | $formatters = parent::get_formatters($config); |
| 27 | |
| 28 | $formatters->add(new AC\Formatter\User\UserName()); |
| 29 | |
| 30 | return $formatters; |
| 31 | } |
| 32 | |
| 33 | } |
| 34 |