W3cubDocs

/WordPress

_wp_after_delete_font_family( int $post_id, WP_Post $post )

Deletes child font faces when a font family is deleted.

Parameters

$post_idintrequired
Post ID.
$postWP_Postrequired
Post object.

Source

function _wp_after_delete_font_family( $post_id, $post ) {
	if ( 'wp_font_family' !== $post->post_type ) {
		return;
	}

	$font_faces = get_children(
		array(
			'post_parent' => $post_id,
			'post_type'   => 'wp_font_face',
		)
	);

	foreach ( $font_faces as $font_face ) {
		wp_delete_post( $font_face->ID, true );
	}
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_wp_after_delete_font_family