Skip to:
Content

BuddyPress.org

Ticket #6772: 6772.02.patch

File 6772.02.patch, 20.9 KB (added by r-a-y, 8 years ago)
  • new file src/bp-activity/bp-activity-embeds.php

    new file mode 100644
    - +  
     1<?php
     2/**
     3 * Functions related to embedding single activity items externally.
     4 *
     5 * Relies on WordPress 4.4.
     6 *
     7 * @since 2.5.0
     8 *
     9 * @package BuddyPress
     10 * @subpackage ActivityEmbeds
     11 */
     12
     13// Exit if accessed directly.
     14defined( 'ABSPATH' ) || exit;
     15
     16/**
     17 * Register REST route for embedding single activity items.
     18 *
     19 * Almost exactly the same as WP_oEmbed_Controller::register_routes(), but
     20 * with our '/activity' slug appended to the endpoint.
     21 *
     22 * @since 2.5.0
     23 */
     24function bp_activity_embed_register_rest_route() {
     25        /**
     26         * Filter the maxwidth oEmbed parameter.
     27         *
     28         * @since 4.4.0
     29         *
     30         * @param int $maxwidth Maximum allowed width. Default 600.
     31         */
     32        $maxwidth = apply_filters( 'oembed_default_width', 600 );
     33
     34        register_rest_route( 'oembed/1.0', '/embed/activity', array(
     35                array(
     36                        'methods'  => WP_REST_Server::READABLE,
     37                        'callback' => 'bp_activity_embed_rest_route_callback',
     38                        'args'     => array(
     39                                'url'      => array(
     40                                        'required'          => true,
     41                                        'sanitize_callback' => 'esc_url_raw',
     42                                ),
     43                                'format'   => array(
     44                                        'default'           => 'json',
     45                                        'sanitize_callback' => 'wp_oembed_ensure_format',
     46                                ),
     47                                'maxwidth' => array(
     48                                        'default'           => $maxwidth,
     49                                        'sanitize_callback' => 'absint',
     50                                ),
     51                        ),
     52                ),
     53        ) );
     54
     55}
     56add_action( 'rest_api_init', 'bp_activity_embed_register_rest_route' );
     57
     58/**
     59 * Callback for the API endpoint.
     60 *
     61 * Returns the JSON object for the post.
     62 *
     63 * @since 2.5.0
     64 *
     65 * @param  WP_REST_Request $request Full data about the request.
     66 * @return WP_Error|array oEmbed response data or WP_Error on failure.
     67 */
     68function bp_activity_embed_rest_route_callback( $request ) {
     69        $url = $request['url'];
     70
     71        $invalid = $data = false;
     72
     73        if ( bp_core_enable_root_profiles() ) {
     74                $domain = bp_get_root_domain();
     75        } else {
     76                $domain = bp_get_members_directory_permalink();
     77        }
     78
     79        // Check the URL to see if this is a single activity URL.
     80        if ( 0 !== strpos( $url, $domain ) ) {
     81                $invalid = true;
     82        }
     83
     84        // Check for activity slug.
     85        if ( false === strpos( $url, '/' . bp_get_activity_slug() . '/' ) ) {
     86                $invalid = true;
     87        }
     88
     89        // Do more checks.
     90        if ( false === $invalid ) {
     91                $url = trim( untrailingslashit( $url ) );
     92
     93                // Grab the activity ID.
     94                $activity_id = (int) substr(
     95                        $url,
     96                        strrpos( $url, '/' ) + 1
     97                );
     98
     99                if ( ! empty( $activity_id ) ) {
     100                        // Check if activity item still exists.
     101                        $activity = new BP_Activity_Activity( $activity_id );
     102
     103                        // Okay, we're good to go!
     104                        if ( ! empty( $activity->component ) ) {
     105                                // Create dummy post to piggyback off of get_oembed_response_data()
     106                                $post = bp_theme_compat_create_dummy_post( array(
     107                                        'post_author'  => $activity->user_id,
     108                                        'post_title'   => __( 'Activity', 'buddypress' ),
     109                                        'post_content' => $activity->content,
     110
     111                                        // This passes the get_oembed_response_data() check.
     112                                        'post_status'  => 'publish'
     113                                ) );
     114
     115                                // Add markers to tell that we're embedding a single activity.
     116                                // This needed for various oEmbed response data filtering.
     117                                buddypress()->activity->embedurl_in_progress = $url;
     118                                buddypress()->activity->embedid_in_progress  = $activity_id;
     119
     120                                // Use WP's oEmbed response data function.
     121                                $data = get_oembed_response_data( $post, $request['maxwidth'] );
     122
     123                                // Make one change here to reference our BP user profile
     124                                $data['author_url'] = bp_core_get_user_domain( $activity->user_id );
     125                        }
     126                }
     127        }
     128
     129        if ( ! $data ) {
     130                return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );
     131        }
     132
     133        return $data;
     134}
     135
     136/**
     137 * Register oEmbed provider on BuddyPress pages.
     138 *
     139 * This allows single activity items to be embedded.  WP's TinyMCE doesn't
     140 * require this somehow, which is why we only do this on BuddyPress pages.
     141 *
     142 * @since 2.5.0
     143 *
     144 * @todo Fix up issues with javascript not firing to hide the fallback <blockquote>
     145 */
     146function bp_activity_embed_add_oembed_provider() {
     147        // Only register our provider on BuddyPress pages.
     148        if ( false === is_buddypress() ) {
     149                return;
     150        }
     151
     152        if ( bp_core_enable_root_profiles() ) {
     153                $domain = bp_get_root_domain();
     154        } else {
     155                $domain = bp_get_members_directory_permalink();
     156        }
     157
     158        add_filter( 'rest_url' , 'bp_activity_embed_filter_rest_url' );
     159        wp_oembed_add_provider( $domain . '*/activity/*', get_oembed_endpoint_url() );
     160        remove_filter( 'rest_url' , 'bp_activity_embed_filter_rest_url' );
     161}
     162add_action( 'bp_init', 'bp_activity_embed_add_oembed_provider' );
     163
     164/**
     165 * Use our custom embed template for activity items.
     166 *
     167 * @since 2.5.0
     168 *
     169 * @param  string $retval Current embed template
     170 * @return string
     171 */
     172function bp_activity_embed_filter_template( $retval ) {
     173        if ( ! bp_is_single_activity() ) {
     174                return $retval;
     175        }
     176
     177        // Embed template hierarchy!
     178        return bp_locate_template( array(
     179                'embeds/template-single-activity.php',
     180                'embeds/template.php'
     181        ) );
     182}
     183add_filter( 'embed_template', 'bp_activity_embed_filter_template' );
     184
     185/**
     186 * Inject activity content into the embed template.
     187 *
     188 * @since 2.5.0
     189 */
     190function bp_activity_embed_inject_content() {
     191        if ( ! bp_is_single_activity() ) {
     192                return;
     193        }
     194
     195        bp_get_template_part( 'embeds/activity' );
     196}
     197add_action( 'embed_content', 'bp_activity_embed_inject_content' );
     198
     199/**
     200 * Adds oEmbed discovery links on single activity pages.
     201 *
     202 * @since 2.5.0
     203 *
     204 * @param  string $retval Current discovery links.
     205 * @return string
     206 */
     207function bp_activity_embed_oembed_discovery_links( $retval ) {
     208        if ( ! bp_is_single_activity() ) {
     209                return $retval;
     210        }
     211
     212        $permalink = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_current_action() . '/';
     213
     214        add_filter( 'rest_url' , 'bp_activity_embed_filter_rest_url' );
     215
     216        $retval = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( $permalink ) ) . '" />' . "\n";
     217
     218        if ( class_exists( 'SimpleXMLElement' ) ) {
     219                $retval .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( $permalink, 'xml' ) ) . '" />' . "\n";
     220        }
     221
     222        remove_filter( 'rest_url' , 'bp_activity_embed_filter_rest_url' );
     223
     224        return $retval;
     225}
     226add_filter( 'oembed_discovery_links', 'bp_activity_embed_oembed_discovery_links' );
     227
     228/**
     229 * Pass our BuddyPress activity permalink for embedding.
     230 *
     231 * @since 2.5.0
     232 *
     233 * @see bp_activity_embed_rest_route_callback()
     234 *
     235 * @param  string $retval Current embed URL
     236 * @return string
     237 */
     238function bp_activity_embed_filter_post_embed_url( $retval ) {
     239        if ( false === isset( buddypress()->activity->embedurl_in_progress ) && ! bp_is_single_activity() ) {
     240                return $retval;
     241        }
     242
     243        $url = bp_is_single_activity() ? bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_current_action() . '/' : buddypress()->activity->embedurl_in_progress;
     244        $url = trailingslashit( $url );
     245
     246        // This is for the 'WordPress Embed' block
     247        // @see bp_activity_embed_comments_button()
     248        if ( 'the_permalink' !== current_filter() ) {
     249                $url = add_query_arg( 'embed', 'true', trailingslashit( $url ) );
     250        }
     251
     252        return $url;
     253}
     254add_filter( 'post_embed_url', 'bp_activity_embed_filter_post_embed_url' );
     255
     256/**
     257 * Filters the embed HTML for the default oEmbed fallback HTML.
     258 *
     259 * @since 2.5.0
     260 *
     261 * @param  string $retval Current embed HTML
     262 * @return string
     263 */
     264function bp_activity_embed_filter_html( $retval ) {
     265        if ( false === isset( buddypress()->activity->embedurl_in_progress ) && ! bp_is_single_activity() ) {
     266                return $retval;
     267        }
     268
     269        // Change 'Embedded WordPress Post' to 'Embedded Activity Item'
     270        $retval = str_replace( __( 'Embedded WordPress Post' ), __( 'Embedded Activity Item', 'buddypress' ), $retval );
     271
     272        // Remove default <blockquote>
     273        $retval = substr( $retval, strpos( $retval, '</blockquote>' ) + 13 );
     274
     275        // Set up new <blockquote>
     276        $activity_id = bp_is_single_activity() ? bp_current_action() : buddypress()->activity->embedid_in_progress;
     277        $activity    = new BP_Activity_Activity( $activity_id );
     278        $mentionname = bp_activity_do_mentions() ? ' (@' . bp_activity_get_user_mentionname( $activity->user_id ) . ')' : '';
     279        $date        = date_i18n( get_option( 'date_format' ), strtotime( $activity->date_recorded ) );
     280
     281        // 'wp-embedded-content' CSS class is necessary due to how the embed JS works.
     282        $blockquote = sprintf( '<blockquote class="wp-embedded-content bp-activity-item">%1$s%2$s %3$s</blockquote>',
     283                apply_filters( 'bp_get_activity_content_body', $activity->content ),
     284                '- ' . bp_core_get_user_displayname( $activity->user_id ) . $mentionname,
     285                '<a href="' . esc_url( bp_activity_get_permalink( $activity_id ) ) . '">' . $date . '</a>'
     286        );
     287
     288        /**
     289         * Filters the fallback HTML used when embedding a BP activity item.
     290         *
     291         * @since 2.5.0
     292         *
     293         * @param string               $blockquote Current fallback HTML
     294         * @param BP_Activity_Activity $activity   Activity object
     295         */
     296        $blockquote = apply_filters( 'bp_activity_embed_fallback_html', $blockquote, $activity );
     297
     298        // Add our custom <blockquote>
     299        return $blockquote . $retval;
     300}
     301add_filter( 'embed_html', 'bp_activity_embed_filter_html' );
     302
     303/**
     304 * Prints the markup for the activity embed comments button.
     305 *
     306 * @since 2.5.0
     307 */
     308function bp_activity_embed_comments_button() {
     309        if ( ! bp_is_single_activity() ) {
     310                return;
     311        }
     312
     313        // Make sure our custom permalink shows up in the 'WordPress Embed' block.
     314        add_filter( 'the_permalink', 'bp_activity_embed_filter_post_embed_url' );
     315
     316        // Only show comment bubble if we have some activity comments.
     317        $count = bp_activity_get_comment_count();
     318        if ( empty( $count ) ) {
     319                return;
     320        }
     321?>
     322
     323        <div class="wp-embed-comments">
     324                <a href="<?php bp_activity_thread_permalink(); ?>">
     325                        <span class="dashicons dashicons-admin-comments"></span>
     326                        <?php
     327                        printf(
     328                                _n(
     329                                        '%s <span class="screen-reader-text">Comment</span>',
     330                                        '%s <span class="screen-reader-text">Comments</span>',
     331                                        $count
     332                                ),
     333                                number_format_i18n( $count )
     334                        );
     335                        ?>
     336                </a>
     337        </div>
     338
     339<?php
     340}
     341add_action( 'embed_content_meta', 'bp_activity_embed_comments_button', 5 );
     342
     343/**
     344 * Append '/activity' to oEmbed endpoint URL.
     345 *
     346 * Meant to be used as a filter on 'rest_url' before any call to
     347 * {@link get_oembed_endpoint_url()} is used.
     348 *
     349 * @since 2.5.0
     350 *
     351 * @see bp_activity_embed_oembed_discovery_links()
     352 * @see bp_activity_embed_add_oembed_provider()
     353 *
     354 * @param  string $retval Current oEmbed endpoint URL
     355 * @return string
     356 */
     357function bp_activity_embed_filter_rest_url( $retval = '' ) {
     358        return $retval . '/activity';
     359}
     360 No newline at end of file
  • src/bp-activity/bp-activity-loader.php

     
    3131                        array(
    3232                                'adminbar_myaccount_order' => 10,
    3333                                'search_query_arg' => 'activity_search',
     34                                'features' => array( 'embeds' )
    3435                        )
    3536                );
    3637        }
     
    6768                        $includes[] = 'akismet';
    6869                }
    6970
     71                // Embeds - only applicable for WP 4.4+
     72                if ( bp_get_major_wp_version() >= 4.4 && bp_is_active( $this->id, 'embeds' ) ) {
     73                        $includes[] = 'embeds';
     74                }
     75
     76                // Admin-specific
    7077                if ( is_admin() ) {
    7178                        $includes[] = 'admin';
    7279                }
  • src/bp-core/bp-core-theme-compatibility.php

     
    650650}
    651651
    652652/**
     653 * Create a dummy WP_Post object.
     654 *
     655 * @since 2.5.0
     656 *
     657 * @param  array $args Array of optional arguments. Arguments parallel the properties
     658 *                    of {@link WP_Post}; see that class for more details.
     659 * @return WP_Post
     660 */
     661function bp_theme_compat_create_dummy_post( $args = array() ) {
     662        $dummy = wp_parse_args( $args, array(
     663                'ID'                    => -9999,
     664                'post_status'           => 'public',
     665                'post_author'           => 0,
     666                'post_parent'           => 0,
     667                'post_type'             => 'page',
     668                'post_date'             => 0,
     669                'post_date_gmt'         => 0,
     670                'post_modified'         => 0,
     671                'post_modified_gmt'     => 0,
     672                'post_content'          => '',
     673                'post_title'            => '',
     674                'post_excerpt'          => '',
     675                'post_content_filtered' => '',
     676                'post_mime_type'        => '',
     677                'post_password'         => '',
     678                'post_name'             => '',
     679                'guid'                  => '',
     680                'menu_order'            => 0,
     681                'pinged'                => '',
     682                'to_ping'               => '',
     683                'ping_status'           => '',
     684                'comment_status'        => 'closed',
     685                'comment_count'         => 0,
     686                'filter'                => 'raw',
     687
     688                'is_404'                => false,
     689                'is_page'               => false,
     690                'is_single'             => false,
     691                'is_archive'            => false,
     692                'is_tax'                => false,
     693        ) );
     694
     695        // Create the dummy post.
     696        $post = new WP_Post( (object) $dummy );
     697
     698        return $post;
     699}
     700
     701/**
    653702 * Populate various WordPress globals with dummy data to prevent errors.
    654703 *
    655704 * This dummy data is necessary because theme compatibility essentially fakes
     
    670719
    671720        // Switch defaults if post is set.
    672721        if ( isset( $wp_query->post ) ) {
    673                 $dummy = wp_parse_args( $args, array(
     722                $args = wp_parse_args( $args, array(
    674723                        'ID'                    => $wp_query->post->ID,
    675724                        'post_status'           => $wp_query->post->post_status,
    676725                        'post_author'           => $wp_query->post->post_author,
     
    695744                        'comment_status'        => $wp_query->post->comment_status,
    696745                        'comment_count'         => $wp_query->post->comment_count,
    697746                        'filter'                => $wp_query->post->filter,
    698 
    699                         'is_404'                => false,
    700                         'is_page'               => false,
    701                         'is_single'             => false,
    702                         'is_archive'            => false,
    703                         'is_tax'                => false,
    704                 ) );
    705         } else {
    706                 $dummy = wp_parse_args( $args, array(
    707                         'ID'                    => -9999,
    708                         'post_status'           => 'public',
    709                         'post_author'           => 0,
    710                         'post_parent'           => 0,
    711                         'post_type'             => 'page',
    712                         'post_date'             => 0,
    713                         'post_date_gmt'         => 0,
    714                         'post_modified'         => 0,
    715                         'post_modified_gmt'     => 0,
    716                         'post_content'          => '',
    717                         'post_title'            => '',
    718                         'post_excerpt'          => '',
    719                         'post_content_filtered' => '',
    720                         'post_mime_type'        => '',
    721                         'post_password'         => '',
    722                         'post_name'             => '',
    723                         'guid'                  => '',
    724                         'menu_order'            => 0,
    725                         'pinged'                => '',
    726                         'to_ping'               => '',
    727                         'ping_status'           => '',
    728                         'comment_status'        => 'closed',
    729                         'comment_count'         => 0,
    730                         'filter'                => 'raw',
    731 
    732                         'is_404'                => false,
    733                         'is_page'               => false,
    734                         'is_single'             => false,
    735                         'is_archive'            => false,
    736                         'is_tax'                => false,
    737747                ) );
    738748        }
    739749
    740750        // Bail if dummy post is empty.
    741         if ( empty( $dummy ) ) {
     751        if ( empty( $args ) ) {
    742752                return;
    743753        }
    744754
    745755        // Set the $post global.
    746         $post = new WP_Post( (object) $dummy );
     756        $post = bp_theme_compat_create_dummy_post( $args );
    747757
    748758        // Copy the new post global into the main $wp_query.
    749759        $wp_query->post       = $post;
     
    751761
    752762        // Prevent comments form from appearing.
    753763        $wp_query->post_count = 1;
    754         $wp_query->is_404     = $dummy['is_404'];
    755         $wp_query->is_page    = $dummy['is_page'];
    756         $wp_query->is_single  = $dummy['is_single'];
    757         $wp_query->is_archive = $dummy['is_archive'];
    758         $wp_query->is_tax     = $dummy['is_tax'];
    759 
    760         // Clean up the dummy post.
    761         unset( $dummy );
     764        $wp_query->is_404     = $post->is_404;
     765        $wp_query->is_page    = $post->is_page;
     766        $wp_query->is_single  = $post->is_single;
     767        $wp_query->is_archive = $post->is_archive;
     768        $wp_query->is_tax     = $post->is_tax;
    762769
    763770        /**
    764771         * Force the header back to 200 status if not a deliberate 404
  • new file src/bp-templates/bp-legacy/buddypress/embeds/activity.php

    new file mode 100644
    - +  
     1
     2                <?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?>
     3
     4                        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     5                                <div class="wp-embed-excerpt"><?php bp_activity_content_body(); ?></div>
     6
     7                                <p><a href="<?php bp_activity_thread_permalink(); ?>"><?php echo date_i18n( get_option( 'time_format' ) . ' - ' . get_option( 'date_format' ), strtotime( bp_get_activity_date_recorded() ) ); ?></a></p>
     8                        <?php endwhile; ?>
     9
     10                <?php else : ?>
     11
     12                        <?php bp_get_template_part( 'embeds/not-found' ); ?>
     13
     14                <?php endif; ?>
     15
  • new file src/bp-templates/bp-legacy/buddypress/embeds/css.php

    new file mode 100644
    - +  
     1<style type="text/css">
     2#wp-embed-header:after {
     3        clear: both;
     4        content: "";
     5        display: table;
     6        margin-bottom: 1em;
     7}
     8
     9.wp-embed-avatar {
     10        float: left;
     11        margin: 0 .75em 0 0;
     12}
     13
     14p.wp-embed-heading {
     15        font-size: 16px;
     16        margin-bottom: 0;
     17}
     18
     19.wp-embed-excerpt {
     20        margin-bottom: .5em;
     21}
     22
     23.wp-embed-footer {
     24        margin-top: 20px;
     25}
     26</style>
     27 No newline at end of file
  • new file src/bp-templates/bp-legacy/buddypress/embeds/footer.php

    new file mode 100644
    - +  
     1                        <div class="wp-embed-footer">
     2                                <div class="wp-embed-site-title">
     3                                        <?php
     4                                        $site_title = sprintf(
     5                                                '<a href="%s"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>',
     6                                                esc_url( home_url() ),
     7                                                esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
     8                                                esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),
     9                                                esc_html( get_bloginfo( 'name' ) )
     10                                        );
     11
     12                                        /**
     13                                         * Filter the site title HTML in the embed footer.
     14                                         *
     15                                         * @since 4.4.0
     16                                         *
     17                                         * @param string $site_title The site title HTML.
     18                                         */
     19                                        echo apply_filters( 'embed_site_title_html', $site_title );
     20                                        ?>
     21                                </div>
     22
     23                                <div class="wp-embed-meta">
     24                                        <?php
     25                                        /**
     26                                         * Print additional meta content in the embed template.
     27                                         *
     28                                         * @since 4.4.0
     29                                         */
     30                                        do_action( 'embed_content_meta');
     31                                        ?>
     32                                </div>
     33                        </div>
     34 No newline at end of file
  • new file src/bp-templates/bp-legacy/buddypress/embeds/header.php

    new file mode 100644
    - +  
     1
     2                <div id="wp-embed-header">
     3                        <div class="wp-embed-avatar">
     4                                <a href="<?php bp_displayed_user_link(); ?>">
     5                                        <?php bp_displayed_user_avatar( 'type=thumb&width=36&height=36' ); ?>
     6                                </a>
     7                        </div>
     8
     9                        <p class="wp-embed-heading">
     10                                <a href="<?php bp_displayed_user_link(); ?>">
     11                                        <?php bp_displayed_user_fullname(); ?>
     12                                </a>
     13                        </p>
     14
     15                        <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>
     16                                <p class="wp-embed-mentionname">@<?php bp_displayed_user_mentionname(); ?></p>
     17                        <?php endif; ?>
     18                </div>
  • new file src/bp-templates/bp-legacy/buddypress/embeds/template.php

    new file mode 100644
    - +  
     1<?php
     2/**
     3 * Generic embed template used by BuddyPress.
     4 *
     5 * When a BuddyPress item is embedded in an iframe, this file is used to
     6 * create the output.
     7 *
     8 * This is a modified version of the bundled WordPress embed template
     9 * included in WordPress 4.4+.
     10 *
     11 * @since 2.5.0
     12 *
     13 * @package BuddyPress
     14 * @subpackage Embeds
     15 */
     16
     17if ( ! headers_sent() ) {
     18        header( 'X-WP-embed: true' );
     19}
     20
     21?>
     22<!DOCTYPE html>
     23<html <?php language_attributes(); ?> class="no-js">
     24<head>
     25        <title><?php echo wp_get_document_title(); ?></title>
     26        <meta http-equiv="X-UA-Compatible" content="IE=edge">
     27        <base target="_top" />
     28        <?php
     29        /** This action is documented in wp-includes/embed-template.php */
     30        do_action( 'embed_head' );
     31
     32        // This is used by r-a-y for testing purposes at the moment.
     33        bp_get_template_part( 'embeds/css' );
     34        ?>
     35</head>
     36<body <?php body_class(); ?>>
     37<div <?php post_class( 'wp-embed' ); ?>>
     38<?php
     39bp_get_template_part( 'embeds/header', bp_current_component() );
     40
     41/** This action is documented in wp-includes/embed-template.php */
     42do_action( 'embed_content' );
     43
     44bp_get_template_part( 'embeds/footer', bp_current_component() );
     45?>
     46
     47</div>
     48
     49<?php
     50/** This action is documented in wp-includes/embed-template.php */
     51do_action( 'embed_footer' );
     52?>
     53</body>
     54</html>
     55 No newline at end of file