Title: Bug fix for [post-link]
Last modified: February 27, 2017

---

# Bug fix for [post-link]

 *  [wpweaver](https://wordpress.org/support/users/wpweaver/)
 * (@wpweaver)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/bug-fix-for-post-link/)
 * Your 1.0.1 version has 2 bugs in one statement.
 * The line
 * `$patternData['[post-link]'] = 'topic' !== $post->post_type ? bbp_get_reply_url(
   $post_id ) : get_the_permalink($post_id);`
 * will work MUCH better if you use:
 * `patternData['[post-link]'] = bbp_get_reply_url( bbp_get_reply_id( $post->ID ));`
 * This makes mentions from **both** topics and replies give the correct link. The
   fix comes from bbPress’s subscription code. Before, topics was generating a link
   to the page where the topic form was, which is not really correct in many cases.
 * And although with my fix it is not relevant, I think you must have meant $post-
   >ID instead of $post_id in your original.
 * Users of my forum pointed out the problem.

Viewing 1 replies (of 1 total)

 *  anonymized-13749270
 * (@anonymized-13749270)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/bug-fix-for-post-link/#post-8854710)
 * Hello there wpweaver,
 * Thank you so much for taking time to report this bug. Yes it makes sense I was
   pulling the permalink regardless of bbPress API which you pointed out, and apparently
   [`get_the_permalink`](https://developer.wordpress.org/reference/functions/get_post/)
   defaults the post id parameter (while null) to the global $post that’s how it
   called to that form page.
 * I am pushing an update shortly. Thanks again and have a good day!
 * Best,
    Samuel

Viewing 1 replies (of 1 total)

The topic ‘Bug fix for [post-link]’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bbp-mentions-email-notifications.
   svg)
 * [bbPress Mentions Email Notifications](https://wordpress.org/plugins/bbp-mentions-email-notifications/)
 * [Support Threads](https://wordpress.org/support/plugin/bbp-mentions-email-notifications/)
 * [Active Topics](https://wordpress.org/support/plugin/bbp-mentions-email-notifications/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbp-mentions-email-notifications/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbp-mentions-email-notifications/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: anonymized-13749270
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/bug-fix-for-post-link/#post-8854710)
 * Status: not resolved