Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author premek.v

    (@premekv)

    Hi, thanks for the report.

    Hotfix follows. I will update it in WP directory soon.

    Thanks goes also here and here:
    https://gist.github.com/2176359
    http://wordpress.stackexchange.com/questions/77212/add-filter-media-send-to-editor-does-not-work-on-wp-3-5

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <?php
    /*
    Plugin Name: RV Embed PDF
    Description: When you upload PDF and insert a link to it with the Add Media button, it will be automatically embedded in the page using Google Docs Viewer.
    Author: Rong Vang Media
    Author URI: http://www.rongvang.cz
    Version: 1.1
    */
    
    function rv_embedpdf($html, $id){
    
    	$attachment = get_post($id);
    	$mime_type = $attachment->post_mime_type;
    	$out = "";
    	if ($mime_type == 'application/pdf') {
    		$out .= '<iframe src="http://docs.google.com/gview?url='.$attachment->guid.'&embedded=true" style="width:100%; height:500px;" frameborder="0"></iframe>';
    	}
    
    	$out .= $html;
    
    	return $out;
    }
    add_filter ( 'media_send_to_editor', 'rv_embedpdf', 20, 3);
    Thread Starter ciaoluca@gmail.com

    (@ciaolucagmailcom)

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘RV Embed PDF does not work on v. 3.5’ is closed to new replies.