Changeset 13937 for trunk/src/bp-activity/bp-activity-admin.php
- Timestamp:
- 06/24/2024 05:29:42 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-admin.php
r13871 r13937 15 15 16 16 // Include WP's list table class. 17 if ( ! class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); 18 19 // Per_page screen option. Has to be hooked in extremely early. 20 if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] ) { 21 add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 ); 17 if ( ! class_exists( 'WP_List_Table' ) ) { 18 require ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; 22 19 } 23 20 … … 139 136 } 140 137 add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' ); 141 142 /**143 * Handle save/update of screen options for the Activity component admin screen.144 *145 * @since 1.6.0146 *147 * @param string $value Will always be false unless another plugin filters it first.148 * @param string $option Screen option name.149 * @param string $new_value Screen option form value.150 * @return string|int Option value. False to abandon update.151 */152 function bp_activity_admin_screen_options( $value, $option, $new_value ) {153 if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option )154 return $value;155 156 // Per page.157 $new_value = (int) $new_value;158 if ( $new_value < 1 || $new_value > 999 )159 return $value;160 161 return $new_value;162 }163 138 164 139 /**
Note: See TracChangeset
for help on using the changeset viewer.