When `MEDIA_TRASH` is true, show the proper context in the `attachment-details` sidebar. Without this fix, it always showed "Delete Permanently."

Props toszcze.
Fixes #26783.


Built from https://develop.svn.wordpress.org/trunk@27454


git-svn-id: http://core.svn.wordpress.org/trunk@27300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When setting `posts_per_page` in `WP_Query::get_posts()`, check for `is_feed()` in the same place where `posts_per_page` is set when it is not already set. Previously, when `is_feed()` was true, `posts_per_page` would be arbitrarily overwritten. This fix allows `posts_per_page` to be set during `pre_get_posts` when `is_feed()` is true and not be overwritten.

Adds unit test.

Props wokamoto.
Fixes #25380.


Built from https://develop.svn.wordpress.org/trunk@27455


git-svn-id: http://core.svn.wordpress.org/trunk@27301 1a063a9b-81f0-0310-95a4-ce76da25c4cd