Dynamic parameter for Wordpress plugin

Asked

Viewed 88 times

0

I have the need to send a parameter to mine plugin, this parameter is the folder path of that user.

Variable example:

$folder = /clientes/id_1/
$folder = /clintes/id_2/
$folder = /clientes/id_3/

These folders are generated automatically, each client has its own, here’s my problem, I need to send this variable with the folder path to my plugin save it in session but have no idea how to do that.

I had been trying an AJAX request, straight to the root file of my plugin by passing the variable $folder by the method GET, but it’s not working.

Note: I do not want to touch the files of Woordpress/ Woocommerce, I need to reuse the do_actions of the files themselves to maintain Thema/WP updates.

  • Some context is missing here: who sends the parameter? how is your plugin receiving it?

1 answer

0

Well, I couldn’t find a more viable solution than sending a request for a second file inside my plugin (When I sent to the main it returned an error, so I tried to send to a secondary file without any link to the main)responsible only for setting the session.

I’m sure it’s not the right way to work, but it’s what I was able to do to solve my problem...

If anyone knows a better way to do this, feel free to share the knowledge.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.