'publish-{custom-post-type}' hook is firing many, many times on a single submit
-
I’m writing my first plugin, and I have a the following action that’s added (within a class) when the plugin is loaded:
add_action( 'publish_appt', array($this, 'save_my_appt_metadata'),10,3); function save_my_appt_metadata($post_id, $post, $update = true) { //do some stuff, then $this->create_my_appt($post_id, $post); } function create_my_appt($post_id, $post) { //create a google calendar event }
When I publish my ‘appt’ custom post type, the
save_my_appt
andcreate_my_appt
functions are run infinitely until a fatal time-out error occurs. This results in something like 60 or 80 calendar entries! What am I overlooking here?
- The topic ‘'publish-{custom-post-type}' hook is firing many, many times on a single submit’ is closed to new replies.