Add Choose Update Source feature
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
ci/woodpecker/tag/woodpecker Pipeline is pending
Plugin Asset Update / Push assets to WordPress.org (push) Has been cancelled
Build Release / Build and Create Release (push) Has been cancelled
Build Release / Deploy to WordPress.org (push) Has been cancelled

This commit is contained in:
2025-04-13 13:13:32 +01:00
parent fda33746e5
commit 3ebcaccf98
7 changed files with 413 additions and 3 deletions

View File

@ -61,7 +61,15 @@ class Updater {
* @return string Installation source: 'github', 'gitea', or 'wordpress.org'
*/
private function determine_installation_source() {
// Default to WordPress.org
// Check for user preference first
$user_preference = \get_option('fpden_update_source', 'auto');
// If not set to auto, use the user preference
if ($user_preference !== 'auto') {
return $user_preference;
}
// Otherwise, auto-detect as before
$source = 'wordpress.org';
// Check if the plugin was installed from GitHub