Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Change the meta key so all users will see this
Browse files Browse the repository at this point in the history
...even if they've dismissed the previous notice.
Still, this will only display on the same
pages as the previous notice,
not on every /wp-admin page.
  • Loading branch information
kienstra committed Mar 16, 2021
1 parent 1ae868e commit 872e7be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions php/admin/migration/class-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Notice extends Component_Abstract {
*
* @var string
*/
const NOTICE_USER_META_KEY = 'block_lab_show_migration_notice';
const NOTICE_USER_META_KEY = 'block_lab_show_migration_notice_with_new_features';

/**
* The user meta value stored if a user has dismissed the migration notice.
Expand Down Expand Up @@ -107,7 +107,7 @@ public function render_migration_notice() {
<?php
printf(
/* translators: %1$s: the plugin name */
esc_html__( 'The Block Lab team have moved. For future updates and improvements, migrate now to the new home of custom blocks: %1$s.', 'block-lab' ),
esc_html__( 'For a much easier, completely compatible editor, migrate now to the new home of custom blocks: %1$s.', 'block-lab' ),
sprintf(
'<strong>%1$s</strong>',
esc_html__( 'Genesis Custom Blocks', 'block-lab' )
Expand Down
4 changes: 2 additions & 2 deletions tests/php/unit/admin/migration/test-class-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function test_render_migration_notice() {
$this->instance->render_migration_notice();

$this->assertContains(
'The Block Lab team have moved. For future updates and improvements, migrate now to the new home of custom blocks: <strong>Genesis Custom Blocks</strong>.',
'For a much easier, completely compatible editor, migrate now to the new home of custom blocks: <strong>Genesis Custom Blocks</strong>.',
ob_get_clean()
);
}
Expand Down Expand Up @@ -124,7 +124,7 @@ public function test_ajax_handler_migration_notice() {
}

unset( $exception );
$this->assertEquals( 'dismissed', get_user_meta( get_current_user_id(), 'block_lab_show_migration_notice', true ) );
$this->assertEquals( 'dismissed', get_user_meta( get_current_user_id(), 'block_lab_show_migration_notice_with_new_features', true ) );
}

/**
Expand Down

0 comments on commit 872e7be

Please sign in to comment.