bp_core_install_bbp_emails ()
添加默认bbp邮件。
描述
源
文件:bp-core / admin / bp-core-admin-schema.php
函数bp_core_install_bbp_emails() {$defaults = array('post_status' => 'publish', 'post_type' => bp_get_email_post_type(),);$邮件= bp_email_get_schema ();$description = bp_email_get_type_schema('描述');//将这些邮件添加到数据库中。Foreach ($email as $id => $email) {if (strpos($id, 'bbp-new-forum-', 0) === false){继续;} //一些电子邮件是多站点的。如果(!Is_multisite () && isset($email['args']) && !Empty ($email['args']['multisite']){继续;} $post_id = wp_insert_post(bp_parse_args($email, $defaults, 'install_email_'); $id ) ); if ( ! $post_id ) { continue; } $tt_ids = wp_set_object_terms( $post_id, $id, bp_get_email_tax_type() ); foreach ( $tt_ids as $tt_id ) { $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() ); wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array( 'description' => $descriptions[ $id ], ) ); } } bp_update_option( 'bp-emails-unsubscribe-salt', base64_encode( wp_generate_password( 64, true, true ) ) ); /** * Fires after BuddyPress adds the posts for its bbp emails. * * @since BuddyBoss 1.0.0 */ do_action( 'bp_core_install_bbp_emails' ); }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.0.0 | 介绍了。 |