Skip to:
Content

BuddyPress.org

Ticket #6610: 6610.02.patch

File 6610.02.patch, 1.4 KB (added by imath, 9 years ago)
  • src/bp-core/bp-core-attachments.php

    diff --git src/bp-core/bp-core-attachments.php src/bp-core/bp-core-attachments.php
    index 7646b80..c8361c9 100644
    function bp_attachments_get_template_part( $slug ) { 
    395395
    396396        // Load the attachment template in WP Administration screens.
    397397        if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
    398                 $attachment_admin_template_part = buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php';
     398                /**
     399                 * Filter the attachment template part for the WP Admin context
     400                 *
     401                 * Plugin developers: make sure to use this filter for your very own additional attachment template parts only.
     402                 * In your filter, you'll just need to check the $slug value is matching the additional template part you requested.
     403                 *
     404                 * For now all attachment template parts located in the assets/_attachments BP Legacy's directory are private.
     405                 * Please do not override them.
     406                 *
     407                 * @since 2.4.0
     408                 *
     409                 * @param  string $value Path to the admin template part
     410                 * @param  string $slug  Requested template slug
     411                 */
     412                $attachment_admin_template_part = apply_filters( 'bp_attachments_get_admin_template_part', buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php', $slug );
    399413
    400414                // Check whether the template part exists.
    401415                if ( ! file_exists( $attachment_admin_template_part ) ) {