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

Framework: redirecting to wp-admin URL #867

Closed
youknowriad opened this issue May 22, 2017 · 2 comments
Closed

Framework: redirecting to wp-admin URL #867

youknowriad opened this issue May 22, 2017 · 2 comments
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript

Comments

@youknowriad
Copy link
Contributor

In some places, we need to build and redirect to wp-admin URLs. In order to achieve this, we'll have to provide the baseUrl of wp-admin to JS.

We're already building URLs to the gutenberg editor by parsing the current URL and appending a query string but this not enough to navigate to other wp-admin pages. (see #862 (comment))

How do you think we should do this? append the base URL to the settings endpoint? provide a global JS variable while initializing the Editor?

@youknowriad youknowriad added the Framework Issues related to broader framework topics, especially as it relates to javascript label May 22, 2017
@aduth
Copy link
Member

aduth commented May 22, 2017

There are some filters run server-side that will be problematic to recreate (notably admin_url), to the point that we may simply need to ignore those effects.

See: https://github.com/WordPress/WordPress/blob/21b1135/wp-includes/link-template.php#L3105-L3133

For a solution, I like the global containing siteurl to which we could append, or maybe even just a relative link (e.g. edit.php?...). This is what's done for the admin sidebar menu navigation (source).

@youknowriad
Copy link
Contributor Author

I'm closing this for now, It doesn't seem so useful after all. The current approach works well. This could be a concern later once we move other parts of WordPress to frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Projects
None yet
Development

No branches or pull requests

2 participants