wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_after_delete_font_family › WordPress Function

Seit6.5.0
Veraltetn/v
_wp_after_delete_font_family ( $post_id, $post )
Zugriff:
  • private
Parameter: (2)
  • (int) $post_id Post ID.
    Erforderlich: Ja
  • (WP_Post) $post Post object.
    Erforderlich: Ja
Definiert in:
Codex:

Deletes child font faces when a font family is deleted.



Quellcode

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 );
	}
}