I’ve got a few different files of code so that might get a little complex.
What I’m thinking is that it’s because I’m effectively creating two psts at once, my own custom post type and your gallery post. It might be as simple as moving when I load the mpp actions file, let me check.
Please do link me when you push the code 🙂
About the code:-
$typenow is fine but it tell you more or less about the editing screen and not exactly about the post type being saved.
In our case, we were saving 2 entries(1 for custom post and another for gallery post type). For both, the $typenow remained same as the second post(gallery) creation was triggered programatically. Using get_post_type( $post_id) gave us the current post being saved’s post type.
Hope that clarifies.
The topic ‘ [Resolved] Adding a gallery automatically on post creation’ is closed to new replies.