Wordpress 和虚荣用户 URL
想知道是否有人有任何聪明的方法来在用户注册时创建动态虚荣用户网址。我的网站基本上使用电子邮件作为用户名。我有正则表达式来删除“@”符号之前的文本(例如“[email protected ]”变成“名称”)然后我想采用“名称”并创建一个虚荣网址(例如domain.com/name或name.domain.com)
关于如何使用Wordpress完成此操作有什么想法吗?我是一个相当高级的 WordPress 用户,我的第一个想法是执行以下
- 操作验证用户注册
- 用户注册成功后创建以用户名作为标题的页面名称(这将帮助我实现 www.domain.com/username)
- 应用预设模板到具有所需视图的页面
欢迎任何和所有想法。
Was wondering if anyone had any smart approaches to creating dynamic vanity user urls upon user registration. My site basically uses emails as usernames. I have the regex to strip the text before the "@" symbol (e.g. "[email protected]" becomes "name") I would then like to take the "name" and create a vanity url (e.g. domain.com/name or name.domain.com)
Any thoughts on how to accomplish this with Wordpress? I'm a pretty advanced Wordpress user and my first thoughts were to do the following
- Verify user registration
- Upon successful user registration create page name with username as the title (this would help me achieve the www.domain.com/username)
- Apply preset template to that page with the desired view
Any and all thoughts are welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 wordpress 作者 slug 插件,它似乎(几乎完全)做到了这一点?
Check out the wordpress author slug plugin, it seems to do (almost exactly) that?
我实际上自己解决了这个问题。只需像平常一样创建帖子,并将帖子类型设置为页面即可。希望这对那里的人有帮助。
I actually figured this out on my own. Just create a post like you normally would and but set the post type to page. Hope this helps someone out there.