Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_delete_attachment_theme_mod [ WordPress Function ]

_delete_attachment_theme_mod ( $id )
Access:
  • private
Parameters:
  • (int) $id the attachment id
Defined at:



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

Source


<?php
function _delete_attachment_theme_mod$id ) {
    
$attachment_image wp_get_attachment_url$id );
    
$header_image get_header_image();
    
$background_image get_background_image();

    if ( 
$header_image && $header_image == $attachment_image )
        
remove_theme_mod'header_image' );

    if ( 
$background_image && $background_image == $attachment_image )
        
remove_theme_mod'background_image' );
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics