Plugin: Exit on wp-json / wp-admin requests
-
When a gutenbrg-block /page is saved, the shortcode inside are executed. This is bad when the plugin crashes or sends or in this situation the plugin seems to fail.
My plugin tries to get external API-data. If the external API-URL is invalid or temporarilly unavailable the page won’t save. Or the debugmode sends info.
https://www.ads-software.com/plugins/json-content-importer/My solution in my plugin: If the REQUEST_URI is wp-json or wp-admin the plugin is terminated by a return “”;
This works but seems not that elegant.
Is it a bad idea?Bernhard
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin: Exit on wp-json / wp-admin requests’ is closed to new replies.