@@ -369,11 +369,14 @@ public function get_object_type() {
369369 * @return string the content
370370 */
371371 public function get_content () {
372+ global $ post ;
373+
372374 if ( $ this ->content ) {
373375 return $ this ->content ;
374376 }
375377
376- $ post = $ this ->post ;
378+ // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
379+ $ post = $ this ->post ;
377380 $ content = $ this ->get_post_content_template ();
378381
379382 // Fill in the shortcodes.
@@ -386,7 +389,7 @@ public function get_content() {
386389 $ filtered_content = \apply_filters ( 'activitypub_the_content ' , $ content , $ post );
387390 $ decoded_content = \html_entity_decode ( $ filtered_content , \ENT_QUOTES , 'UTF-8 ' );
388391
389- $ content = \trim ( \preg_replace ( '/[\n\r]/ ' , '' , $ content ) );
392+ $ content = \trim ( \preg_replace ( '/[\n\r\t ]/ ' , '' , $ content ) );
390393
391394 $ this ->content = $ content ;
392395
@@ -455,29 +458,4 @@ public static function upgrade_post_content_template() {
455458
456459 return $ content ;
457460 }
458-
459- /**
460- * Adds all tags as hashtags to the post/summary content
461- *
462- * @param string $content
463- * @param WP_Post $post
464- *
465- * @return string
466- */
467- public function get_the_mentions () {
468- $ post = $ this ->post ;
469- $ tags = \get_the_tags ( $ post ->ID );
470-
471- if ( ! $ tags ) {
472- return '' ;
473- }
474-
475- $ hash_tags = array ();
476-
477- foreach ( $ tags as $ tag ) {
478- $ hash_tags [] = \sprintf ( '<a rel="tag" class="u-tag u-category" href="%s">#%s</a> ' , \get_tag_link ( $ tag ), $ tag ->slug );
479- }
480-
481- return \implode ( ' ' , $ hash_tags );
482- }
483461}
0 commit comments