This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Astra_Ext_Nav_Widget_Support::remove_widget_instance( int $widget_id )

Remove widget instance.


Description


Parameters

$widget_id

(int) (Required) widget id.


Return

(bool)


Source

File: addons/nav-menu/classes/class-astra-ext-nav-widget-support.php

		private function remove_widget_instance( $widget_id ) {

			$id_base       = $this->get_id_base_for_widget_id( $widget_id );
			$parts         = explode( '-', $widget_id );
			$widget_number = absint( end( $parts ) );

			$current_widgets = get_option( 'widget_' . $id_base );

			if ( isset( $current_widgets[ $widget_number ] ) ) {

				unset( $current_widgets[ $widget_number ] );

				update_option( 'widget_' . $id_base, $current_widgets );

				return true;
			}

			return false;

		}

Changelog

Changelog
Version Description
1.6.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.