Created
September 6, 2023 14:04
-
-
Save cagrimmett/c19410cd0f70f3f4afba32b6f7881fdf to your computer and use it in GitHub Desktop.
Disable updates for Yotpo
This file contains hidden or 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
<?php | |
/* | |
Plugin Name: Disable Auto-update for Yotpo Social Reviews for WooCommerce | |
Description: This plugin disables auto-updates for the Yotpo Social Reviews for WooCommerce plugin. | |
*/ | |
function disable_autoupdate_specific_plugins($update, $item) { | |
// Array of plugin slugs to never auto-update | |
$plugins = array( | |
'yotpo-social-reviews-for-woocommerce', | |
); | |
if (in_array($item->slug, $plugins)) { | |
// Never update plugins in this array | |
return false; | |
} else { | |
// Else, do whatever it was going to do before | |
return $update; | |
} | |
} | |
add_filter('auto_update_plugin', 'disable_autoupdate_specific_plugins', 11, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment