Opened 9 years ago
Closed 10 days ago
#37756 closed defect (bug) (invalid)
Allow inline scripts on script aliases
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5 |
Component: | Script Loader | Keywords: | needs-patch needs-unit-tests |
Focuses: | Cc: |
Description
It appears if add_inline_script
is called on jquery
then it gets ignored, and requires to use jquery-core
The same may apply to styles but not tested. Inline scripts should work on both the main script and the aliases.
Change History (6)
#3
in reply to:
↑ 2
@
9 years ago
Replying to pcfreak30:
@swissspidy why is this set to an older WP version?
Via https://make.wordpress.org/core/handbook/tutorials/trac/opening-a-ticket/#create-a-new-ticket
- Version: The version of WordPress being used. Ideally, this would be the earliest affected or applicable version.
#4
@
6 years ago
- Keywords needs-patch needs-unit-tests added
- Milestone set to Future Release
@pcfreak30 Are you interested in creating a patch for this? Some unit tests demonstrating the issue would also be helpful.
#5
@
6 years ago
@desrosj this issue is so old for me that I have not dealt with it in a while and forgot about this ticket. I don't know if it's still an issue either. Another can contribute to fixing this if they like.
Thanks.
#6
@
10 days ago
- Milestone Future Release deleted
- Resolution set to invalid
- Status changed from new to closed
Inline scripts can indeed now be attached to scripts registered with a false
src. For example:
<?php wp_register_script( 'plvt-view-transitions', false, array(), null, array() ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion wp_add_inline_script( 'plvt-view-transitions', $src_script ); wp_add_inline_script( 'plvt-view-transitions', $init_script ); wp_enqueue_script( 'plvt-view-transitions' );
So I'm closing this as invalid.
@swissspidy why is this set to an older WP version?