• I am new to writing plugins. From a subpage to the settings menu a user submits data with an ajax call. The file that handles the call is in same directory as the one that calls.

    The data arrives as they should and returns. In my test it alerts the data which were supposed to be written to a file before returning.

    But no writing takes place. I have double checked the url I write to. It is possible to write from the file which makes the ajax call with exactly the same code (‘except for the data’), the data is not the reason because I have tried with a small static string also. With a small static string it goes fine from the file which calls ajax but not as it should from the file which handles the call

    I use the WP_CONTENT_DIR as base for url and usually have no problem. Any suggestions

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

    (@jaip)

    The variable WP_CONTENT_DIR seems not to be defined in the file which answers the ajax call. This is the reason. How can I define it?

Viewing 1 replies (of 1 total)
  • The topic ‘file_put_contents() during ajax call’ is closed to new replies.