If you run a WordPress blog, you may have noticed a problem when you try to embed the new “Add to Foursquare” button in a post. If you paste it in the HTML editor, it disappears as soon as you switch to the Visual editor. This is because WordPress’ visual editor, TinyMCE, strips iFrame content by default. Since the “Add to Foursquare” button is embedded as an iFrame, it goes out the window too.
There’s a way to fix it, however, if you have access to the functions.php file included in your WordPress theme. Simply add these lines to the file to prevent TinyMCE from stripping iFrame content alltogether:
// fix TinyMCE for iframes add_filter('tiny_mce_before_init', create_function( '$a', '$a["extended_valid_elements"] = "iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]"; return $a;') );
The Add to Foursquare button won’t show up when you switch to the visual editor, but it will when you publish the post.
/Thanks to this post on the WordPress forums for the solution