I'm trying to send emails showing my post contents when I publish something on my site. However, my posts have videos so I'm trying to remove that from the emails that go out. Here is the current code using
// Get post description
$post_description_length = 1000;
$post_description = $post->post_content;
$post_description = strip_tags( strip_shortcodes($post_description ) );
$words = explode( ' ', $post_description, $post_description_length + 1 );
With the above, it removes the video from my post. However, my posts are in bullet point format so with the above code, it is stripping all the tags so my post loses formatting once it becomes an email and just becomes one big paragraph. How can I edit the above so it just focuses on the shortcode for the video. The video uses a shortcode 'videopack' to display the video from my server on my posts. ex. [videopack id="293877"]Video link here[/videopack]
strip_tags()
?[videopack][/videopack] <strong>INCIDENT DATE/TIME</strong>: <strong>LOCATION</strong>: <strong>CITY</strong>: <strong>DETAILS</strong>: <ol> <li>Detail</li> </ol> <strong>HANDLING AGENCIES</strong>: <strong>SOT(s)</strong>: N/A
strip_tags()
in the one line like this -$post_description = strip_shortcodes($post_description );
- what result do you get?