YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.21k stars 403 forks source link

Releases and Tags #567

Closed hupe13 closed 5 months ago

hupe13 commented 5 months ago

Is it possible to ignore any releases and consider tags only?

YahnisElsts commented 5 months ago

Yes, you can use the vcs_update_detection_strategies filter to prevent PUC from looking at releases. Try something like this:

use YahnisElsts\PluginUpdateChecker\v5p3\Vcs\GitHubApi;
$updateChecker->addFilter('vcs_update_detection_strategies', function($strategies) {
    unset($strategies[GitHubApi::STRATEGY_LATEST_RELEASE]);
    return $strategies;
});
hupe13 commented 5 months ago

Thank you very much, it works.