AnsPress_Comment_Hooks::comment_link( string $link, WP_Comment $comment, array $args )
Description #
Manipulate question and answer comments link.
Parameters #
- $linkstring (Required) The comment permalink with '#comment-$id' appended.
- $commentWP_Comment (Required) The current comment object.
- $argsarray (Required) An array of arguments to override the defaults.
Source #
File: includes/comments.php
public static function comment_link( $link, $comment, $args ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed $_post = ap_get_post( $comment->comment_post_ID ); if ( ! in_array( $_post->post_type, array( 'question', 'answer' ), true ) ) { return $link; } $permalink = get_permalink( $_post ); return $permalink . '#/comment/' . $comment->comment_ID; }
Expand full source code Collapse full source code View on GitHub: includes/comments.php:167
Add your comment