| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 3 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 7 | 26 | public function run(): string |
|
| 8 | { |
||
| 9 | 26 | $value = $this->sanitizeDisplayName($this->value()); |
|
| 10 | 26 | if (defined('WP_IMPORTING')) { |
|
| 11 | return $value; |
||
| 12 | } |
||
| 13 | 26 | if (!empty($value)) { |
|
| 14 | 22 | return $value; |
|
| 15 | } |
||
| 16 | 9 | $user = wp_get_current_user(); |
|
| 17 | 9 | if (!$user->exists()) { |
|
| 18 | 9 | return $value; |
|
| 19 | } |
||
| 20 | 2 | return $this->sanitizeDisplayName($user->display_name); |
|
| 21 | } |
||
| 40 |