wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
_delete_attachment_theme_mod is private and should not be used in themes or plugins directly.
_delete_attachment_theme_mod › WordPress Function
Da3.0.0
Deprecaton/a
› _delete_attachment_theme_mod ( $id )
Accedi: |
|
Parametri: |
|
Definito a: |
|
Codex: | |
ChangeLog: |
|
Checks an attachment being deleted to see if it's a header or background image.
If true it removes the theme modification which would be pointing at the deleted attachment.Sorgenti
function _delete_attachment_theme_mod( $id ) { $attachment_image = wp_get_attachment_url( $id ); $header_image = get_header_image(); $background_image = get_background_image(); $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( $custom_logo_id && $custom_logo_id == $id ) { remove_theme_mod( 'custom_logo' ); remove_theme_mod( 'header_text' ); } if ( $header_image && $header_image == $attachment_image ) { remove_theme_mod( 'header_image' ); remove_theme_mod( 'header_image_data' ); } if ( $background_image && $background_image == $attachment_image ) { remove_theme_mod( 'background_image' ); } }