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

Need to update blueprint.json to load a different link in multisite #175

Open
1 task done
asirota opened this issue Nov 12, 2024 · 5 comments
Open
1 task done

Need to update blueprint.json to load a different link in multisite #175

asirota opened this issue Nov 12, 2024 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@asirota
Copy link
Member

asirota commented Nov 12, 2024

I have checked the following:

  • I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

When loading the WordPress playground in multisite mode the default landing page changes url so it breaks. The settings page for AU under multisite is different.

Mockups or Images of the feature

We could have a separate file since I don’t know if blueprint knows what to load under multisite — have to research if there’s a branch in the blueprint possible. Need both regular and multisite supported in the blueprint.json.

@asirota asirota added bug Something isn't working enhancement New feature or request labels Nov 12, 2024
@asirota asirota added this to the Phase 1 milestone Nov 12, 2024
@asirota asirota self-assigned this Nov 12, 2024
@ipajen
Copy link
Collaborator

ipajen commented Nov 12, 2024

@asirota
Could this work from AI?
{ "step": "writeFile", "path": "/wordpress/wp-content/mu-plugins/redirect-landing.php", "data": "<?php add_action('admin_init', function() { if (is_multisite()) { wp_redirect('/wp-admin/network/index.php?page=aspireupdate-settings'); exit; } else { wp_redirect('/wp-admin/admin.php?page=aspireupdate-settings'); exit; } });" }

@asirota
Copy link
Member Author

asirota commented Nov 12, 2024

We would turn off the landing page step then? I guess we could test this by writing an alternative blueprint.json and testing it in the playground blueprint editor. You know it @ipajen ? Give it a shot and let me know what you think.

https://wordpress.github.io/wordpress-playground/web-instance

@ipajen
Copy link
Collaborator

ipajen commented Nov 12, 2024

@asirota AI has failed me ;/ I tested it but, it doesn't work with the simple version. (tried variants but its close but didn't get to work satisficed), Hopefully someone else got a better solution.

Is it possible to combine query parameter with blueprint ?multisite=yes&?blueprint-url ? If not maybe a if there is not other way its easier just to have two different blueprints for single and multi with two different landing pages and update the docs what want to be used? And update the Action for correct bransch url.

@ipajen
Copy link
Collaborator

ipajen commented Nov 12, 2024

remove the landing page. this works but needs to press enter in the adress bar when switching to multisite in playground. Maybe you can use it for inspiration to find the solution.

{ "step": "writeFile", "path": "/wordpress/wp-content/mu-plugins/redirect-landing.php", "data": "<?php add_action('template_redirect', function() { if (current_user_can('manage_options')) { if (is_multisite() && is_main_site()) { wp_redirect(network_admin_url('index.php?page=aspireupdate-settings')); exit; } elseif (!is_multisite()) { wp_redirect(admin_url('admin.php?page=aspireupdate-settings')); exit; } } }); ?>" },

@asirota
Copy link
Member Author

asirota commented Nov 12, 2024

Is it possible to combine query parameter with blueprint ?multisite=yes&?blueprint-url ? If not maybe a if there is not other way its easier just to have two different blueprints for single and multi with two different landing pages and update the docs what want to be used? And update the Action for correct branch url.

I believe it can. Have a look there are many query parameters including multisite

https://wordpress.github.io/wordpress-playground/developers/apis/query-api/

Have a read over the various options available for query and blueprint API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants