Channels.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Formatter\Media\Audio; |
| 6 | |
| 7 | use AC\Formatter; |
| 8 | use AC\Type\Value; |
| 9 | |
| 10 | class Channels implements Formatter |
| 11 | { |
| 12 | public function format(Value $value): Value |
| 13 | { |
| 14 | return $value->get_value() > 0 |
| 15 | ? $value->with_value( |
| 16 | sprintf( |
| 17 | '%s %s', |
| 18 | number_format($value->get_value()), |
| 19 | _n('channel', 'channels', $value->get_value(), 'codepress-admin-columns') |
| 20 | ) |
| 21 | ) |
| 22 | : $value; |
| 23 | } |
| 24 | |
| 25 | } |
| 26 |