»WordPress»Record how WordPress judges whether a reviewer is a registered user
Judge whether the reviewer is registered or logged in on the site by judging the user ID to realize the judgment of a special content
preface
Yunluo has been working on themes for the past two days, and one of the problems encountered is simple. Baidu has not found a solution to the problem, or it is because the keywords I searched are wrong. In fact, it is a small skill problem, which is recorded here.
Scenario requirements
First, let's talk about the usage scenario. There is an input box for the website in the comment, but if the user logs in, there is no input box for the website. I think if the commenter is a registered user, there is no input box for the website.The name is linked to the user's home page. If you are not a registered user, you can connect to the website he entered.
In fact, after looking at the following data table, it is found that if the user ID is 0, it is an unregistered user, and the registered user ID is a specific user ID. Record it