Support » Plugin: PDF.js Viewer » Code not removed after deleting plug-in

  • I’ve tested this plug-in on one of my websites and decided to go with another one to show PDF’s which is better maintained.

    However, after deleting the plug-in I wanted to add a regular link to download a PDF file and the automated shortcode from this plug-in still showed up.

    I found the source of this in the theme’s function.php file, so in case you have the same problem, you know where to find it! Just delete the following code over there:

    add_filter('the_content', 'addpdfviewer', 1);
    function addpdfviewer ($content)
    {
    global $post;
    $pattern = "/<a(.*?)href=('|\")([^>]*).pdf('|\")(.*?)>(.*?)<\/a>/i";
    $replacement = '[pdfjs-viewer url=$3.pdf viewer_width=330px viewer_height=350px fullscreen=true download=true print=true openfile=false]';
    $content = preg_replace($pattern, $replacement, $content);
    return $content;
    }

  • The topic ‘Code not removed after deleting plug-in’ is closed to new replies.