I wrote a plugin a long time ago that adds a checkbox labelled ‘Private?’ to the attachment details form. When checked, it would then set the post_status of that attachment to ‘private’ via the attachment_fields_to_save hook.
Recently the plugin stopped working – files were still moved, but the post_status remained ‘inherit’. On investigation, I’ve found that the plugin still sets the status to ‘private’, but it is reset to ‘inherit’ before the execution finishes. That is to say, when the user checks the box, the file is moved and status updated to ‘private’ and then back to ‘inherit’ via the same heartbeat Ajax request.
I disabled all plugins and tested on twentytwentyfour. I also tried to add a callback to every hook via global $all_filters that logged the attachment post_status, but it appeared that the status was ‘private’ throughout.
Can anyone shed light on what has changed in the core that’s now setting post_status to inherit whenever a value in the attachment details form is updated?