Skip to content

Commit 3d4c0cf

Browse files
authored
fix: enable auto-updates toggle for WordPress.org plugins (#37)
* ci: set WordPress plugin deploy action to v2.3.0 * fix: enable auto-updates toggle for WordPress.org plugins
1 parent 31c0a96 commit 3d4c0cf

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
cp LICENSE integrate-rybbit/
182182
183183
- name: Deploy to WordPress.org
184-
uses: 10up/action-wordpress-plugin-deploy@stable
184+
uses: 10up/action-wordpress-plugin-deploy@2.3.0
185185
id: deploy
186186
with:
187187
generate-zip: true

integrate-rybbit/integrate-rybbit.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@
4343
// Initialize main plugin class
4444
new Integrate_Rybbit();
4545

46+
// Enable auto-updates toggle for WordPress.org plugins (WordPress 5.5+)
47+
// This allows users to enable/disable automatic updates via the Plugins page
48+
add_filter('auto_update_plugin', function($update, $item) {
49+
if (isset($item->plugin) && $item->plugin === INTEGRATE_RYBBIT_PLUGIN_BASENAME) {
50+
// Return true to enable auto-updates, false to disable
51+
// null means let WordPress use the default/user preference
52+
return $update;
53+
}
54+
return $update;
55+
}, 10, 2);
56+
4657
// Initialize context-specific logic
4758
if (is_admin()) {
4859
new Integrate_Rybbit_Admin();

0 commit comments

Comments
 (0)