| @@ -708,8 +708,24 @@ | ||
| 708 | 708 | // 'dependency' => ['enable_media', '==', 'true', true], |
| 709 | 709 | // ], |
| 710 | 710 | ]; |
| 711 | 711 | |
| 712 | + // Infinite scroll became the Media Library default in WordPress 7.1, with a | |
| 713 | + // per-user opt-out under Profile > Personal Options. Offering the switch | |
| 714 | + // there would be worse than redundant: turning it on forces the | |
| 715 | + // `media_library_infinite_scrolling` filter, which core documents as | |
| 716 | + // taking precedence over that preference. | |
| 717 | + if ( ! Utils::is_wp_below_7_1() ) { | |
| 718 | + $attachment_fields_data = array_values( | |
| 719 | + array_filter( | |
| 720 | + $attachment_fields_data, | |
| 721 | + static function ( $field ) { | |
| 722 | + return ! isset( $field['id'] ) || 'media_ininite_scroll' !== $field['id']; | |
| 723 | + } | |
| 724 | + ) | |
| 725 | + ); | |
| 726 | + } | |
| 727 | + | |
| 712 | 728 | $attachment_fields[] = array( |
| 713 | 729 | 'id' => 'media_attachments', |
| 714 | 730 | 'type' => 'fieldset', |
| 715 | 731 | 'title' => __('Media Settings', 'adminify'), |