add_filter ( ‘media_send_to_editor’, …) does not work on wp 3.5

‘media_send_to_editor works fine in WordPress 3.5. I did not test the above code but you don’t need to preg_match for .pdf when WordPress supports post_mime_type == ‘application/pdf; This should work better: https://gist.github.com/2176359 Just change the HTML parameters to your needs. I also advise to embed it directly as an <iframe>, native .pdf iframe browser support … Read more

Extra Alignment buttons on media uploader screen

I think your real problem here though is timing, in that you should only do the remove_action and add_action in the wp_enqueue_media action fired at the end of the wp_enqueue_media() function, after it has added the action you’re replacing: add_action( ‘wp_enqueue_media’, function () { if ( ! remove_action( ‘admin_footer’, ‘wp_print_media_templates’ ) ) { error_log(“remove_action fail”); … Read more

tech