Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/27/2016 08:23:37 PM (10 years ago)
Author:
djpaul
Message:

Emails: add post type and taxonomy, and supporting wp-admin customisations.

All of BuddyPress' emails have been moved into email posts. The change includes an installation routine, but this won't be run until the db_version number is bumped in a subsequent commit. Updates to functions using wp_mail will also follow.

Tokens are used to personalise the email content (e.g. to add a link to the recipient’s user profile). Each type of email in BuddyPress has been assigned a unique type, and these are mapped to the email post through a new "email type" taxonomy.

The change includes a new HTML email template based on work by Ted Goas and contributors from the Cerberus email templates project. Ted, thank you very much. Learn more at http://tedgoas.github.io/Cerberus/

See #6592. Props timersys, mercime, boonebgorges, hnla, DJPaul.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-loader.php

    r10417 r10474  
    285285
    286286        parent::setup_cache_groups();
     287    }
     288
     289    /**
     290     * Set up post types.
     291     *
     292     * @since BuddyPress (2.4.0)
     293     */
     294    public function register_post_types() {
     295
     296        // Emails
     297        register_post_type(
     298            bp_get_email_post_type(),
     299            apply_filters( 'bp_register_email_post_type', array(
     300                'description'       => _x( 'BuddyPress emails', 'email post type description', 'buddypress' ),
     301                'labels'            => bp_get_email_post_type_labels(),
     302                'menu_icon'         => 'dashicons-email',
     303                'public'            => false,
     304                'publicly_queryable' => bp_current_user_can( 'bp_moderate' ),
     305                'query_var'         => false,
     306                'rewrite'           => false,
     307                'show_in_admin_bar' => false,
     308                'show_ui'           => bp_current_user_can( 'bp_moderate' ),
     309                'supports'          => bp_get_email_post_type_supports(),
     310            ) )
     311        );
     312
     313        parent::register_post_types();
    287314    }
    288315}
Note: See TracChangeset for help on using the changeset viewer.