diff --git src/bp-core/admin/bp-core-admin-optouts.php src/bp-core/admin/bp-core-admin-optouts.php
index 469c8bf73..98e40b113 100644
|
|
|
10 | 10 | // Exit if accessed directly. |
11 | 11 | defined( 'ABSPATH' ) || exit; |
12 | 12 | |
| 13 | // Per_page screen option. |
| 14 | if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-optouts' == $_REQUEST['page'] ) { |
| 15 | add_filter( 'set-screen-option', 'bp_core_optouts_screen_options', 10, 3 ); |
| 16 | } |
| 17 | |
13 | 18 | /** |
14 | 19 | * Set up the Opt-outs admin page. |
15 | 20 | * |
… |
… |
function bp_core_optouts_admin_manage( $action = '' ) { |
484 | 489 | |
485 | 490 | <?php |
486 | 491 | } |
| 492 | |
| 493 | /** |
| 494 | * Handle save/update of screen options for the BP Tools Optouts screen. |
| 495 | * |
| 496 | * @since 14.0.0 |
| 497 | * |
| 498 | * @param string $value Will always be false unless another plugin filters it first. |
| 499 | * @param string $option Screen option name. |
| 500 | * @param string $new_value Screen option form value. |
| 501 | * @return string|int Option value. False to abandon update. |
| 502 | */ |
| 503 | function bp_core_optouts_screen_options( $value, $option, $new_value ) { |
| 504 | if ( 'tools_page_bp_optouts_per_page' !== $option && 'tools_page_bp_optouts_network_per_page' !== $option ) { |
| 505 | return $value; |
| 506 | } |
| 507 | |
| 508 | // Per page. |
| 509 | $new_value = (int) $new_value; |
| 510 | if ( $new_value < 1 || $new_value > 999 ) { |
| 511 | return $value; |
| 512 | } |
| 513 | |
| 514 | return $new_value; |
| 515 | } |