Including Current Employer on a profile causes issues with API requests in WordPress
Overview
We have an events signup form in which we would like to include the Current Employer field. The form works fine for signed in users, but for public access the Stripe payment intent POST request gets sent to wp-admin/admin.php rather than the Civi API endpoint. This obviously fails as wp-admin/admin.php is not accessible to non-authenticated users. There seems to be something about this field which changes the endpoint API requests are sent to.
Reproduction steps
- Go to event sign up form
- Complete all details including card number etc
- Got an error "Configuration error - unable to process paymentIntent".
Current behaviour
API requests being sent to wp-admin/admin.php rather than the Civi API endpoint
Expected behaviour
API requests should go to the Civi API endpoint
Environment information
- __CiviCRM: 5.52.2
- __PHP: 7.4
- __CMS: WordPress 6.0.2