I have same problems with xhamster importer. Is it possibly to fix it and add sexoficator.com tube?
Thread Starter
Peter
(@hardpeter4u)
@almendos
Hey, sexoficator.com is getting their videos from xhamster so I don’t think you can add sexoficator.com as such. You still need xhamster.
I’ve switched and added codes for these sites to my functions.php file in my theme.
For xhamster I have used the following which works:
add_action( 'init', function()
{
wp_embed_register_handler(
'xhamster',
'#https://xhamster\.com/movies/([\d]+)/?#i',
'wp_embed_handler_xhamster'
);
} );
function wp_embed_handler_xhamster( $matches, $attr, $url, $rawattr )
{
$embed = sprintf(
'<iframe src="http://xhamster.com/xembed.php?video=%1$s" width="510" height="400" frameborder="0" scrolling="no" allowfullscreen></iframe>',
esc_attr( $matches[1] )
);
return apply_filters( 'embed_xhamster', $embed, $matches, $attr, $url, $rawattr );
}
Hope that helps. You can follow the above to add other sites such as xvideos,pornhub, etc.
Thanks for your help, Peter!
Looks it works now!
Anonymous User 14845682
(@anonymized-14845682)
Thx Peter for putting work into it 🙂 Did you manage to make a new plugin from it or can you maintain this? I had no time, because I am currently studying C# and programming more in a Desktop Environment. Also my code here is really messed up and not really good from a wordpress point of view.
Wishing you a great day.