Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

wpForo 1.x.x [Solved] Здравствуйте!

3 Posts
2 Users
0 Reactions
2,293 Views
Posts: 3
 gfy
Topic starter
(@gfy)
Active Member
Joined: 6 years ago

Хотелось бы ставить на форуме для участников видео с ютуба, но не могу найти как это возможно. А так форум удобный, простой в работе, за что спасибо

2 Replies
Sofy
Posts: 5486
 Sofy
Admin
(@sofy)
Support Team
Joined: 8 years ago

Hi @gfy,

Thank you for using wpForo and for contacting us. 

Please put this code in the active WordPress theme's functions.php:

add_filter('wpforo_content_after', 'wpforo_custom_video_embed', 10);
function wpforo_custom_video_embed( $content ){
$paterns = array();
$paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";
$paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtu.be\/([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";
$content = preg_replace($paterns, "<iframe width=\"420\" height=\"280\" src=\"//www.youtube.com/embed/$1\" frameborder=\"0\" allowfullscreen></iframe>", $content);
return $content;
}

For more embedding options I recommend wpForo Embeds addon:

https://gvectors.com/product/wpforo-embeds/

Posts: 3
 gfy
Topic starter
(@gfy)
Active Member
Joined: 6 years ago

Thanks!