<!/ P>
我希望在我的页面上看到一个简单的文字,提醒订阅者必须编辑的是preson名称和他的个人资料。
仅当wordpress用户个人资料名称为空时,此文本才会显示。
有人知道php代码吗?
我在HTML profil页面上有这个作为输入。
当此输入为空时,我想在php中显示一条消息。
输入class =“输入文字”name =“ account_first_name ”id =“ account_first_name ”value =“”type =“text “
坦克你,我正在使用woocommerce
答案 0 :(得分:1)
也许占位符是你想要的?
<input class="input-text" name="account_first_name" id="account_first_name" value="" type="text" placeholder="Remember to edit this!">
如果没有,并且您想使用PHP检查变量是否为空,则使用空函数。
<?php
$name = "";
if(empty($name)){
echo "Remember to edit name";
}
?>