Allow iframes from specific sites?

I’d register an embed handler with wp_embed_register_handler. This gives you the added benefit of being able to just copy and paste the url into the editor as well as seeing a preview of the iframe. add_action( ‘init’, ‘se238330_register_embed_handler’ ); function se238330_register_embed_handler() { wp_embed_register_handler( ‘joetek’, ‘#http://subdomain.yourdomain\.com/(.+)/?#i’, ‘wp_embed_handler_joetek’ ); } function wp_embed_handler_embed_name( $matches, $attr, $url, $rawattr ) … Read more

metabox wordpress show in frontend

The output is escaped, so it will not display html, try this : just save the value of the src attribute <iframe src=”<?php echo esc_attr__( get_post_meta( get_the_ID(), ‘name’, true ) ); ?>” width=”670″ height=”500″>

Embed Post in external page

Prerequisite: Custom Plugin First you’ll need a small plugin. Just copypaste it into a .php file, add it to some folder, zip and upload it to your installation an you’re done. What it does This small plugin only checks if the wpembed query part is present and if it is set to true. If both … Read more

Check if page is embeded

The server doesn’t know what the client is doing with the output and as such, you’re limited in what you can assume. You may or may not have params sent in the request, referer, current uri and headers. $_REQUEST[’embed_act’] $_SERVER[‘HTTP_REFERER’] $_SERVER[‘REQUEST_URI’] get_headers() On the JS side, it might be possible. if(self==top) { //… } if( … Read more

How to save iframe tag into a post?

iframes get stripped out for security reasons, you shouldn’t be trying to put embed codes directly into post content, there are other methods, such as oembed or shortcodes. If you have the unfiltered_html capability, you can add them via the classic editor, but this capability is extremely dangerous. It also means any users who don’t … Read more

VB.net and WordPress

So I’m wondering if anyone might know how I could use VB.net for my calculators on my WordPress website. Directly? No, you can’t run .Net in a browser, and the closest available is silverlight and activeX, both of which were discontinued. As I understand it, the problem is that VB.net doesn’t run on an Apache … Read more

Resize the WP media Uploader iFrame

The default media box has hard coded HTML values so in order to alter the CSS for it you you have 2 options. Enqueue your own CSS and override the values Disable media-views.css completely and load a custom stylesheet. To enqueue your own style: function blah_admin_css() { wp_enqueue_style( ‘blah_admin_css’, path to your custom.css ); } … Read more

wp_insert_post iframe missing

remove_filter(‘content_save_pre’, ‘wp_filter_post_kses’); remove_filter(‘content_filtered_save_pre’, ‘wp_filter_post_kses’); $id = wp_insert_post( $my_post ); add_filter(‘content_save_pre’, ‘wp_filter_post_kses’); add_filter(‘content_filtered_save_pre’, ‘wp_filter_post_kses’);