Last active
October 15, 2022 16:53
-
-
Save zartgesotten/1589c823b1d1e2a33063868a0990cb8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'delete_attachment', function( $postid ) { | |
| $past_backtrace = get_option( 'backtrace_for_deletion', [] ); | |
| $current_backtrace = debug_backtrace(); | |
| $past_backtrace[] = json_encode( $current_backtrace ); | |
| update_option( 'backtrace_for_deletion', $past_backtrace ); | |
| }); | |
| $backtraces = get_option( 'backtrace_for_deletion' ); | |
| foreach( $backtraces as $backtrace ) { | |
| ?> | |
| <pre> | |
| <?php | |
| print_r( json_decode( $backtrace ) ); | |
| echo '-----------------------------------------------------------------------------------'; | |
| ?> | |
| </pre> | |
| <?php | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment