Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter andyjoyce28

    (@andyjoyce28)

    Thanks @catacaustic

    So, I conceptually I understand now that I do the following:

    In my Javascript:

    • Use Jquery+Ajax to set a GET or POST request to a PHP file on the server, with the user id, meta data key, and value (for POST)
    • Wait for response and process accordingly

    On The server:

    • Have a PHP file that responds appropriately to the GET and POST requests, to retrieve or add/update the user meta data?
    • This PHP scripts will use the wp_get_user_data and wp_update_user_data functions.

    So I have additional questions:

    • Do I have to do anything special for this to work for a (logged in) user updating their own meta data?
    • Where in the WordPress folder hierachy should I put my PHP script? Does it matter?
    • Is there a limit to the length of a string I can pass as the meta data parameter?
    • In the PHP script is it correct that I use the $_POST[] array to access the parameters I have passed in the request?
    • And I can pass multiple parameters? (e.g. meta keyname and meta data)

    Thanks

Viewing 1 replies (of 1 total)