Make WordPress Core

Opened 13 months ago

Closed 11 months ago

Last modified 11 months ago

#58225 closed defect (bug) (fixed)

Twenty Sixteen: Deprecated jQuery.fn.unbind

Reported by: malae's profile Malae Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch commit
Focuses: javascript Cc:


I posted this 2 years ago, but it has not been fixed in Theme: Twenty Sixteen
jQuery.fn.unbind() is deprecated in /twentysixteen/js/functions.js Line 97
siteNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.twentysixteen' );
should be changed to:
siteNavigation.find( '.menu-item-has-children > a' ).on("unbind", 'touchstart.twentysixteen' );

Change History (9)

#1 @audrasjb
13 months ago

  • Component changed from Themes to Bundled Theme
  • Keywords needs-patch needs-testing added
  • Version 6.2 deleted

This ticket was mentioned in PR #4404 on WordPress/wordpress-develop by @dilipbheda.

13 months ago

  • Keywords has-patch added; needs-patch removed

#3 @dilipbheda
13 months ago

@Malae I think jQuery Off method will handle to remove the event I think the jQuery Off method will help to remove the registered event instead of on("unbind", 'touchstart.twentysixteen' );

cc @audrasjb


#4 @sabernhardt
12 months ago

  • Summary changed from Deprecated jQuery.fn.unbind to Twenty Sixteen: Deprecated jQuery.fn.unbind

#5 @sabernhardt
12 months ago

  • Milestone changed from Awaiting Review to 6.3

Also: the .unbind() method is found in Twenty Fourteen's slider.js and Twenty Seventeen's navigation.js.

#6 @audrasjb
11 months ago

  • Keywords commit added; needs-testing removed
  • Owner set to audrasjb
  • Status changed from new to accepted

Works fine in my testing. Marking for commit.

@dilipbheda @sabernhardt feel free to open other tickets to handle this for T14 and T17 :)

#7 @mukesh27
11 months ago

unbind used many places in core. Why it give error here?

#8 @audrasjb
11 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 56102:

Twenty Sixteen: Replace deprecated unbind method with off.

This fixes a Deprecated jQuery.fn.unbind() notice.

Props Malae, dilipbheda, sabernhardt, audrasjb.
Fixes #58225.

Note: See TracTickets for help on using tickets.