Tag Info

New answers tagged


At the moment WordPress only recognises youtube.com/watch, youtube.com/playlist and youtu.be. However there is wp_oembed_add_provider; try something like wp_oembed_add_provider( '#http://(www\.)?youtube-nocookie\.com/embed.*#i', 'http://www.youtube-nocookie.com/oembed', true ); (untested sorry). You could even overwrite the existing providers to ...


If you're referring to images that are inserted into the page or post content via the editor, you could hook into the 'the_content' filter, check if the visitor is anonymous or not via is_user_logged_in(), and use a regex to remove all img tags from the_content(). I'm mobile at the moment, but I'm happy to update this a little later with some example code.


Have you had a look at is_user_logged_in()? If you can explain how you're serving the photos I can perhaps suggest a way to authorize some images to be shown and the rest hidden to only logged in users.

Top 50 recent answers are included