Skip to content

For Performance, Javascript scripts should be enqueued with Defer #314

@NeilWJames

Description

@NeilWJames

WP 6.3 introduced the notion of enqueueing Javascript scriots with the Defer attribute to give a performance benefit.

Since the plugin script provide funtionality that is only invoked after the page is loaded (as code is invoked on the basis of user interaction), the plugin code can take advantage of this.

Following the advice given in WordPress Core, because the parameter used for WP 6.3 will be treated as true - the previous value. Therefore this coding will work as previously with older versions of WP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions