Support » Plugin: Comment Images Reloaded » Re-adding Images

  • I started using the WPDiscuz plugin and it seems that Comment Images Reloaded doesn’t work here. Is it possible to add a little bit of code to the wpDiscuz files (I am happy to do) that will allow that plugin to render the old comments that have images from this plugin? Or is there a better solution?

Viewing 1 replies (of 1 total)
  • I managed to figure it out.

    The below was used to hook into the loop for WPDiscuz that outputs the comments. Checking if there is a meta value stored under the key ‘comment_image_reloaded’, if so then append the image to the bottom of the comment.

    function legacy_comment_images($commentContent, $comment, $args) {
    
    	$attachment = get_comment_meta( $comment->comment_ID , 'comment_image_reloaded', true );
    	
    	if ( $attachment != null ){
    			$commentContent .= wp_get_attachment_image($attachment[0], 'medium');
    	}
    	
    	return $commentContent;
    }
    
    add_filter('wpdiscuz_comment_text', 'legacy_comment_images', 10, 3);
    • This reply was modified 3 years, 6 months ago by twcstuff.
    • This reply was modified 3 years, 6 months ago by twcstuff.
Viewing 1 replies (of 1 total)
  • The topic ‘Re-adding Images’ is closed to new replies.