• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpmu_signup_user_notification函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpmu_signup_user_notification函数的典型用法代码示例。如果您正苦于以下问题:PHP wpmu_signup_user_notification函数的具体用法?PHP wpmu_signup_user_notification怎么用?PHP wpmu_signup_user_notification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wpmu_signup_user_notification函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpmu_signup_user

/**
 * Record user signup information for future activation.
 *
 * This function is used when user registration is open but
 * new site registration is not.
 *
 * @since MU
 *
 * @param string $user       The user's requested login name.
 * @param string $user_email The user's email address.
 * @param array  $meta       By default, this is an empty array.
 */
function wpmu_signup_user($user, $user_email, $meta = array())
{
    global $wpdb;
    // Format data
    $user = preg_replace('/\\s+/', '', sanitize_user($user, true));
    $user_email = sanitize_email($user_email);
    $key = substr(md5(time() . rand() . $user_email), 0, 16);
    $meta = serialize($meta);
    $wpdb->insert($wpdb->signups, array('domain' => '', 'path' => '', 'title' => '', 'user_login' => $user, 'user_email' => $user_email, 'registered' => current_time('mysql', true), 'activation_key' => $key, 'meta' => $meta));
    wpmu_signup_user_notification($user, $user_email, $key, $meta);
    // Allow custom functionality upon a user signing up successfully
    do_action('MS_Custom_Signup\\wpmu_signup_user', $user, $user_email, $meta, $_REQUEST);
}
开发者ID:aaronholbrook,项目名称:ms-custom-signup,代码行数:25,代码来源:ms-functions.php


示例2: wpmu_signup_user

/**
 * Record user signup information for future activation.
 *
 * This function is used when user registration is open but
 * new site registration is not.
 *
 * @since MU
 * @uses wpmu_signup_user_notification()
 *
 * @param string $user The user's requested login name.
 * @param string $user_email The user's email address.
 * @param array $meta By default, this is an empty array.
 */
function wpmu_signup_user($user, $user_email, $meta = '')
{
    global $wpdb;
    // Format data
    $user = preg_replace('/\\s+/', '', sanitize_user($user, true));
    $user_email = sanitize_email($user_email);
    $key = substr(md5(time() . rand() . $user_email), 0, 16);
    $meta = serialize($meta);
    $wpdb->insert($wpdb->signups, array('domain' => '', 'path' => '', 'title' => '', 'user_login' => $user, 'user_email' => $user_email, 'registered' => current_time('mysql', true), 'activation_key' => $key, 'meta' => $meta));
    wpmu_signup_user_notification($user, $user_email, $key, $meta);
}
开发者ID:nhemsley,项目名称:wordpress,代码行数:24,代码来源:ms-functions.php


示例3: resend

 /**
  * Resend an activation email.
  *
  * @since 2.0.0
  *
  * @param array $signup_ids Single ID or list of IDs to resend.
  * @return array
  */
 public static function resend($signup_ids = array())
 {
     if (empty($signup_ids) || !is_array($signup_ids)) {
         return false;
     }
     $to_resend = self::get(array('include' => $signup_ids));
     if (!($signups = $to_resend['signups'])) {
         return false;
     }
     $result = array();
     /**
      * Fires before activation emails are resent.
      *
      * @since 2.0.0
      *
      * @param array $signup_ids Array of IDs to resend activation emails to.
      */
     do_action('bp_core_signup_before_resend', $signup_ids);
     foreach ($signups as $signup) {
         $meta = $signup->meta;
         $meta['sent_date'] = current_time('mysql', true);
         $meta['count_sent'] = $signup->count_sent + 1;
         // Send activation email.
         if (is_multisite()) {
             wpmu_signup_user_notification($signup->user_login, $signup->user_email, $signup->activation_key, serialize($meta));
         } else {
             // Check user status before sending email.
             $user_id = email_exists($signup->user_email);
             if (!empty($user_id) && 2 != self::check_user_status($user_id)) {
                 // Status is not 2, so user's account has been activated.
                 $result['errors'][$signup->signup_id] = array($signup->user_login, esc_html__('the sign-up has already been activated.', 'buddypress'));
                 // Repair signups table.
                 self::validate($signup->activation_key);
                 continue;
                 // Send the validation email.
             } else {
                 bp_core_signup_send_validation_email(false, $signup->user_email, $signup->activation_key, $signup->user_login);
             }
         }
         // Update metas.
         $result['resent'][] = self::update(array('signup_id' => $signup->signup_id, 'meta' => $meta));
     }
     /**
      * Fires after activation emails are resent.
      *
      * @since 2.0.0
      *
      * @param array $signup_ids Array of IDs to resend activation emails to.
      * @param array $result     Updated metadata related to activation emails.
      */
     do_action('bp_core_signup_after_resend', $signup_ids, $result);
     /**
      * Filters the result of the metadata for signup activation email resends.
      *
      * @since 2.0.0
      *
      * @param array $result Updated metadata related to activation emails.
      */
     return apply_filters('bp_core_signup_resend', $result);
 }
