From 326a0efc04fe49152a832ca7e70a8a2363571a97 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sun, 1 May 2022 11:16:31 +0100
Subject: [PATCH] Add plugin to set default HTTPS siteurl for new blogs

---
 https-siteurl.php | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 https-siteurl.php

diff --git a/https-siteurl.php b/https-siteurl.php
new file mode 100644
index 0000000..10e24f8
--- /dev/null
+++ b/https-siteurl.php
@@ -0,0 +1,17 @@
+<?php
+/*
+ * Plugin Name: A/I - Default HTTPS siteurl
+ * Description: Set the default siteurl to HTTPS for new blogs
+ * Version: 0.0.1
+ * Author: Autistici/Inventati
+ * Author URI: https://autistici.org
+ */
+
+add_filter('wp_initialize_site_args', function($args, $site) {
+    $url = untrailingslashit('https://' . $site->domain . $site->path);
+
+    $args['options']['home'] = $url;
+    $args['options']['siteurl'] = $url;
+
+    return $args;
+}, 10, 2);
-- 
GitLab