Skip to content

Commit

Permalink
Add a "notice" header to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Oct 26, 2022
1 parent e03afa3 commit 92d1c8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions admin/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ function perflab_render_modules_page_field( $module_slug, $module_data, $module_
<p id="<?php echo esc_attr( "{$base_id}_description" ); ?>" class="description">
<?php echo esc_html( $module_data['description'] ); ?>
</p>
<?php if ( ! empty( $module_data['notice'] ) ) : ?>
<p style="background:#fff;border:1px solid #c3c4c7;border-left-width: 4px;border-left-color:#dba617;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);padding:1em;max-width:50em;">
<?php echo esc_html( $module_data['notice'] ); ?>
</p>
<?php endif; ?>
</fieldset>
<?php
}
Expand Down Expand Up @@ -314,6 +319,7 @@ function perflab_get_module_data( $module_file ) {
'name' => 'Module Name',
'description' => 'Description',
'experimental' => 'Experimental',
'notice' => 'Notice',
);

$module_data = get_file_data( $module_file, $default_headers, 'perflab_module' );
Expand Down Expand Up @@ -342,6 +348,7 @@ function perflab_get_module_data( $module_file ) {
$translatable_fields = array(
'name' => 'module name',
'description' => 'module description',
'notice' => 'module notice',
);
foreach ( $translatable_fields as $field => $context ) {
// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralContext,WordPress.WP.I18n.NonSingularStringLiteralText
Expand Down
3 changes: 2 additions & 1 deletion modules/database/sqlite/load.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
/**
* Module Name: SQLite Integration
* Description: Use an SQLite database instead of MySQL. CAUTION: Enabling this module will bring up the WordPress installation screen. You will need to reconfigure your site, and you will lose all your data. If you then disable the module, you will get back to your previous MySQL database, with all your previous data intact.
* Description: Use an SQLite database instead of MySQL.
* Notice: CAUTION: Enabling this module will bring up the WordPress installation screen. You will need to reconfigure your site, and you will lose all your data. If you then disable the module, you will get back to your previous MySQL database, with all your previous data intact.
* Experimental: Yes
*
* @package performance-lab
Expand Down

0 comments on commit 92d1c8c

Please sign in to comment.