Skip to content

Instantly share code, notes, and snippets.

@cagrimmett
Created September 6, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cagrimmett/c19410cd0f70f3f4afba32b6f7881fdf to your computer and use it in GitHub Desktop.
Save cagrimmett/c19410cd0f70f3f4afba32b6f7881fdf to your computer and use it in GitHub Desktop.
Disable updates for Yotpo
<?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