WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #12009, comment 35


Ignore:
Timestamp:
05/21/2017 05:22:37 AM (4 years ago)
Author:
LindsayBSC
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12009, comment 35

    initial v1  
    1 Personally I would appreciate the allowance for setting script tag attributes when the script itself is registered but I can also see the need for filtering that. For that reason I put together this little bit of code to append do (and rewrite) the section of do_item in class.wp-scripts.php that does the actual generation of the tag.
     1Personally I would appreciate the allowance for setting script tag attributes when the script itself is registered but I can also see the need for allowing filtering of it. For that reason I put together this little bit of code to append to (and rewrite) the section of do_item in ` class.wp-scripts.php` that does the actual generation of the tag.
    22
    3 My thinking is that the <script> is the actual tag, and everything else including the src and type are attributes. We should be treating attributes similarly and thus I felt it best to generate all of the attributes at the same time. This could also allow plugins to filter the order in which they are output.
     3My thinking is that the `<script>` is the actual tag, and everything else including the src and type are attributes. We should be treating attributes similarly and thus I felt it best to generate all of the attributes at the same time. This could also allow plugins to filter the order in which they are output.
    44
    55It is somewhat of a combination of the methods suggested in #22249 and @Otto42 's suggestions