简体   繁体   English

将脚本添加到Wordpress中的is_user_logged_in()函数

[英]Add script to is_user_logged_in() function in wordpress

im trying to use a plugin called New User Approve for wordpress, that allow me to approve or not access to my private areas in my website. 我正在尝试使用名为New User Approve的插件进行wordpress操作,该插件使我可以批准或不访问我网站上的私人区域。

the simple way i found in order to do it is using user_meta: 我找到的简单方法就是使用user_meta:

get_user_meta(get_current_user_id(),"pw_user_status",true) != "pending"

but the theme im using is doing pretty much everything concerning users access, and it uses this is_user_logged_in() function many times. 但是im使用的主题几乎完成了所有与用户访问有关的事情,并且多次使用此is_user_logged_in()函数。

the ideal thing i would like to do is to add a function that checks the user meta as part as the user login check function. 我想做的理想的事情是添加一个功能,该功能作为用户登录检查功能的一部分来检查用户meta。

any one knows how to help me with it? 有人知道如何帮助我吗? im almost thinking about editing the core (got bless). 我几乎在考虑编辑核心(保佑)。

if ($GLOBALS['user'] != false) {
    wp_enqueue_script( 'what-input', get_template_directory_uri() . '/assets/js/what-input.min.js', array(), '', true );
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM