Skip to content

Commit

Permalink
Display a different message when no snippets are imported
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed Feb 10, 2018
1 parent 50e3530 commit 253df13
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions php/admin-menus/class-import-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,21 @@ protected function print_messages() {

$imported = intval( $_REQUEST['imported'] );

printf(
_n(
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
$imported, 'code-snippets'
),
$imported,
code_snippets()->get_menu_url( 'manage' )
);
if ( 0 === $imported ) {
esc_html_e( 'No snippets were imported.', 'code-snippets' );

} else {

printf(
_n(
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
$imported, 'code-snippets'
),
$imported,
code_snippets()->get_menu_url( 'manage' )
);
}

echo '</p></div>';
}
Expand Down

0 comments on commit 253df13

Please sign in to comment.