Skip to main content
Made title more descriptive, fixed formatting and added a tag.
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

How to define a callback for an URI?

I have a function in functions.php like so:

function myplugin_mycallback($id) { // do something }

function myplugin_mycallback($id) {
  // do something
}

I want this function called whenever a URL like myplugin/mycallback/xxx is accessed.

How/where do I define this path so it doesn't generate a 404?

How to define a callback

I have a function in functions.php like so:

function myplugin_mycallback($id) { // do something }

I want this function called whenever a URL like myplugin/mycallback/xxx is accessed.

How/where do I define this path so it doesn't generate a 404?

How to define a callback for an URI?

I have a function in functions.php like so:

function myplugin_mycallback($id) {
  // do something
}

I want this function called whenever a URL like myplugin/mycallback/xxx is accessed.

How/where do I define this path so it doesn't generate a 404?

Source Link

How to define a callback

I have a function in functions.php like so:

function myplugin_mycallback($id) { // do something }

I want this function called whenever a URL like myplugin/mycallback/xxx is accessed.

How/where do I define this path so it doesn't generate a 404?