255 | | $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); |
| 255 | $confirmed_export_request_count = 0; |
| 256 | if ( current_user_can( 'export_others_personal_data' ) ) { |
| 257 | $export_request_counts = (array) wp_count_user_requests( 'export_personal_data' ); |
| 258 | if ( isset( $export_request_counts['request-confirmed'] ) ) { |
| 259 | $confirmed_export_request_count = (int) $export_request_counts['request-confirmed']; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | $confirmed_erase_request_count = 0; |
| 264 | if ( current_user_can( 'erase_others_personal_data' ) ) { |
| 265 | $erase_request_counts = (array) wp_count_user_requests( 'remove_personal_data' ); |
| 266 | if ( isset( $erase_request_counts['request-confirmed'] ) ) { |
| 267 | $confirmed_erase_request_count = (int) $erase_request_counts['request-confirmed']; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | $confirmed_request_count = $confirmed_export_request_count + $confirmed_erase_request_count; |
| 272 | |
| 273 | $request_notice = sprintf( |
| 274 | '<span class="update-plugins count-%d"><span class="plugin-count">%d</span></span>', |
| 275 | $confirmed_request_count, |
| 276 | number_format_i18n( $confirmed_request_count ) |
| 277 | ); |
| 278 | |
| 279 | $menu[75] = array( sprintf( __( 'Tools %s' ), $request_notice ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); |