duanfeng7756 2012-09-21 18:04
浏览 27
已采纳

如果在wordpress中存在,则不允许注册用户URL

I'm trying to set up registration on WordPress that doesn't allow user's website to register more times. Simply said - I don't want one user to register many times with the same website. This works with emails and username. If the email is already in use won't allow registration. The same thing but for the users urls. Do you have any suggestion how to set up? Thanks!

I have tried to create a function that checks for url and if it finds it will create an error. But I'm not sure if there are other instances that prevents my set up because it doesn't work. Also I'm using wp-members plugin for registration. The code I was trying to edit was in wp-includes/users.php

function user_url_exists( $user_url ) {
if ( $user_url = get_user_by('url', $user_url) ) {
        return $user_url->ID;
} else {
        return null;
}}

if ( !$update && ! defined( 'WP_IMPORTING' ) && user_url_exists($user_url) ) return new WP_Error('existing_user_url', __('This website address is already registered.') ); 
  • 写回答

2条回答 默认 最新

  • dongxue163536 2012-09-22 08:30
    关注

    You can try WangGuard plugin. :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题