How to set in a post an hyperlink using the current user id?
Quote from FTP on June 20, 2019, 1:58 pmHi,
Just a question in case any one has the solution.
It not specifically related to Asgaros.To help users I write some how-to.
Sometimes, to make it easier, I include hyperlinks to pages/functionalities.
But sometimes I need the current user’s id to build the url.For example. On Asgaros or Ultimate Member for another website, in my advises, I suggest users to update their profile (the Asgaros or Ultimate Member profile).
So I would like to add in my advises the hyperlink to the profile page to make it easier.But either on Asgaros or Ultimate Member, the URL looks like that:
https://www.mywebsite.com/user/wp_user_id/
https://www.mywebsite.com/profile/wp_user_id/They both need the current user’s user_id.
So how can I include the current user’s id in an hyperlink in a post?Can we use any kind of BBcode, short code, html/php code, etc.?
Or does an extension provide this possibility?Thanks!
Hi,
Just a question in case any one has the solution.
It not specifically related to Asgaros.
To help users I write some how-to.
Sometimes, to make it easier, I include hyperlinks to pages/functionalities.
But sometimes I need the current user’s id to build the url.
For example. On Asgaros or Ultimate Member for another website, in my advises, I suggest users to update their profile (the Asgaros or Ultimate Member profile).
So I would like to add in my advises the hyperlink to the profile page to make it easier.
But either on Asgaros or Ultimate Member, the URL looks like that:
https://www.mywebsite.com/user/wp_user_id/
https://www.mywebsite.com/profile/wp_user_id/
They both need the current user’s user_id.
So how can I include the current user’s id in an hyperlink in a post?
Can we use any kind of BBcode, short code, html/php code, etc.?
Or does an extension provide this possibility?
Thanks!
Quote from Asgaros on June 20, 2019, 2:27 pmHello @ftp
I think what you require is some kind of custom-plugin which adds a new shortcode to your site. For this shortcode a URL must be defined so that the ID of the current user can be applied to it automatically at a defined position. Asgaros Forum also supports custom-shortcodes so it would be possible to use it inside of the forum as well.
However, such a functionality can only be added by a custom-plugin and requires knowledge in the WordPress-API and PHP. Here you can find more information:
Hello @ftp
I think what you require is some kind of custom-plugin which adds a new shortcode to your site. For this shortcode a URL must be defined so that the ID of the current user can be applied to it automatically at a defined position. Asgaros Forum also supports custom-shortcodes so it would be possible to use it inside of the forum as well.
However, such a functionality can only be added by a custom-plugin and requires knowledge in the WordPress-API and PHP. Here you can find more information:
Quote from FTP on June 20, 2019, 3:38 pmHi @asgaros,
You’ve put me on the right way!
https://wordpress.org/plugins/user-shortcodes/https://wordpress.org/plugins/user-shortcodes-plus/
It works like a charm, including on Asgaros 😉
Thanks very much!
Hi @asgaros,
You’ve put me on the right way!
It works like a charm, including on Asgaros 😉
Thanks very much!