Skip to content

Commit 7c3503f

Browse files
committed
Show plugin version in admin footer, bump to 1.1.2
Add admin_footer_text filter and Plugin::admin_footer_version method to display the WorkOS for WordPress version in the admin footer on WorkOS-related screens. The method checks the current screen id for "workos" and prefixes the footer text with the plugin version. Also update the plugin header and WORKOS_WP_VERSION constant to 1.1.2.
1 parent 39a5b19 commit 7c3503f

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

includes/Plugin.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ private function init_hooks(): void {
101101
add_action('admin_bar_menu', [$this, 'admin_bar_workos_node'], 100);
102102
add_action('wp_head', [$this, 'admin_bar_inline_styles']);
103103
add_action('admin_head', [$this, 'admin_bar_inline_styles']);
104+
105+
// Show plugin version in admin footer on WorkOS pages.
106+
add_filter('admin_footer_text', [$this, 'admin_footer_version']);
104107
}
105108

106109
/**
@@ -238,6 +241,21 @@ public function admin_bar_inline_styles(): void {
238241
<?php
239242
}
240243

244+
/**
245+
* Show plugin version in the admin footer on WorkOS settings pages.
246+
*/
247+
public function admin_footer_version(string $text): string {
248+
$screen = get_current_screen();
249+
if ($screen && str_contains($screen->id, 'workos')) {
250+
return sprintf(
251+
'WorkOS for WordPress v%s | %s',
252+
WORKOS_WP_VERSION,
253+
$text
254+
);
255+
}
256+
return $text;
257+
}
258+
241259
/**
242260
* Register rewrite rules for the callback endpoint.
243261
*/

workos-for-wordpress.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WorkOS for WordPress
44
* Plugin URI: https://github.com/AlwaysCuriousCo/workos-for-wordpress
55
* Description: Integrate WorkOS authentication and user management into WordPress.
6-
* Version: 1.1.1
6+
* Version: 1.1.2
77
* Author: Always Curious
88
* Author URI: https://alwayscurious.co
99
* License: GPL-3.0-or-later
@@ -15,7 +15,7 @@
1515

1616
defined('ABSPATH') || exit;
1717

18-
define('WORKOS_WP_VERSION', '1.1.1');
18+
define('WORKOS_WP_VERSION', '1.1.2');
1919
define('WORKOS_WP_PLUGIN_FILE', __FILE__);
2020
define('WORKOS_WP_PLUGIN_DIR', plugin_dir_path(__FILE__));
2121
define('WORKOS_WP_PLUGIN_URL', plugin_dir_url(__FILE__));

0 commit comments

Comments
 (0)