WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #45338, comment 6


Ignore:
Timestamp:
11/13/2018 09:41:52 PM (2 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #45338, comment 6

    initial v1  
    11The problem is that the TinyMCE settings filters for the classic block are in `wp_default_packages_inline_scripts()` ([https://core.trac.wordpress.org/browser/branches/5.0/src/wp-includes/script-loader.php#L603 here]) which runs on the action `wp_default_scripts` ([https://core.trac.wordpress.org/browser/branches/5.0/src/wp-includes/default-filters.php#L492 here]), which is fired as soon as `class WP_Scripts` is initialized and then at `init` 0 ([https://core.trac.wordpress.org/browser/branches/5.0/src/wp-includes/class.wp-scripts.php#L125 here]).
    22
    3 Previously they were running quite later, near the end of the page where the TinyMCE scripts were printed.
     3Previously they were running quite later, near the end of the page where the TinyMCE scripts were printed. Looks like any plugin that is adding these filters at `init` or later will be affected.
    44
    5 Looks like we will have to move that "down" again, and will have to `echo` the `wpEditorL10n` init object. Won't be able to use `add_inline_script()`, etc. At this point may be easier if we just reuse class-wp-editor.php to output that, no need to duplicate the code? Or can make another function in script-loader just for that and echo the settings on a later action? @pento @atimmer any ideas/thoughts?
     5Seems we will have to move that "down" again, and will have to `echo` the `wpEditorL10n` init object. Won't be able to use `add_inline_script()`, etc. At this point may be easier if we just reuse class-wp-editor.php to output that, no need to duplicate the code? Or can make another function in script-loader just for that and echo the settings on a later action? @pento @atimmer any ideas/thoughts?
    66
    77(BTW why is it called `wpEditorL10n` anyway?) :)