cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 48 forks source link

Saving settings in multisite fails #119

Closed tyrann0us closed 4 years ago

tyrann0us commented 4 years ago

Unfortunately, WordPress is not very consistent when it comes to naming files on single site vs. multisite. For example, there's no wp-admin/network/options.php file. But this very options.php is hardcoded in the plugin: https://github.com/cedaro/satispress/blob/203c878c94b8b3fa00f8c07cd03711f2201f9190/views/screen-settings.php#L49

Expectedly, saving SatisPress' settings in multisite won't work and triggers a 404.

Changing the line to this solves it but I'm not sure if it's the right approach: <form action="<?php echo admin_url( 'options.php' ); ?>" method="post">

bradyvercher commented 4 years ago

I guess that shows how often SatisPress is being used with multisite!

I've usually used a custom action for saving network settings, but if using admin_url() works, let's go with that. Would you like to submit a PR? If so, please throw esc_url() in there, too.