delete_widget

delete_widget

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('delete_widget') is found 3 times:

  • /wp-admin/includes/ajax-actions.php line 2404
    			'delete_widget'      => '1',
    		);
    
    		/** This action is documented in wp-admin/widgets.php */
    		do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
    
    	} elseif ( $settings && preg_match( '/__i__|%i%/', key( $settings ) ) ) {
    		if ( ! $multi_number ) {
    			wp_die( $error );
    		}
    
    
  • /wp-admin/widgets-form.php line 169
    		 * @param string $widget_id  ID of the widget marked for deletion.
    		 * @param string $sidebar_id ID of the sidebar the widget was deleted from.
    		 * @param string $id_base    ID base for the widget.
    		 */
    		do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
    	}
    
    	$_POST['widget-id'] = $sidebar;
    
    	foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
    		if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {
    
  • /wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php line 413
    			);
    			$_REQUEST = $_POST;
    
    			/** This action is documented in wp-admin/widgets-form.php */
    			do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
    
    			$callback = $wp_registered_widget_updates[ $id_base ]['callback'];
    			$params   = $wp_registered_widget_updates[ $id_base ]['params'];
    
    			if ( is_callable( $callback ) ) {
    				ob_start();