WordPress.org

Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #32067, comment 17


Ignore:
Timestamp:
09/16/2020 04:09:24 PM (16 months ago)
Author:
enricocarraro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32067, comment 17

    v2 v3  
    88    * low code readability;
    99    * needs some logic to aggregate and print scripts (WP_Scripts could be used for this, but it would be a bit of a stretch).
    10 * Moving them to JavaScript files:
     10* Moving them to JavaScript files ([https://github.com/enricocarraro/wordpress-develop/commit/06bd714dede172010c52dd2c17883b2a4214d6be example]):
    1111  * advantages:
    1212    * better code readability;
    1313  * disadvantages:
    14     * not an option for all, as some receive data from PHP (this can be avoided using [https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes data attributes]);
     14    * not an option for all, as some receive data from PHP (this can be overcome using [https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes data attributes]);
    1515    * it's tricky to understand which pages can be grouped together to include the same JavaScript file.
    1616* Substituting them with inline scripts with the defer attribute so that they can only be executed after the document parsing is completed: