When you select a PDF from the Media Library to insert into your post, by default PDF Embedder will insert it as a shortcode:
[pdf-embedder url="<url of PDF>"]
Code language: JSON / JSON with Comments (json)
This will cause it to use the plugin’s interactive viewer to display the PDF when the page is published.
You can also type the shortcode manually, and maybe you don’t normally want the shortcode to be inserted automatically – perhaps most often you just want the WordPress default of a straight ‘a href’ link to the source PDF file. Another scenario is that some other plugins can break if they use the Media Library to select files for use elsewhere, and they just need WordPress’ default link to be inserted – the pdf-embedder shortcode can break them.
To ensure the shortcode is not inserted automatically by default, you can add the following code to your Theme’s functions.php or a functions plugin such as My Custom Functions or Functionality (please take backups first as incorrect editing can break your site).
add_filter('pdfemb_override_send_to_editor', 'my_pdfemb_override_send_to_editor', 10, 4);
function my_pdfemb_override_send_to_editor($shortcode, $html, $id, $attachment) {
return $html;
}
Code language: PHP (php)
This requires version 2.7.3+ to work.