Sergey Biryukov fb283a3c27 Media: Use WP_Query::get() method to retrieve the posts_per_page value in wp_ajax_query_attachments().
This avoids a PHP notice and ensures that a default value is always provided if none is set by the user.

Follow-up to [51145], [51485].

Props davidwebca, mukesh27, circlecube, desrosj.
Merges [51982] to the 5.8 branch.
Fixes #54129.
Built from https://develop.svn.wordpress.org/branches/5.8@51983


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 18:33:59 +00:00
..