Opened 18 months ago
Last modified 17 months ago
#58700 new defect (bug)
wp_set_comment_status() modifies post_content
Reported by: | tweakfreaks | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 6.2.2 |
Component: | Comments | Keywords: | |
Focuses: | Cc: |
Description
I've created a standalone PHP script that runs on cron and uses wp_set_comment_status() to automatically approve select comments (based on user name, ip address, etc).
When a comment is approved, if the post_content contains a video tag, the video tag is rewritten.
From :
<video controls loop width="400" preload="none" poster="https://example.com/images/poster.jpg"><source src="https://example.com/videos/video.mp4" type="video/mp4"></video>
To :
<video controls loop width="400" preload="none" poster="https://example.com/images/poster.jpg"></video>
My code :
<?php require_once('/example.com/wp-load.php'); ... ... if ( $curTime > $comTime ) { wp_set_comment_status($comment_id, 'approve', false); }
Any idea why this is happening? I've had to go back and edit a lot of posts due to this issue.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Do you have a plugin installed to enable video embedding/uploading in comments?
I attempted to add a comment containing a video tag, but WordPress removed it entirely. This leads me to believe that you might be utilizing a specific plugin for this purpose. If that is the case, kindly inform me about the plugin you are using. Alternatively, if no such plugin is in place, please provide guidance on how you are incorporating a video in a comment.