WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#17272 closed defect (bug) (invalid)

'ver' parameter included by default in wp_enqueue_script

Reported by: Nordvind Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: reporter-feedback close
Focuses: Cc:

Description

When you register and enqueue your script, the 'ver' parameter is included by default, thus resulting in script load error. Of course, you can call wp_enqueue_script like this wp_enqueue_script('mblog',plugins_url().'/mblog/mblog.js',false,null);
and it works fine, but I don't see the point of including 'ver=3.1.2' with every script.

Change History (4)

comment:1 follow-up: sivel3 years ago

  • Keywords reporter-feedback close added; needs-patch removed

Perhaps you could shed some light on how it results in a "script load error". The ver query var is used for cache busting primarily, so that filenames do not need to include the version for cache busting. Not including it can cause issues with core/plugin/theme upgrades.

comment:2 kawauso3 years ago

Related: #16699

comment:3 in reply to: ↑ 1 Nordvind3 years ago

Replying to sivel:

Perhaps you could shed some light on how it results in a "script load error". The ver query var is used for cache busting primarily, so that filenames do not need to include the version for cache busting. Not including it can cause issues with core/plugin/theme upgrades.

Well, ok. just used the technique in inappropriate way.

comment:4 dd323 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

invalid; due to it being the expected behaviour

Note: See TracTickets for help on using tickets.