Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add an indicator in the adminbar to show when using SQLite
  • Loading branch information
aristath committed Feb 15, 2023
commit 81de8b066d496d2e6f034bf53e9114c38636f5e7
18 changes: 18 additions & 0 deletions modules/database/sqlite/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,21 @@ function perflab_sqlite_plugin_admin_notice() {
);
}
add_action( 'admin_notices', 'perflab_sqlite_plugin_admin_notice' ); // Add the admin notices.

/**
* Add a link to the admin bar.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function descriptions should start with a third-person verb per WP docs standards. Also, we need to add a @since annotation.

Suggested change
* Add a link to the admin bar.
* Adds a link to the admin bar.
*
* @since n.e.x.t

*
* @param WP_Admin_Bar $admin_bar The admin bar object.
*/
function perflab_sqlite_plugin_adminbar_item( $admin_bar ) {
$args = array(
'id' => 'performance-lab-sqlite',
'parent' => 'top-secondary',
/* translators: %s: SQLite icon. */
'title' => '<span style="color:#46B450;">' . __( 'SQLite activated', 'performance-lab' ) . '</span>',
'href' => esc_url( admin_url( 'options-general.php?page=' . PERFLAB_MODULES_SCREEN ) ),
'meta' => false,
);
$admin_bar->add_node( $args );
}
add_action( 'admin_bar_menu', 'perflab_sqlite_plugin_adminbar_item', 999 );