Help! First plugin.
-
Hi, I’m writing my first plugin, so please bear with me. It’s supposed to execute when a post is initially published (when the button is clicked, but before the status change, hopefully, and check whether appropriate categories have been chosen, otherwise have a pop up appear telling the author to choose a category and then try again.
So I have my basic plugin set up and add an action at “wp_publish” checking for the categories.
And then I run into some problems comprehending the hook/filter structure and possibly experience the consequences of my general state of coding skills, i suppose.
So I can use a add_filter(submitpost_box) to put a div under the submit button, but it will always be there. I cannnot dynamically but it there via the wp_publish hook, or can I?
If I cannot, I could put an empty div there and possibly change it via Javascript, but how would I call a javascript function from within a php functin without an event handler of some sort?
Sorry if these are stupid questions, my “how to write a plugin” tutorial doesn’t really answer them. Maybe someone here can.
Thanks in advance!
yms
The topic ‘Help! First plugin.’ is closed to new replies.