Skip to:
Content

BuddyPress.org

Changeset 11835


Ignore:
Timestamp:
01/29/2018 08:50:43 PM (4 years ago)
Author:
djpaul
Message:

Templates: move common assets from bp-legacy and bp-nouveau into a shared folder.

In the Nouveau and Legacy packs, these templates were identical. As they used for very specific parts of a BuddyPress theme,
and all to support features that were added since bp-legacy was created, we can utilise this new shared folder to avoid duplication.

The shared folder is added to the template hierarchy, with a lower priority than the WordPress theme, any WordPress parent theme,
and the active template pack. Any site that has customised any of the moved templates will continue to load those version.

Fixes #7672

Props r-a-y for the initial patch, and hnla.

Location:
trunk/src
Files:
2 added
3 deleted
2 edited
1 moved

Legend:

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

    r11360 r11835  
    988988}
    989989add_action( 'loop_end', 'bp_theme_compat_loop_end' );
     990
     991/**
     992 * Get the absolute path to the shared theme assets folder.
     993 *
     994 * @since 3.0.0
     995 *
     996 * @return string The absolute path to the shared theme assets folder.
     997 */
     998function bp_get_shared_theme_assets_dir() {
     999
     1000    /**
     1001     * Filters the absolute path to the shared theme assets folder.
     1002     *
     1003     * @since 3.0.0
     1004     *
     1005     * @param string $dir The absolute path to the shared theme assets folder.
     1006     */
     1007    return apply_filters( 'bp_get_theme_compat_dir', buddypress()->themes_dir . '/shared' );
     1008}
  • trunk/src/class-buddypress.php

    r11763 r11835  
    733733        // Register the basic theme stack. This is really dope.
    734734        bp_register_template_stack( 'get_stylesheet_directory', 10 );
    735         bp_register_template_stack( 'get_template_directory',   12 );
    736         bp_register_template_stack( 'bp_get_theme_compat_dir',  14 );
     735        bp_register_template_stack( 'get_template_directory', 12 );
     736        bp_register_template_stack( 'bp_get_theme_compat_dir', 14 );
     737        bp_register_template_stack( 'bp_get_shared_theme_assets_dir', 16 );
    737738    }
    738739
Note: See TracChangeset for help on using the changeset viewer.