• I wish to use this plugin with Advanced Custom Fields (ACF) plugin for the WYSWIG field. Would it be possible to include this?

    I shouldn’t think it’ll be as much of a problem, as ACF uses the same editor as WordPress and thus if you add your own stylesheet through the proper actions for example, they appear on the ACF editor as well.

    I also noticed that the plugin does not include the original uncompressed JS and CSS source code. Could you please include this?

    https://ww.wp.xz.cn/plugins/html-editor-syntax-highlighter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter anik786

    (@anik786)

    Note: I also receive an error on these pages on the console:

    Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null

    What’s more I noticed that the plugin don’t use ANY of the mce filters or actions.

    e.g.:
    https://codex.ww.wp.xz.cn/Plugin_API/Filter_Reference/mce_external_plugins

    https://codex.ww.wp.xz.cn/Function_Reference/add_editor_style

    Thread Starter anik786

    (@anik786)

    I narrowed down the problem to the fact that the id’s in “hesh.min.js” are not correct for the ACF plugin. For example the id “wp-content-wrap” does not exist for the ACF editor. If the original JS unminified plugin was posted, a lot of the problems here would be fixed.

    Could you please upload the unminified version of the plugin. Also it would be ideal if this plugin has a Github page to suggest edits.

    Many thanks!

    Thread Starter anik786

    (@anik786)

    After looking at the minified code more closely I have spotted several id’s that don’t appear in ACF:

    • content
    • content-html
    • content-tmce
    • ed_toolbar
    • wp-content-editor-container

    This makes sense why ACF chose not to use these id’s as in ACF you can have multiple editors on one page.

    You’ll also find that many of the id’s mentioned above have classes attributed to them that also exists in ACF:

    • content has class wp-editor-area
    • content-html: has classes wp-switch-editor and switch-html (recommend switch-html as wp-switch-editor is also used for other buttons)
    • content-tmce: has classes wp-switch-editor and switch-tmce (recommend switch-html as wp-switch-editor is also used for other buttons)
    • etc.

    Note some of the classes named above may not be specific enough as they are reused on other elements so I would suggest looking at the ACF and see how they named their fields.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Not working on ACF custom posts’ is closed to new replies.