Skip to content

Commit 4a0fb05

Browse files
committed
Omit admin pointer for new plugin if plugin is already active
Signed-off-by: Shyamsundar Gadde <[email protected]>
1 parent 3d88f7b commit 4a0fb05

File tree

1 file changed

+9
-3
lines changed
  • plugins/performance-lab/includes/admin

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,17 @@ function perflab_get_dismissed_admin_pointer_ids(): array {
9292
*/
9393
function perflab_get_admin_pointers(): array {
9494
$pointers = array(
95-
'perflab-admin-pointer' => __( 'You can now test upcoming WordPress performance features.', 'performance-lab' ),
96-
'perflab-feature-view-transitions' => __( 'New <strong>View Transitions</strong> feature now available.', 'performance-lab' ),
97-
'perflab-feature-nocache-bfcache' => __( 'New <strong>No-cache BFCache</strong> feature now available.', 'performance-lab' ),
95+
'perflab-admin-pointer' => __( 'You can now test upcoming WordPress performance features.', 'performance-lab' ),
9896
);
9997

98+
// Only show if the feature plugin is not already active.
99+
if ( ! defined( 'VIEW_TRANSITIONS_VERSION' ) ) {
100+
$pointers['perflab-feature-view-transitions'] = __( 'New <strong>View Transitions</strong> feature now available.', 'performance-lab' );
101+
}
102+
if ( ! defined( 'WestonRuter\NocacheBFCache\VERSION' ) ) {
103+
$pointers['perflab-feature-nocache-bfcache'] = __( 'New <strong>No-cache BFCache</strong> feature now available.', 'performance-lab' );
104+
}
105+
100106
if (
101107
defined( 'SPECULATION_RULES_VERSION' )
102108
&&

0 commit comments

Comments
 (0)