Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#26616 closed defect (bug) (invalid)

unregister_widget not working in WordPress 3.8

Reported by: Dane Morgan Owned by:
Priority: normal Milestone:
Component: Widgets Version: 3.8
Severity: normal Keywords:
Cc: Focuses:

Description

Issue
The code

function remove_calendar_widget() {
    unregister_widget('WP_Widget_Calendar');
}

add_action( 'widgets_init', 'remove_calendar_widget' );

unregisters the calendar widget on a 3.7.1 install but does not unregister it on a 3.8 install on the same server

Steps
Add the above code to the functions.php file and open the widget management page in the dashboard.

Expected results
The calendar widget will not be available in the widgets list.

What I see instead
The calendar widget is still there in the list.

Change History (5)

#1 @Dane Morgan
13 years ago

Actually, when i put that code into a plugin it does work, so maybe in 3.8 this function is no longer available to themes?

#2 @SergeyBiryukov
13 years ago

That snippet still works as expected for me in 3.8 when I put it into Twenty Fourteen's or Twenty Thirteen's functions.php file.

#3 @Dane Morgan
13 years ago

Okay, same here. So I am missing something else. This works as expected. Thank you.

#4 @Dane Morgan
13 years ago

  • Keywords close added
  • Resolution → invalid
  • Status new → closed

#5 @SergeyBiryukov
13 years ago

  • Keywords close removed
  • Milestone Awaiting Review
Note: See TracTickets for help on using tickets.