最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

User email verification without a plugin, is it possible?

programmeradmin4浏览0评论

I have found a really great tutorial about creating a plugin that verifies email for new users: Email verification for new users

Is there any possibility to do this directly with core editing and without a plugin?

I have found a really great tutorial about creating a plugin that verifies email for new users: Email verification for new users

Is there any possibility to do this directly with core editing and without a plugin?

Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Aug 30, 2016 at 15:04 Youssef MeskaouiYoussef Meskaoui 191 silver badge2 bronze badges 2
  • If you want to create the possibility of messing things up every time there is a core update, sure that's possible, but it's still not a very smart idea. – cjbj Commented Aug 30, 2016 at 15:14
  • Never edit WP Core itself, all your changes would be overwritten on update, and the code you'd write can be turned into a plugin by putting a comment at the top of the file anyway – Tom J Nowell Commented Aug 30, 2016 at 15:24
Add a comment  | 

2 Answers 2

Reset to default 1

As many people would agree, editing WordPress' core is not recommended because any updates that are made from the official developer (ex: 4.6 to 4.6.1) will override your changes. Plus, editing the core could potentially break your website or any other theme/plugin if it's not properly edited.

This is where plugins come in, they are packed functions that acts as an add on to enhance your WordPress site.

However, if you do not want to use a plugin to achieve this functionality. Your best solution is to add your custom code in your child theme's functions.php file which runs your custom codes on top of WordPress.

Update: per Youssef's comment below

...what code should I add to functions.php to get users to verify their email?

It wouldn't be a few lines of code to add to your functions.php, I can tell you that much.

This will require some work and research on your end since I can't write up something like this. The right approach is to try and solve this question yourself with your own function. Then, when you run into an issue you can't solve, that's where the WPSE community is here for.

We don't want our members to ask people to create a solution without attempting it themselves.

To start, I'd look into other plugins or functions that are available tailor the codes for yourself. For example, this plugin: User Activation Email is worth looking into. Just download the .zip file and play around with the source codes.

Otherwise, if you are not comfortable with any of this, your best bet is to utilize a plugin that already exists. As I mentioned in my original answer, editing WordPress' core is not recommended.

You don't have to change Wordpress's core, you can add this within your theme files. Functions.php would be one way, or just include/require a class in your funtions.php to keep things neat.

 require get_template_directory() . '/verify_user.php';
发布评论

评论列表(0)

  1. 暂无评论