From 964ce6b3d69f73e41c7569da07aa2bbd77c57140 Mon Sep 17 00:00:00 2001 From: Caleb Stauffer Date: Mon, 3 Jul 2023 15:37:14 -0400 Subject: [PATCH 1/2] save --- dispatchers/Html.php | 7 ++++++- output/html/request.php | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dispatchers/Html.php b/dispatchers/Html.php index 17a848a7e..d9c1e24eb 100644 --- a/dispatchers/Html.php +++ b/dispatchers/Html.php @@ -510,9 +510,14 @@ protected function before_output() { * @return void */ protected function do_panel_menu_item( $id, array $menu ) { + if ( empty( $menu['attr-title'] ) ) { + $menu['attr-title'] = ''; + } + printf( - '
  • ', + '
  • ', esc_attr( $menu['href'] ), + esc_attr( $menu['attr-title'] ), esc_html( $menu['title'] ) ); diff --git a/output/html/request.php b/output/html/request.php index 3bb8eae40..f7aa256cc 100644 --- a/output/html/request.php +++ b/output/html/request.php @@ -224,11 +224,20 @@ public function admin_menu( array $menu ) { /* translators: %s: Number of additional query variables */ : __( 'Request (+%s)', 'query-monitor' ); + $attr_title = ( empty( $count ) ) + ? '' + /* translators: %s: Number of additional query variables */ + : __( '+%s non-standard query variables in request. See Query Vars section.' ); + $menu[ $this->collector->id() ] = $this->menu( array( 'title' => esc_html( sprintf( $title, number_format_i18n( $count ) ) ), + 'attr-title' => esc_html( sprintf( + $attr_title, + number_format_i18n( $count ) + ) ), ) ); return $menu; From 646ed679f2856c4ed882d1b5cab491c5a35cebce Mon Sep 17 00:00:00 2001 From: Caleb Stauffer Date: Mon, 3 Jul 2023 15:43:26 -0400 Subject: [PATCH 2/2] add translation domain --- output/html/request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/html/request.php b/output/html/request.php index f7aa256cc..862734a2b 100644 --- a/output/html/request.php +++ b/output/html/request.php @@ -227,7 +227,7 @@ public function admin_menu( array $menu ) { $attr_title = ( empty( $count ) ) ? '' /* translators: %s: Number of additional query variables */ - : __( '+%s non-standard query variables in request. See Query Vars section.' ); + : __( '+%s non-standard query variables in request. See Query Vars section.', 'query-monitor' ); $menu[ $this->collector->id() ] = $this->menu( array( 'title' => esc_html( sprintf(