I need a link that directs the user that is logged to his profile
I want a link in the form to an image in the frontpage, that direct the user that is logged to the subscription packages that are on its profile:
The link look like this: https://mywebsite.co.uk/author/admin/?screen=acc_pay
But I want for the user part /admin/ to change depending on the user that is logged.
This is the page were the link should be
And this is were it should lead undependant of the user that is logged in, so I need a customized link that leads to the author page of the user that is logged
This is the result of imputing this code
?php
$author_page = is_user_logged_in() ? get_author_posts_url( get_current_user_id() ) : NULL;
$acc_pay_page = $author_page ? add_query_arg( 'screen', 'acc_pay', $author_page ) : NULL;
if ( $acc_pay_page) {
echo 'a href=' . esc_url( $acc_pay_page ) .'img src=https://mywebsite.co.uk/wp-content/uploads/2020/10/pricing-06.png //a';
} else {
echo 'spanPlease log in/span';
}
?