Skip to content
Snippets Groups Projects
Commit 1d1ff660 authored by Erick Hitter's avatar Erick Hitter
Browse files

An action for cleanup, and no silly check for class existence. Moar cleanup!

parent 14b5aa05
No related branches found
No related tags found
No related merge requests found
...@@ -118,6 +118,7 @@ class taxonomy_dropdown_widget_plugin { ...@@ -118,6 +118,7 @@ class taxonomy_dropdown_widget_plugin {
if ( ! add_filter( 'taxonomy_dropdown_widget_run_cleanup', true ) ) if ( ! add_filter( 'taxonomy_dropdown_widget_run_cleanup', true ) )
return; return;
// Remove unused options
$legacy_options = array( $legacy_options = array(
'widget_TagDropdown', 'widget_TagDropdown',
'widget_TagDropdown_exclude', 'widget_TagDropdown_exclude',
...@@ -128,6 +129,9 @@ class taxonomy_dropdown_widget_plugin { ...@@ -128,6 +129,9 @@ class taxonomy_dropdown_widget_plugin {
foreach ( $legacy_options as $legacy_option ) { foreach ( $legacy_options as $legacy_option ) {
delete_option( $legacy_option ); delete_option( $legacy_option );
} }
// Let others play too
do_action( 'taxonomy_dropdown_widget_cleanup' );
} }
/** /**
...@@ -137,8 +141,7 @@ class taxonomy_dropdown_widget_plugin { ...@@ -137,8 +141,7 @@ class taxonomy_dropdown_widget_plugin {
* @return null * @return null
*/ */
public function action_widgets_init() { public function action_widgets_init() {
if ( class_exists( 'taxonomy_dropdown_widget' ) ) register_widget( 'taxonomy_dropdown_widget' );
register_widget( 'taxonomy_dropdown_widget' );
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment