Tag Info

Hot answers tagged

5

$_SERVER['REQUEST_URI'] will not be empty in WordPress, because it is filled in wp_fix_server_vars() (file wp-includes/load.php). This function is called in wp-settings.php before any plugin is loaded. So you can use it. But always escape the value. It is global and can be changed by any other code, so you cannot trust its value.


3

Add a rewrite endpoint to give your plugin a public URL- function wpa_my_endpoint(){ add_rewrite_endpoint( 'my_api', EP_ROOT ); } add_action( 'init', 'wpa_my_endpoint' ); After you flush rewrite rules, you'll have the URL available for the scheduler to ping. http://example.com/my_api/do/something/ Then catch those requests on the parse_query ...



Only top voted, non community-wiki answers of a minimum length are eligible