Warning when deleting images
-
Since the last update, I’m seeing this warning in my logs when calling ‘wp_delete_attachment’.
Object of class WP_Post could not be converted to int in /wp-includes/class-wp-hook.php on line 89
Your plugin adds the action ‘delete_attachment’ to call a function with the same name in the plugin file ‘classes/engine.php’. The problem is in this function on line 511:
$shouldDeleteWr2x = add_filter( 'wr2x_should_delete_attachment', true, $attach_id, $post );
This should be ‘apply_filters‘ instead of ‘add_filter’ (you’re passing the $post object as the 4th param to add_filter, which generates the warning). Please update this in the next release.
Thanks for the great plugin!
- You must be logged in to reply to this topic.