wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
_wp_before_delete_font_face is private and should not be used in themes or plugins directly.
_wp_before_delete_font_face › WordPress Function
Depuis6.5.0
Dépréciéen/a
› _wp_before_delete_font_face ( $post_id, $post )
| Accès: |
|
| Paramètres: (2) |
|
| Défini(e) dans: |
|
| Codex: |
Deletes associated font files when a font face is deleted.
Fonctions en relation: _wp_after_delete_font_family, wp_print_font_faces, wp_delete_attachment, _wp_register_default_font_collections, wp_delete_comment
Source
function _wp_before_delete_font_face( $post_id, $post ) {
if ( 'wp_font_face' !== $post->post_type ) {
return;
}
$font_files = get_post_meta( $post_id, '_wp_font_face_file', false );
$font_dir = untrailingslashit( wp_get_font_dir()['basedir'] );
foreach ( $font_files as $font_file ) {
wp_delete_file( $font_dir . '/' . $font_file );
}
}