Skip to content

Commit

Permalink
Merge pull request #2658 from kprajapatii/master
Browse files Browse the repository at this point in the history
Email tags added for comment link & comment post link - ADDED
  • Loading branch information
kprajapatii authored Aug 21, 2024
2 parents 6bfb451 + bd8a360 commit 09ac90d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/admin/settings/class-geodir-settings-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public function owner_comment_approved_email_tags( $inline = true ) {
public function author_comment_approved_email_tags( $inline = true ) {
$global_tags = $this->global_email_tags( false );

$tags = array_merge( $global_tags, array( '[#post_id#]', '[#post_status#]', '[#post_date#]', '[#post_author_ID#]', '[#post_author_name#]', '[#client_name#]', '[#listing_title#]', '[#listing_url#]', '[#listing_link#]', '[#comment_ID#]', '[#comment_author#]', '[#comment_author_IP#]', '[#comment_author_email#]', '[#comment_date#]', '[#comment_content#]', '[#comment_post_ID#]', '[#comment_post_title#]', '[#comment_post_url#]', '[#review_rating_star#]', '[#review_rating_title#]', '[#review_city#]', '[#review_region#]', '[#review_country#]', '[#review_latitude#]', '[#review_longitude#]' ) );
$tags = array_merge( $global_tags, array( '[#post_id#]', '[#post_status#]', '[#post_date#]', '[#post_author_ID#]', '[#post_author_name#]', '[#client_name#]', '[#listing_title#]', '[#listing_url#]', '[#listing_link#]', '[#comment_ID#]', '[#comment_author#]', '[#comment_author_IP#]', '[#comment_author_email#]', '[#comment_date#]', '[#comment_content#]', '[#comment_url#]', '[#comment_post_ID#]', '[#comment_post_title#]', '[#comment_post_url#]', '[#comment_post_link#]', '[#review_rating_star#]', '[#review_rating_title#]', '[#review_city#]', '[#review_region#]', '[#review_country#]', '[#review_latitude#]', '[#review_longitude#]' ) );

$tags = apply_filters( 'geodir_email_author_comment_approved_email_tags', $tags );

Expand Down
2 changes: 1 addition & 1 deletion includes/class-geodir-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ public static function get_overall_box_html( $post_id ) {
<div class="card border-0 rounded bg-transparent-primary bg-primary bg-opacity-10" >
<div class="card-body text-center text-dark">
<div class="mb-1">
<?php echo $rating_titles[ $post_rating_rounded ]; ?>
<?php echo ( isset( $rating_titles[ $post_rating_rounded ] ) ? $rating_titles[ $post_rating_rounded ] : '' ); ?>
</div>
<div class="mb-1 display-5">
<?php echo round( $post_rating, 1 ); ?>
Expand Down
2 changes: 2 additions & 0 deletions includes/class-geodir-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ public static function replace_variables( $content, $email_name = '', $email_var
$replace_array['[#comment_author_email#]'] = $comment->comment_author_email;
$replace_array['[#comment_date#]'] = $comment->comment_date;
$replace_array['[#comment_content#]'] = wp_specialchars_decode( $comment->comment_content );
$replace_array['[#comment_url#]'] = get_comment_link( $comment );
$replace_array['[#comment_post_ID#]'] = (int) $comment->comment_post_ID;
$replace_array['[#comment_post_title#]'] = html_entity_decode( get_the_title( (int) $comment->comment_post_ID ), ENT_COMPAT, 'UTF-8' );
$replace_array['[#comment_post_url#]'] = get_permalink( (int) $comment->comment_post_ID );
$replace_array['[#comment_post_link#]'] = '<a href="' . esc_url( $replace_array['[#comment_url#]'] ) . '">' . $replace_array['[#comment_post_title#]'] . '</a>';
$replace_array['[#comment_approve_link#]'] = admin_url( "comment.php?action=approve&c={$comment_ID}#wpbody-content" );
$replace_array['[#comment_trash_link#]'] = admin_url( "comment.php?action=trash&c={$comment_ID}#wpbody-content" );
$replace_array['[#comment_spam_link#]'] = admin_url( "comment.php?action=spam&c={$comment_ID}#wpbody-content" );
Expand Down
2 changes: 1 addition & 1 deletion includes/comments-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function geodir_new_comment_notify_postauthor( $comment_ID ) {
}

// Only send notifications for approved or pending comments.
if ( $maybe_notify && ! ( in_array( 'comment_approved', array_keys( (array) $comment ) ) && ( $comment->comment_approved == '0' || $comment->comment_approved == 'hold' || $comment->comment_approved == '1' || $comment->comment_approved == 'approve' ) ) ) {
if ( $maybe_notify && ! ( in_array( 'comment_approved', array_keys( (array) $comment ) ) && ( $comment->comment_approved == '0' || $comment->comment_approved === 'hold' || $comment->comment_approved == '1' || $comment->comment_approved === 'approve' ) ) ) {
$maybe_notify = false;
}

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ We don't offer free trials, but we have a 30-day money-back guarantee if you are

__WARNING: GDv2 is a significant update over GDv1 and may require manual work, such as adding widgets to sidebars to recreate your current layout. As always, we recommend trying this on a staging site first. [Learn more](https://docs.wpgeodirectory.com/article/260-upgrading-from-gdv1-to-gdv2)__

= GeoDirectory v2.3.74 - TBD =
* Email tags added for comment link & comment post link - ADDED

= GeoDirectory v2.3.73 - 2024-08-15 =
* GD > A-Z Search block added to list the listings alphabetically order - ADDED

Expand Down
6 changes: 3 additions & 3 deletions templates/bootstrap/reviews/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see https://docs.wpgeodirectory.com/article/346-customizing-templates/
* @package GeoDirectory\Templates
* @version 2.3.7
* @version 2.3.74
*
* Variables.
*
Expand Down Expand Up @@ -71,7 +71,7 @@
<!-- .comment-meta -->

<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'geodirectory' ); ?></p>
<p class="comment-awaiting-moderation alert alert-warning m-3 mb-1 py-2"><?php _e( 'Your comment is awaiting moderation.', 'geodirectory' ); ?></p>
<?php endif; ?>

<div class="comment-content comment card-body m-0">
Expand All @@ -96,7 +96,7 @@
edit_comment_link( __( 'Edit', 'geodirectory' ), '<span class="edit-link btn btn-link">', '</span>' );
do_action( "geodir_comment_links_after_edit" , $comment );

if ( geodir_user_can_reply_review( $comment ) ) {
if ( geodir_user_can_reply_review( $comment ) && '0' != $comment->comment_approved ) {
?>
<span class="reply-link">
<?php $reply_link = get_comment_reply_link( array_merge( $args, array(
Expand Down

0 comments on commit 09ac90d

Please sign in to comment.