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’);

Which HTTP headers to use for subdomain embedding?

I was able to figure out that because Lightsail uses a Bitnami deployment of WordPress, Bitnami overrides the .htaccess file. Instead you have to update the /opt/bitnami/apache2/conf/httpd.conf file by adding the following content: <IfModule headers_module> <IfVersion >= 2.4.7 > Header always setifempty X-Frame-Options ALLOW-FROM https://*.example.com </IfVersion> <IfVersion < 2.4.7 > Header always merge X-Frame-Options ALLOW-FROM … Read more

How to ensure the visual editor doesn’t ruin my iframe?

add_shortcode(‘custom_iframe_shortcode’, ‘build_iframe’); function build_iframe($atts) { $defaults = array( ‘source’ => ‘https://example.com/calc.php?tp=dif&cl=beleggen&h=1&wf=19370&country=NL’, ‘script_source’ => ‘//example.com/iframeResizeMe.min.js.gz’ ); $args = shortcode_atts($defaults, $atts); ob_start(); ?> <iframe onload=”fa_iframeresize.do(this);” src=”https://wordpress.stackexchange.com/questions/314518/<?php echo $args[“source’]; ?>” scrolling=”no” width=”100%” style=”padding:0px;margin:0px;border-width:0px;” frameborder=”0″> </iframe> <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/314518/<?php echo $args[“script_source’]; ?>”></script> <?php return ob_get_clean(); } then call this like [build_iframe] or [build_iframe source=”https://blah” script_source=”https://blah/blah.js’]

How do i disable/disallow and tags in TinyMCE?

Simple way, do not add content when logged in as admin user but only as author. If you want to go to somewhat extreme, remove the posting capabilities from the admin. Not sure where that will leave you with editing slugs so a proper check of permission will be needed. This answers your question as … Read more

Allow all attributes in $allowedposttags tags

I’m pretty sure you have to explicitly name all allowed attributes – just use: $allowedposttags[‘iframe’] = array ( ‘align’ => true, ‘frameborder’ => true, ‘height’ => true, ‘width’ => true, ‘sandbox’ => true, ‘seamless’ => true, ‘scrolling’ => true, ‘srcdoc’ => true, ‘src’ => true, ‘class’ => true, ‘id’ => true, ‘style’ => true, ‘border’ … Read more

Easy way to inject js in tinymce iframe?

WordPress injects its own external script files in the TinyMCE editor iframe, see for example the wp-includes/js/tinymce/plugins/wpembed/plugin.js file: (function ( tinymce ) { ‘use strict’; tinymce.PluginManager.add( ‘wpembed’, function ( editor, url ) { editor.on( ‘init’, function () { var scriptId = editor.dom.uniqueId(); var scriptElm = editor.dom.create( ‘script’, { id: scriptId, type: ‘text/javascript’, src: url + … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)