woocommerce用户注册后显示“ Welcome”弹出窗口

问题描述

我有一个新用户弹出窗口,但我不知道该怎么称呼它。我应该使用哪个钩子来显示弹出窗口?

      <script>
                jQuery(document).ready(function(){
                    jQuery( window ).load(function() {
                        jQuery('.newsletterpopup').show();
                        jQuery('.popupshadow').show();
                    }); 
            });
             </script>

此代码显示欢迎弹出窗口

解决方法

您只需在WordPress中使用 user_register 钩子,然后在回调函数中显示您的欢迎弹出窗口

add_action( 'user_register','myfunction',10,1 );

function myfunction( $user_id ) {

// Your code here

}

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...