-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an admin notice if Shiny Code is installed from source and missin…
…g dependencies. See #5
- Loading branch information
1 parent
3bba8bb
commit 25363f3
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Helper functions | ||
* | ||
* @package ShinyCode | ||
* @since 1.0.1 | ||
* @copyright Copyright (c) 2018 Cedaro, LLC | ||
* @license GPL-2.0-or-later | ||
*/ | ||
|
||
declare ( strict_types = 1 ); | ||
|
||
namespace Cedaro\WP\BlockType\Code; | ||
|
||
/** | ||
* Display a notice about missing dependencies. | ||
* | ||
* @since 1.0.1 | ||
*/ | ||
function display_missing_dependencies_notice() { | ||
$message = sprintf( | ||
/* translators: %s: documentation URL */ | ||
__( 'Shiny Code is missing required dependencies. <a href="%s" target="_blank" rel="noopener noreferer">Learn more.</a>', 'shiny-code' ), | ||
'https://github.com/cedaro/shiny-code#installation' | ||
); | ||
|
||
printf( | ||
'<div class="shiny-code-compatibility-notice notice notice-error"><p>%s</p></div>', | ||
wp_kses( | ||
$message, | ||
[ | ||
'a' => [ | ||
'href' => true, | ||
'rel' => true, | ||
'target' => true, | ||
], | ||
] | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters