Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/29/2015 11:13:57 PM (9 years ago)
Author:
imath
Message:

Introduce BuddyPress Cover Images functions and templates specific to the Groups single items.

Props r-a-y

See #6570

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-screens.php

    r10148 r10158  
    988988}
    989989add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
     990
     991/**
     992 * Handle the display of a group's Change cover image page.
     993 *
     994 * @since 2.4.0
     995 */
     996function groups_screen_group_admin_cover_image() {
     997    if ( 'group-cover-image' != bp_get_group_current_admin_tab() ) {
     998        return false;
     999    }
     1000
     1001    // If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here
     1002    if ( ! bp_is_item_admin() || ! bp_group_use_cover_image_header() ) {
     1003        return false;
     1004    }
     1005
     1006    /**
     1007     * Fires before the loading of the group Change cover image page template.
     1008     *
     1009     * @since 2.4.0
     1010     *
     1011     * @param int $id ID of the group that is being displayed.
     1012     */
     1013    do_action( 'groups_screen_group_admin_cover_image', bp_get_current_group_id() );
     1014
     1015    /**
     1016     * Filters the template to load for a group's Change cover image page.
     1017     *
     1018     * @since 2.4.0
     1019     *
     1020     * @param string $value Path to a group's Change cover image template.
     1021     */
     1022    bp_core_load_template( apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ) );
     1023}
     1024add_action( 'bp_screens', 'groups_screen_group_admin_cover_image' );
    9901025
    9911026/**
Note: See TracChangeset for help on using the changeset viewer.