How to pass extra variable in wordpress admin post.php
766
i want to pass variable post edit url in edit.php by default this is the link
http://wordpresssite.com/wp-admin/post.php?post=62&action=edit"
I want to add one or more variable in this url like
http://wordpresssite.com/wp-admin/post.php?post=62&action=edit&post_type=newproduct"
when the user click anyone of the post listed in all post it will redirect to post.php with new variables how can we do this?
Answer
Solution:
Following code will do the job:
If you want to specify a post type before appending a parameter, you can use 'add_meta_boxes' hook. See, here the details of both the hooks i.e. 'add_meta_boxes_post' and 'add_meta_boxes': http://codex.wordpress.org/Plugin_API/Action_Reference/add_meta_boxes
Though you don't have to deal with meta boxes here, these hooks run when you access any post in the admin area.