WordPress at Your Fingertips
function is not described

WP_Site_Icon::delete_attachment_data() public WP 4.3.0

Deletes the Site Icon when the image file is deleted.

{} It's a method of the class: WP_Site_Icon{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Site_Icon = new WP_Site_Icon();
$WP_Site_Icon->delete_attachment_data( $post_id );
$post_id(int) (required)
Attachment ID.

Changelog

Since 4.3.0 Introduced.

Code of WP_Site_Icon::delete_attachment_data() WP 5.8.2

public function delete_attachment_data( $post_id ) {
	$site_icon_id = get_option( 'site_icon' );

	if ( $site_icon_id && $post_id == $site_icon_id ) {
		delete_option( 'site_icon' );
	}
}