Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51124, comment 3


Ignore:
Timestamp:
03/05/2021 04:24:44 PM (2 years ago)
Author:
mikejdent
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51124, comment 3

    initial v1  
    1 I think using a parameter rather than filter makes more sense, as you specify the type as you are writing the script. I have written a patch to address this but just need to get the test suite built in npm so I can check it is working.
    21
    3 My thinking is, pass a $type parameter into {{{ add_inline_script() }}} and {{{ WP_Scripts::add_inline_script() }}} then if that parameter exists, assign it to {{{ WP_Scripts::type_attr }}}
    4 If it isn't set, then we revert to the default setting of 'text/javascript' unless we are using {{{ add_theme_support( 'html5', [ 'script' ] ); }}}
    5 
    6 @GeekPress html5 has been around a while now. I wonder if we should make it default, and require developers to actively {{{ remove_theme_support( 'html5', [ 'script' ] ); }}} if needs be?