mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-08-31 03:53:15 +08:00
Added: support limit reports items listing.
This commit is contained in:
parent
699909de95
commit
0aa94a0b20
1 changed files with 14 additions and 0 deletions
|
@ -585,6 +585,14 @@ class MainWP_Client_Report_Base {
|
|||
|
||||
$loops = array();
|
||||
$loop_count = 0;
|
||||
|
||||
$max_items_get = ( isset( $_POST['max_items_get'] ) && ! empty( $_POST['max_items_get'] ) ) ? intval( $_POST['max_items_get'] ) : 0;
|
||||
$limit_connectors = ( isset( $_POST['limit_reports'] ) && ! empty( $_POST['limit_reports'] ) ) ? intval( $_POST['limit_reports'] ) : array();
|
||||
|
||||
if ( ! is_array( $limit_connectors ) || empty( $limit_connectors ) ) {
|
||||
$limit_connectors = array( 'mainwp_sucuri', 'mainwp_maintenance', 'mainwp_backups' );
|
||||
}
|
||||
|
||||
foreach ( $records as $record ) {
|
||||
|
||||
if ( in_array( $record->ID, $skip_records ) ) {
|
||||
|
@ -649,6 +657,12 @@ class MainWP_Client_Report_Base {
|
|||
$loops[ $loop_count ] = $token_values;
|
||||
$loop_count ++;
|
||||
}
|
||||
|
||||
if ( $max_items_get && ( $loop_count >= $max_items_get ) ) {
|
||||
if ( in_array( $connector, $limit_connectors ) ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $loops;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue