Hello reader's, today we will discuss about "How to pass extra variable in URL in Wordpress".
Suppose , Admin want to update the user detail then they go to user listing page and select the user and click edit button or link. When clicking edit link, we can bind user_id to URL and jump to other page.
Below is the example of how to send extra parameter through URL in Wordpress
<a href="<?php echo get_the_permalink(get_page_by_title('Contact')->ID);?>?uid=5">Edit</a>
On the basis of user_id we can fetch all the record of the user.
Below is the example how to get extra variable value.
User Id = <?php echo $_GET['uid']; ?>
0 Comment(s)