admin管理员组

文章数量:1122832

I have developped an external app to manage my physical shop. I'm using couples of WordPress functions to perform some actions.

It's works great it I'm using the app from subfolder (example : domain/app/) but I would use it on subdomain (example : app.domain) but I cannot access to it, it redirect everytime on the WordPress site : domain/wp-signup.php?new=app

Do you guys knows how to deal with that ? I could use Rest API but I'm on Wordpress MultiSite contexte, I'm using 'switch_to_blog()' function... to perform some DB calls.

I have developped an external app to manage my physical shop. I'm using couples of WordPress functions to perform some actions.

It's works great it I'm using the app from subfolder (example : domain.com/app/) but I would use it on subdomain (example : app.domain.com) but I cannot access to it, it redirect everytime on the WordPress site : domain.com/wp-signup.php?new=app

Do you guys knows how to deal with that ? I could use Rest API but I'm on Wordpress MultiSite contexte, I'm using 'switch_to_blog()' function... to perform some DB calls.

Share Improve this question asked Sep 24, 2024 at 14:41 Vincent GuesnéVincent Guesné 1931 silver badge12 bronze badges 1
  • I don't understand the last sentence about API and multisite. If you don't have the endpoint that you need, you can write a plugin to extend the API. – mmm Commented Sep 24, 2024 at 14:45
Add a comment  | 

1 Answer 1

Reset to default 0

I think that's getting triggered by wp-load being unable to identify which blog you're on at load time. I'd try

define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

before you include wp-load, looking up the correct IDs for domain.com/app/ from your wp_blogs table.

本文标签: multisiteExternal app using wpload on subdomain