FEATURE: allow admin to delete all posts by a user irrespectively (PR #14128)

This commit allows admin to delete all posts by a user irrespective of site settings delete_user_max_post_age and delete_all_posts_max.

GitHub

Can we not use extractError on this with a defaultMessage? From lib/ajax-error

Looks good. Just a couple minor comments.

I don’t understand why you are making a closure here and then calling it immediately afterwards. Could you not set const progressModal = showModal("admin-delete-user-posts-progress", { admin: true }) as one line?

Sure, I’ve made this change. Thanks for the tip!

I am not sure why I did that, I was trying to reuse the original code but forgot to optimize it. I’ve now made the change you suggested.

The is_admin? condition doesn’t look right to me. There is a !user.admin? check before so is_admin? will never be true