开发者ID:buddypress,项目名称:BuddyPress-build,代码行数:68,代码来源:class-bp-signup.php


示例4: resend_email

 /**
  * Resends an activation email
  *
  * This sends exactly the same email the registrant originally got, using data pulled from
  * their registration. In the future I may add a UI for customized emails.
  *
  * @package Unconfirmed
  * @since 1.0
  *
  * @uses wpmu_signup_blog_notification() to notify users who signed up with a blog
  * @uses wpmu_signup_user_notification() to notify users who signed up without a blog
  */
 function resend_email()
 {
     global $wpdb;
     // Hubba hubba
     if (isset($_REQUEST['unconfirmed_bulk'])) {
         check_admin_referer('unconfirmed_bulk_action');
     } else {
         check_admin_referer('unconfirmed_resend_email');
     }
     // Get the user's activation key out of the URL params
     if (!isset($_REQUEST['unconfirmed_key'])) {
         $this->record_status('error_nokey');
         return;
     }
     $resent_counts = get_site_option('unconfirmed_resent_counts');
     $keys = $_REQUEST['unconfirmed_key'];
     foreach ((array) $keys as $key) {
         if ($this->is_multisite) {
             $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %s", $key));
         } else {
             $user = $this->get_userdata_from_key($key);
         }
         if (!$user) {
             $this->record_status('error_nouser', $key);
             continue;
         }
         if ($this->is_multisite) {
             // We use a different email function depending on whether they registered with blog
             if (!empty($user->domain)) {
                 wpmu_signup_blog_notification($user->domain, $user->path, $user->title, $user->user_login, $user->user_email, $user->activation_key, maybe_unserialize($user->meta));
             } else {
                 wpmu_signup_user_notification($user->user_login, $user->user_email, $user->activation_key, maybe_unserialize($user->meta));
             }
         } else {
             // If you're running BP on a non-multisite instance of WP, use the
             // BP function to send the email
             if (function_exists('bp_core_signup_send_validation_email')) {
                 bp_core_signup_send_validation_email($user->ID, $user->user_email, $key);
             }
         }
         if (isset($resent_counts[$key])) {
             $resent_counts[$key] = $resent_counts[$key] + 1;
         } else {
             $resent_counts[$key] = 1;
         }
         // I can't do a true/false check on whether the email was sent because of
         // the crappy way that WPMU and BP work together to send these messages
         // See bp_core_activation_signup_user_notification()
         $this->record_status('updated_resent', $key);
     }
     update_site_option('unconfirmed_resent_counts', $resent_counts);
 }
开发者ID:adenilsonpaiva,项目名称:redelivre,代码行数:64,代码来源:unconfirmed.php


示例5: wpmu_signup_user

function wpmu_signup_user($user, $user_email, $meta = '')
{
    global $wpdb;
    $user = preg_replace("/\\s+/", '', sanitize_user($user, true));
    $user_email = sanitize_email($user_email);
    $key = substr(md5(time() . rand() . $user_email), 0, 16);
    $registered = current_time('mysql', true);
    $meta = serialize($meta);
    $wpdb->query("INSERT INTO {$wpdb->signups} ( domain, path, title, user_login, user_email, registered, activation_key, meta )\n\t\t\t\t\tVALUES ( '', '', '', '{$user}', '{$user_email}', '{$registered}', '{$key}', '{$meta}' )");
    wpmu_signup_user_notification($user, $user_email, $key, $meta);
}
开发者ID:alx,项目名称:blogsfera,代码行数:11,代码来源:wpmu-functions.php



注:本文中的wpmu_signup_user_notification函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpmu_update_blogs_date函数代码示例发布时间:2022-05-23
下一篇:
PHP wpmu_signup_user函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap