OK, for those who haven’t heard, I’ve been working on a plugin for 1.2 that will help mimic “static” pages in WP. What I’ve done is in the write post page, added an additional check box at the bottom of the categories listing called “Make Static”. When the post is published, if this box is marked, I want to set the catID for the post to -1. So… I wrote the plugin to hook into edit_post and publish_post events so that when it’s either published or edited and saved, it will check for flag and reset the category id if necessary.
Here’s the bit I seem to be having a problem with. If I create post (this is from the advanced screen) click the “Make Static” check box and hit the “Publish” button…. it doesn’t work. BUT, if I then edit the post, reclick the Make Static, then press the Save button, the change will take.
I’ve checked my code, I don’t seem to be doing anything wrong. I’ve checked the code where the hook is called from, it’s very clearly after the category IDs are saved, so it should work. I just don’t know why not. Does any one else have any ideas?
- The topic ‘Post Categories and the publish_post hook’ is closed to new replies.