• Resolved mattf10

    (@mattf10)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mattf10

    (@mattf10)

    This bug was not fixed in the latest release. As it stands, the filter does not work and only causes warnings.

    Please change to ‘apply_filters‘ to fix this in the next release.

    Plugin Support Val Meow

    (@valwa)

    Hey @mattf10! ??

    Thanks for reporting this will be fixed in the next update!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.