php - Wordpress delete_attachment hook doesn't work -


i'm developing plugin uses xml file store attachments picked media gallery. need synch media gallery , xml file when attachment deleted media library, "delete_attachment" hook fits me.

but...it doesn't fire. tried simpliest function doesn't work:

function onwpdelete( $targetid ){     wp_die('deleted attachment ' . $targetid); }//onwpdelete add_action('delete_attachment', 'onwpdelete'); 

it's stored in functions.php file on plugin directory works sure because there other functions in there.

thank you!


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -