Forums

Call php to generate file on user publish post? (3 posts)

  1. HeroicNate
    Member
    Posted 5 months ago #

    I have a php script that will generate a text file based on the post ID passed into it. I have it set so that it will run when a user publishes a post, I know this is functioning because if I screw up my script an error results while publishing a post. The problem is that it is not generating the text file like I want and I can't figure out why not. The script on it's own(if I just enter the address in my browser), works just fine and generates the text file. But when it runs from the publish action(no errors) no text file is generated, or atleast the text file did not show up where I intended.

    Does anyone have any idea why this is occurring? If running from a publish hook, does it do something special to disable file generation? or does it put it somewhere that overrides my target location?

  2. markparolisi
    Member
    Posted 5 months ago #

    code or it didn't happen.

  3. HeroicNate
    Member
    Posted 5 months ago #

    despite the rude reply I figured it out. Turns out it runs out of the wp-admin folder and that's where it saves files by default. Now that I know the base folder I can tell it where to save the files accordingly.

Reply

You must log in to post.

About this Topic