• I’m not sure whether it’s actually worth posting this, as you seem reluctant to include even the simplest fixes, but here goes!

    The {answer_link} shortcode for emails currently has two problems. First, it’s not documented on the DWQA Settings Email tab for New Answer Notifications.

    Second, it doesn’t actually link to the answer at all, but simply to the question. The problem here is line 146 in /inc/Notifications.php

    It currently says:
    $message = str_replace( '{answer_link}', get_permalink( $question_id ) . '#answer-' . $answer_id, $message );

    It should actually say:
    $message = str_replace( '{answer_link}', get_permalink( $answer_id ), $message );

    Anyone clicking on this link should now be taken to the correct location. I say “should,” but you also need to make another change I suggested months ago: https://wordpress.org/support/topic/suggested-improvement-answer-redirection/

    That requires that you change this line in /inc/template.php:
    wp_safe_redirect( get_permalink( $question_id ) );

    to this:
    wp_safe_redirect( get_permalink( $question_id ) . '#' . get_the_id() . '');

    • This topic was modified 7 years, 7 months ago by KTS915.
Viewing 1 replies (of 1 total)
  • Plugin Author DesignWall

    (@designwall)

    Hi,
    Thanks for your contribution to this plugin. It helps us a lot.
    We’ll consider and update in the next version.
    Warm Regards,
    DesignWall team.

Viewing 1 replies (of 1 total)
  • The topic ‘Correct {answer_link} shortcode in emails’ is closed to new replies.