wppaste
WordPress

do_action( "pre_delete_site_option_{$option}", string $option, int $network_id )

Since
3.0.0, 4.4.0, 4.7.0
Fires immediately before a specific network option is deleted.

Description

The dynamic portion of the hook name, $option, refers to the option name.

Compatibility

WordPress
since 4.7.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$optionstring
Option name.
$network_idint
ID of the network.

Where this hook fires · 1

  • wp-includes/option.php:2287delete_network_option()

Source code

	 * @since 4.4.0 The `$option` parameter was added.	 * @since 4.7.0 The `$network_id` parameter was added.	 *	 * @param string $option     Option name.	 * @param int    $network_id ID of the network.	 */	do_action( "pre_delete_site_option_{$option}", $option, $network_id ); 	if ( ! is_multisite() ) {		$result = delete_option( $option );	} else {		$row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $network_id ) );		if ( is_null( $row ) || ! $row->meta_id ) {

Changelog

Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.7.0
The $network_id parameter was added.from the docblock
4.4.0
The $option parameter was added.from the docblock
3.0.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.