awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 83 forks source link

pt-ocdi/before_widgets_import hook not working #189

Closed reignofpravin closed 5 years ago

reignofpravin commented 5 years ago

I need to remove every default active widgets from sidebars. Not to disable them, just to remove from sidebar. Here is what I did,

function disable_all_widgets( $sidebars_widgets ) { $sidebars_widgets = array( false ); return $sidebars_widgets; }

function ocdi_before_widgets_import( $selected_import ) { add_filter( 'sidebars_widgets', 'disable_all_widgets' );
} add_action( 'pt-ocdi/before_widgets_import', 'ocdi_before_widgets_import' );

primozcigler commented 5 years ago

Hi,

I'm not sure how exactly to remove the widgets from sidebar, but I'm quite sure that there is not an issue with this plugin so I'm closing the issue.