I am new to wordpress. I am trying to call function myprefix_edit_user_cb()
to get the edit form after user clicks on edit.
function getdata()
{
$blogusers = get_users();
foreach ( $blogusers as $user ) {
echo '<span>' . esc_html( $user->user_email ) . '</span>';
$editUrl = ??
echo "<a href='".$editUrl. "'>Edit User</a>";
echo '<br>';
}
}
with function:
function myprefix_edit_user_cb(){
$user = intval($_REQUEST['user']);
echo '
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
<label>Username</label>
<input type="text" value="' .$user->user_login . '"
<input type="submit">
';
}
According to me you need to put some request flag with your edit url.
Try the below code.
with action and callback function with flag :