Skip to content

Commit 3187e8c

Browse files
committed
Add admin pointer for new Speculative Loading feature
1 parent 3296195 commit 3187e8c

File tree

1 file changed

+12
-2
lines changed
  • plugins/performance-lab/includes/admin

1 file changed

+12
-2
lines changed

plugins/performance-lab/includes/admin/load.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,20 @@ function perflab_get_dismissed_admin_pointer_ids(): array {
9191
* @return array<non-empty-string, string> Admin pointer messages with the admin pointer IDs as the keys.
9292
*/
9393
function perflab_get_admin_pointers(): array {
94-
return array(
94+
$pointers = array(
9595
'perflab-admin-pointer' => __( 'You can now test upcoming WordPress performance features.', 'performance-lab' ),
9696
'perflab-feature-view-transitions' => __( 'New <strong>View Transitions</strong> feature now available.', 'performance-lab' ),
9797
);
98+
99+
if (
100+
defined( 'SPECULATION_RULES_VERSION' )
101+
&&
102+
version_compare( SPECULATION_RULES_VERSION, '1.6.0', '>=' )
103+
) {
104+
$pointers['perflab-feature-speculation-rules-auth'] = __( '<strong>Speculative Loading</strong> now includes an opt-in setting for logged-in users.', 'performance-lab' );
105+
}
106+
107+
return $pointers;
98108
}
99109

100110
/**
@@ -185,7 +195,7 @@ static function ( string $needed_pointer ) use ( $perflab_admin_pointers ): stri
185195

186196
$args['content'] .= '<p>' . sprintf(
187197
/* translators: %s: settings page link */
188-
esc_html__( 'Open %s to individually toggle the performance features.', 'performance-lab' ),
198+
esc_html__( 'Open %s to individually toggle the performance features and access their settings (if any).', 'performance-lab' ),
189199
'<a href="' . esc_url( add_query_arg( 'page', PERFLAB_SCREEN, admin_url( 'options-general.php' ) ) ) . '">' . esc_html__( 'Settings > Performance', 'performance-lab' ) . '</a>'
190200
) . '</p>';
191201

0 commit comments

Comments
 (0)