Add ajax to new post page
-
Hello,
I’m trying to add a simple ajax callback to my ‘new post’ page.
When I create new posts, I have info that is easy for a server to fetch, but a hassle for me to type out. I’d like to be able to trigger the call, and fill my blank post up with the fetched text.
This doesn’t sound easy, and so a fallback is for me to just print the text out somewhere on the page for me to copy paste to the new post. I could even write this as a separate plugin with it’s own page, but the fewer steps I can have between clicking the trigger and filling my post with the fetched text, the better.
Work I’ve done so far:
I’ve poured over the docs for adding ajax to an admin page. I’ve tried to add or include the various test calls straight to the edit-form-advanced page (no luck). I’ve tried adding simple text / javascript to the edit-form-advanced page (that works just fine). I seem unable to call a php callback from the new post page.
Any help is welcome, including “Don’t do it that way. You’ll break wordpress”.
- The topic ‘Add ajax to new post page’ is closed to new replies.