Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create site on a multisite, scope not added to the subsite URL #2054

Open
soderlind opened this issue Dec 4, 2024 · 4 comments
Open

Create site on a multisite, scope not added to the subsite URL #2054

soderlind opened this issue Dec 4, 2024 · 4 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@soderlind
Copy link

soderlind commented Dec 4, 2024

Blueprint:

{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/wp-admin/",
	"features": {
		"networking": true
	},
	"plugins": [
		"https://github-proxy.com/proxy/?repo=soderlind/super-admin-all-sites-menu"
	],
	"siteOptions": {
		"blogname": "Main site"
	},
	"steps": [
		{
			"step": "installPlugin",
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "restricted-site-access"
			},
			"options": {
				"activate": false
			}
		},
		{
			"step": "enableMultisite"
		},
		{
			"step": "wp-cli",
			"command": "wp site create --slug=site01"
		},
		{
			"step": "wp-cli",
			"command": "wp site create --slug=site02"
		},
		{
			"step": "wp-cli",
			"command": "wp site create --slug=site03"
		},
		{
			"step": "wp-cli",
			"command": "wp site create --slug=site04"
		},
		{
			"step": "wp-cli",
			"command": "wp site create --slug=site05"
		},
		{
			"step": "login",
			"username": "admin"
		},
		{
			"step": "writeFile",
			"path": "/wordpress/wp-content/mu-plugins/allsitesmenu-notice.php",
			"data": "<?php add_action('admin_notices', function() {  echo '<div class=\"notice notice-info is-dismissible\"><p>Check All Sites in the admin bar.</p></div>'; });"
		}
	]
}

Playground: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/soderlind/super-admin-all-sites-menu/refs/heads/main/blueprint.json

URL to the main site is https://playground.wordpress.net/scope:SCOPE-NAME/wp-admin/

But the subsites get the url https://playground.wordpress.net/site01/wp-admin/ eg, without scope, so if I try to go to the subsite site, I'm redirected to main.

@bgrgicak bgrgicak moved this from Inbox to Up next in Playground Board Dec 5, 2024
@bgrgicak bgrgicak added the [Type] Bug An existing feature does not function as intended label Dec 5, 2024
@bgrgicak
Copy link
Collaborator

bgrgicak commented Dec 5, 2024

Thank you for reporting this @soderlind! Switching to subsites definitely doesn't work. I even tried adding the site slug manually, but it didn't help.

@soderlind
Copy link
Author

soderlind commented Dec 5, 2024

@bgrgicak This would be nice to have, and you would have more control behind the scene:

{
	"step": "createSite",
	"slug": "site01",
	"name": "Site 01"
}

@bgrgicak
Copy link
Collaborator

bgrgicak commented Dec 5, 2024

@bgrgicak This would be nice to have, and you would have more control behind the scene:

{
"step": "createSite",
"slug": "site01",
"name": "Site 01"
}

Great idea! Site creating could be an option that we pass to the enableMultisite step. Maybe something like:

{
    "steps": [
        {
            "step": "enableMultisite",
			"sites": [
				{
					"slug": "site01",
					"name": "Site 01"
				}
			]
        }
    ]
}

@soderlind
Copy link
Author

Great idea! Site creating could be an option that we pass to the enableMultisite step. Maybe something like:

{
    "steps": [
        {
            "step": "enableMultisite",
			"sites": [
				{
					"slug": "site01",
					"name": "Site 01"
				}
			]
        }
    ]
}

@bgrgicak yes please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
Status: Backlog
Development

No branches or pull requests

2 participants