From 7a7ea3350a72e2272d3136faeceb7e65c2868cef Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 12 Mar 2019 22:18:20 +0100 Subject: [PATCH] fixed default value problem --- includes/class-hashtag.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/class-hashtag.php b/includes/class-hashtag.php index 1546ffe..d1f46e1 100644 --- a/includes/class-hashtag.php +++ b/includes/class-hashtag.php @@ -15,7 +15,7 @@ class Hashtag { add_filter( 'wp_insert_post', array( '\Activitypub\Hashtag', 'insert_post' ), 99, 2 ); add_filter( 'the_content', array( '\Activitypub\Hashtag', 'the_content' ), 99, 2 ); } - if ( '1' === get_option( 'activitypub_add_tags_as_hashtags', '1' ) ) { + if ( '1' === get_option( 'activitypub_add_tags_as_hashtags', '0' ) ) { add_filter( 'activitypub_the_summary', array( '\Activitypub\Hashtag', 'add_hashtags_to_content' ), 10, 2 ); add_filter( 'activitypub_the_content', array( '\Activitypub\Hashtag', 'add_hashtags_to_content' ), 10, 2 ); } @@ -26,6 +26,8 @@ class Hashtag { * * @param int $id the rev-id * @param array $data the post-data as array + * + * @return */ public static function insert_post( $id, $data ) { if ( preg_match_all( '/' . ACTIVITYPUB_HASHTAGS_REGEXP . '/i', $data->post_content, $match ) ) { @@ -41,6 +43,8 @@ class Hashtag { * Filter to replace the #tags in the content with links * * @param string $the_content the post-content + * + * @return string the filtered post-content */ public static function the_content( $the_content ) { $the_content = preg_replace_callback( '/' . ACTIVITYPUB_HASHTAGS_REGEXP . '/i', array( '\Activitypub\Hashtag', 'replace_with_links' ), $the_content );