From 02592c7fc4ffba4fda2a232ec5767d3206aeafbf Mon Sep 17 00:00:00 2001 From: Adrien Foulon <6115458+Tofandel@users.noreply.github.com> Date: Mon, 25 Feb 2019 19:03:46 +0100 Subject: [PATCH] Add a filter to getVcsService The filter 'puc_get_vcs_service' will then allow user to add their self hosted gitlab or bitbucket as a recognised service like so add_filter('puc_get_vcs_service', function($service, $host) { if ($host == 'gitlab.mydomain.com') { return 'GitLab'; } return $service; }, 10, 2); --- Puc/v4p5/Factory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Puc/v4p5/Factory.php b/Puc/v4p5/Factory.php index 8710358..3f0f7ef 100644 --- a/Puc/v4p5/Factory.php +++ b/Puc/v4p5/Factory.php @@ -207,8 +207,8 @@ if ( !class_exists('Puc_v4p5_Factory', false) ): $service = $knownServices[$host]; } } - - return $service; + + return apply_filter('puc_get_vcs_service', $service, $host, $path, $metadataUrl); } /**