Created
July 30, 2026 12:48
-
-
Save lordmatt/d40fc009ea9fedd277b6d959d8081fc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * WordPress Post Extended Transformer Class file for the ActivityPub WordPress plugim. | |
| * | |
| * There is a massive problem with this approach. I just locked all other plugins out | |
| * from ever doing something similar. The WordPress way is to supply a filter. | |
| */ | |
| namespace Activitypub\Transformer; | |
| class MoreTags extends Post { | |
| protected function get_tag() { | |
| if ( false !== $this->tags ) { | |
| return $this->tags; | |
| } | |
| $tags = parent::get_tag(); | |
| // I'm honestly surprised this was not in core | |
| $tags = apply_filters( 'activitypub_post_tags', $tags, $this->item); | |
| $this->tags = \array_unique( $tags, SORT_REGULAR ); | |
| return $this->tags; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment