You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in @faustwp/core: 3.0.1 package, there is a way to hook into wpUrl method. But there is no way to hook into the adminUrl, and as far as there is a way to override SiteName link in the custom toolbar with snippet like this:
hooks.addFilter('toolbarNodes','faust',(toolbarNodes: FaustToolbarNodes,context: FaustToolbarContext)=>{constadminUrl=getAdminUrl().replace('/wp-admin','/wp/wp-admin');constcustomToolbarNodes: FaustToolbarNodes=[{id: 'site-name',location: 'primary',component: <SiteNameurl={adminUrl}/>,},];// Removing default site name node to be able to override admin urltoolbarNodes=[
...toolbarNodes.filter((node)=>node.id!=='site-name'),];return[...customToolbarNodes, ...toolbarNodes];},);
there is no way to override rest of the toolbar items to render proper admin urls.
Would be great if we could do something like:
// @note: wpAdminUrl filter is not currently part of @faustwp/core packagehooks.addFilter('wpAdminUrl','faust',(url: string)=>{returnurl.replace('/wp-admin','/wp/wp-admin');// or whatever admin url modification is needed});
There is a similar request to this one, but it is related to WordPress faustwp plugin #1872 (comment)
The text was updated successfully, but these errors were encountered:
While @theodesp 's PR, which would solve this in a JavaScript filter for wp-admin in Faust users is excellent, I've asked us both to step back on that for the moment. The issue is that there are more paths than just wp-admin that may need to be accessed directly. As I reviewed his PR I was actually working on #1872 which addresses a different symptom of the same issue with a PHP filter in WordPress. Both would work, but doesn't solve the issue.
The approach we're looking at instead is to expose this via WP GraphQL and I've opened wp-graphql/wp-graphql#3145 to discuss that. I believe this would best help you (so you don't have to ask us for another filter if you have to access something else in the WordPress filesystem) as well as all Faust users and beyond.
It conflates the site_url with the home_url (like many parts of Fausts frontend/backend).
It assumes that the admin URI is wp-admin, when it's theoretically possible to move it with some filters and server rewrite rules.
As with #1872 (comment), I believe the ideal pattern is inheritable constants, and shouldn't require an extra GraphQL request to resolve.
(Fun fact #1360 was actually designed to workaround this exact issue, since /graphql is located on site_url but Faust was forcing it on the home url. There are several other examples of this in both the frontend and in replacements.php)
@ChrisWiegman please confirm/correct my assessment 🙏
Currently in
@faustwp/core: 3.0.1
package, there is a way to hook into wpUrl method. But there is no way to hook into theadminUrl
, and as far as there is a way to overrideSiteName
link in the custom toolbar with snippet like this:there is no way to override rest of the toolbar items to render proper admin urls.
Would be great if we could do something like:
There is a similar request to this one, but it is related to WordPress
faustwp
plugin #1872 (comment)The text was updated successfully, but these errors were encountered: