from custom-post-type to edit-media and redirect to cpt on update/save
I finally have a problem I’m unable to solve.
I’ve build a custom post type into a plugin. You can add attachements (post-type==attachement) to this post type via the media library. Since the attachements meta-data is also used I thought it easy to also link directly to attachements edit page (get_edit_post_link($id)). That get_edit_post_link function indeed brings you to the ‘edit media’ page but when you push the update/save button you are redirected to the Media overview page. Off course in this case I would like it to redirect back to my custom post type.
I’ve tried the add_filter(‘redirect_post_location’…) but appearantly it’s not working for post-type==’attachement’ (unfortunately there’s no docs on redirect_post_location).
Does anybody have a solution? I was thinking somewhere along the lines of: get_edit_post_link($id).’&redir=’.$_SERVER[‘PHP_SELF’]
- The topic ‘from custom-post-type to edit-media and redirect to cpt on update/save’ is closed to new replies.