Replies
Hi to anyone this could help.
How block a domain from embeding video in wordpress.
This my own hack ,– it works good
if domain is a native WP embed change the format string
setting to false. If the domain to be blocked is not in the
list of WP native embeds but its working and causing
problems, pick a domain in the code list you don’t care about.
Replace that domain with the one you want to block in that
code string This will break it because it will be the wrong
format. it will no longer embed- but activity plus using the
link option will post the video as a link with an image
and text.————————–
Source fileyourdomain.com\wp-includes\class-oembed.php
———- class-oembed.php
————————————————-
Example
( Original )‘#https?://(www\.)?soundcloud\.com/.*#i’ => array( ‘https://soundcloud.com/oembed’, true
),
————————————————–( Hack )
‘#https?://(www\.)?domain\.com/.*#i’ => array( ‘https://domain.com/oembed’, true ),
————————————————–
Hi Brajesh
Activity Plus reloaded
version 1.1.0.Tryed the new plug.
———————————————————————
bp-activity-plus-reloaded.php// Override image limit in wp-config.php.
if ( ! defined( ‘BPFB_IMAGE_LIMIT’ ) ) {
define( ‘BPFB_IMAGE_LIMIT’, 1 );
}
———————————————————————
When this code is changed to a new number.
The preview and the post adjust to the new number
with a message warning when trying to upload more.
Great !There is a issue with the remote image.
The preview will create one more input form and image
than the coded number limit.
—- But only the correct number will be posted.The glitch is in the preview. Maybe, you guys could
fix that and repost 1.1.0 ?Thank you
webfriendHi Brajesh
Activity Plus reloaded
version 1.1.0.Can’t find it ? could you place it on the download
page.https://buddydev.com/plugins/bp-activity-plus-reloaded/
Thank you
webfriendHi
BrajeshThanks, both of these are working in — bp-custom.php
add_filter( ‘bp_use_oembed_in_activity’, ‘__return_false’ );
add_filter( ‘bp_use_embed_in_activity_replies’, ‘__return_false’ );
Embeds are now cut off of buddypress except when using
—- activity plus reloaded—- to post . which limits embeds to
one per post.Mabey somebody at stackoverflow.com will have some code
to filter or blacklist domains / providers from buddypress embeds.if it works I will come back to post it here.
Thanks
webfriendHi
BrajeshUnknown, used my browsers web developer, all content
paths have been changed by a plug. It is likely wp . they look
like mineyesterday I discoverd that this code in theme functions
add_filter( ‘bp_use_oembed_in_activity’, ‘__return_false’ );doesn’t stop embeds in activity commenting, 20 videos or
more will embed on one commentit doesn’t work at all in bp-custom.php
What this situation needs for all people using
buddypress, is some code to restrict buddypress
to -one- embed per post or commentand a way to block a domain from embeding.
That would be awesome
Thanks webfriend
Hi,
Thank you for the reply.I investigated ,went into wp includes folder
looked at file– class-oembed.php
there is a block of code with all providers , each one can
be marked, true or falsethe domain giving me problems isn’t in there, some how its working.
do you know of a buddypress or wp plug that will —
add or remove providersis there theme functions or bp-custom.php snip of code that will
add provider or remove provider?Thanks
webfriendHi Brajesh
Wow ! thanks for the quick response, I should have checked
back sooner.I found this on buddydev.com — BuddyPress Tutorials
—-Link
https://buddydev.com/disabling-oembed-support-buddypress-activity/—-Code for wp ( theme functions )
add_filter( ‘bp_use_oembed_in_activity’, ‘__return_false’ );
This stopped buddypress from embedding video with URL in activity post
/ comment., — now video embed functions only when activity plus is used .
Great ! !Could you help with one more thing ? video coming from one
website is causing problems.
How can I tweek activity plus so that it will deny / stop a video embed
coming from a specific domain.com .
In other words — youtube.com , yes / vimeo.com , yes /
dailymotion.com , yes / ——- crazy.com , NO !Thanks for your help !
Webfriend