我想执行我自己的欢迎新用户电子邮件通知,而不是function welcome_user_msg_filter(){}
位于ms功能中。php
我最近learned how to override functions in pluggable.php, 但我引用的函数没有自己的if ( ! function_exists( \'welcome_user_msg_filter\' ) ) {}
.
是否有人重写过存在于ms-functions.php
?
如果是的话,你会怎么做?
谢谢
我想执行我自己的欢迎新用户电子邮件通知,而不是function welcome_user_msg_filter(){}
位于ms功能中。php
我最近learned how to override functions in pluggable.php, 但我引用的函数没有自己的if ( ! function_exists( \'welcome_user_msg_filter\' ) ) {}
.
是否有人重写过存在于ms-functions.php
?
如果是的话,你会怎么做?
谢谢
函数,这些函数没有封装在functions_exists()
呼叫并不意味着可插拔。如果您正在搜索扩展,那么请使用过滤器或挂钩,以防有一些。
正如您在phpDocBlock中所读到的:
确保欢迎消息不为空。当前未使用。
所以这个过滤器不起作用。
我不是MU专家,但也许你可以使用以下过滤器:
apply_filters( \'wpmu_signup_blog_notification_email\',
__( "To activate your blog, please click the following link:\\n\\n%s\\n\\nAfter you activate, you will receive *another email* with your login.\\n\\nAfter you activate, you can visit your site here:\\n\\n%s" ),
$domain, $path, $title, $user, $user_email, $key, $meta
)
你可以这样称呼它:function wpse56797_signup_blog_notification_email( $message, $domain, $path, $title, $user, $user_email, $key, $meta )
{
$message = \'Your custom notification\';
return $message;
}
add_filter( \'wpmu_signup_blog_notification_email\', \'wpse56797_signup_blog_notification_email\', 10, 8 );
我正在开发一个WP插件,我想向pluggable添加一个自定义函数。php(位于/wp includes)。我正在从admin调用该函数。php(位于/wp admin)考虑一下功能auth_redirect 这是从admin调用的。php。auth_redirect 是在pluggable中定义的函数。php检查登录的用户,否则它会将他们重定向到登录页面。同样,我有自己的自定义函数。那么,是否有任何特定的钩子或过滤器,我必须使用它们来将我的函数附加到可插拔的。php。目前,我正在使用fwrite() 将