How to pass extra variable in wordpress admin post.php


i want to pass variable post edit url in edit.php by default this is the link"

I want to add one or more variable in this url like"

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?




Following code will do the job:

add_action('add_meta_boxes_post', 'add_extra_param');

function add_extra_param( $post ){

       <script type="text/javascript">
            window.location = window.location.href + '&new_param=new_value';


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':

Though you don't have to deal with meta boxes here, these hooks run when you access any post in the admin area.

People are also looking for solutions to the problem: PHP Array duplicate data count


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.