Hide content editor for posts after approriate date

I am tuning my new site and i what to disable Content Editor for post created after date X, but for posts that created before that date Content Editor must be on its place. 1 Answer 1 function disable_editor_for_old_posts_wpse_101106($post) { if (strtotime(‘-2 months’) > strtotime($post->post_date)) { remove_post_type_support(‘post’,’editor’); } } add_action(‘add_meta_boxes_post’, ‘disable_editor_for_old_posts_wpse_101106′); I couldn’t find a … Read more

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

I have this iframe and JavaScript embedded in a post: <iframe onload=”fa_iframeresize.do(this);” src=”https://example.com/calc.php?tp=dif&cl=beleggen&h=1&wf=19370&country=NL” scrolling=”no” width=”100%” style=”padding:0px;margin:0px;border-width:0px;” frameborder=”0″> </iframe> <script type=”text/javascript” src=”https://example.com/iframeResizeMe.min.js.gz”></script> But whenever I go to the visual editor the HTML gets changed tiny bit in such a way that example.com’s code can’t handle it anymore: <iframe style=”padding: 0px; margin: 0px; border-width: 0px;” src=”https://example.com/calc.php?tp=dif&amp;cl=beleggen&amp;h=1&amp;wf=19370&amp;country=NL” width=”100%” … Read more

Adding image to visual editor popup for shortcode with wp.media and wp.mce: changing image duplicates shortcode

tl;dr: Why does using media manager popup within a TinyMCE popup cause duplications of shortcodes? Is it my code or just the way life is? [Spoiler: It was my code] I’ve written a small plugin to create a visual editor button and popup that inserts a shortcode representing a “media object”: image to right, text … Read more

Customising the WordPress TinyMce editor and it’s buttons

I’m trying to cutomise the TinyMce editor within WordPress and I took this code from an older WP site I did, but the buttons I have set don’t seem to be working, for example, this is what I have: add_filter( ‘tiny_mce_before_init’, ‘blm_format_tiny_mce’ ); function blm_format_tiny_mce( $in ) { $in[‘remove_linebreaks’] = true; $in[‘convert_newlines_to_brs’] = false; $in[‘keep_styles’] … Read more