Attachments.php
2 days ago
Author.php
2 days ago
BeforeMoreContent.php
2 days ago
CommentCount.php
2 days ago
CommentsForPostLink.php
2 days ago
ContentExcerpt.php
2 days ago
DatePublishFormatted.php
2 days ago
Depth.php
2 days ago
DescriptivePostStatus.php
2 days ago
DiscussionStatus.php
2 days ago
Excerpt.php
2 days ago
ExcerptMissingMessage.php
2 days ago
ExcerptRaw.php
2 days ago
FeaturedImage.php
2 days ago
HasCommentStatus.php
2 days ago
IsPasswordProtected.php
2 days ago
IsSticky.php
2 days ago
LastModifiedAuthor.php
2 days ago
Meta.php
2 days ago
ModifiedDate.php
2 days ago
Order.php
2 days ago
PageTemplate.php
2 days ago
Path.php
2 days ago
Permalink.php
2 days ago
PingStatus.php
2 days ago
PostContent.php
2 days ago
PostDate.php
2 days ago
PostDateTimestamp.php
2 days ago
PostFormat.php
2 days ago
PostFormatIcon.php
2 days ago
PostFormatLabel.php
2 days ago
PostLink.php
2 days ago
PostParentId.php
2 days ago
PostReferences.php
2 days ago
PostStatus.php
2 days ago
PostStatusIcon.php
2 days ago
PostTerms.php
2 days ago
PostTermsOriginal.php
2 days ago
PostTitle.php
2 days ago
Property.php
2 days ago
ShortLink.php
2 days ago
Shortcodes.php
2 days ago
Slug.php
2 days ago
Slug.php
18 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Formatter\Post; |
| 6 | |
| 7 | use AC\Formatter; |
| 8 | use AC\Type\Value; |
| 9 | |
| 10 | class Slug implements Formatter |
| 11 | { |
| 12 | public function format(Value $value): Value |
| 13 | { |
| 14 | return $value->with_value(urldecode((string)get_post_field('post_name', $value->get_id(), 'raw'))); |
| 15 | } |
| 16 | |
| 17 | } |
| 18 |