Support » Plugin: TinyMCE Annotate » I want them shown on the front-end

  • Resolved bjordanov

    (@bjordanov)


    I want those annotations to be shown on the front end and be seen even by unregistered users. How do I achieve that? Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Raul Martinez

    (@xyulex)

    Hello,

    you can comment those two pieces of code, which are responsible for hiding the annotations in the frontend.

    1) add_filter('the_content', 'tma_annotate_backend');

    ….

    2) function tma_annotate_backend($content) {
        return preg_replace('/(<[^>]+) class="annotation".*?data-annotation=".*?"/i', '$1', $content);
    }

    Also, annotations can be seen by unregistered users in the frontend.

    Thanks for using the plugin.
    Raúl

    Thread Starter bjordanov

    (@bjordanov)

    Thank you so much for your fast answer! <3 This is a lifesaver! I’ll rate the plugin when I try it later today!

    Plugin Author Raul Martinez

    (@xyulex)

    In the meantime, feel free to ask if you find any problem with it 🙂 I wrote that code some time ago so I might be missing something 😉

    Thread Starter bjordanov

    (@bjordanov)

    I tried this method and here are 2 annotation example posts but both just show the style of the highlighter and not the actual annotation. https://anyshapemusic.com/blog/ Any advice would be appreciated!

    Plugin Author Raul Martinez

    (@xyulex)

    You have to get a TinyMCE instance in frontend as the plugin works with that editor.

    If you don’t have an editor in frontend, you can’t load the plugin.js as the editor doesn’t exists.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I want them shown on the front-end’ is closed to new replies.