[buddypress-trac] [BuddyPress] #4089: add_theme_support BP-Default Theme

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Mar 19 22:45:03 UTC 2012


#4089: add_theme_support BP-Default Theme
--------------------------+------------------------------
 Reporter:  chrisclayton  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Theme         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by boonebgorges):

 If theme authors want to release BP themes that are not child themes of
 bp-default but take advantage of bp-default's AJAX and JS, it can be done
 as follows, without the use of `add_theme_support()`:

 {{{
 // Include AJAX handlers
 include( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' );

 // Enqueue bp-default's JS and localize
 function mytheme_enqueue_bp_default_js() {
         wp_enqueue_script( 'dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes
 /bp-default/_inc/global.js', array( 'jquery' ), bp_get_version() );

         $params = array(
                 'my_favs'           => __( 'My Favorites', 'buddypress' ),
                 'accepted'          => __( 'Accepted', 'buddypress' ),
                 'rejected'          => __( 'Rejected', 'buddypress' ),
                 'show_all_comments' => __( 'Show all comments for this
 thread', 'buddypress' ),
                 'show_all'          => __( 'Show all', 'buddypress' ),
                 'comments'          => __( 'comments', 'buddypress' ),
                 'close'             => __( 'Close', 'buddypress' ),
                 'view'              => __( 'View', 'buddypress' ),
                 'mark_as_fav'       => __( 'Favorite', 'buddypress' ),
                 'remove_fav'        => __( 'Remove Favorite', 'buddypress'
 )
         );
         wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
 }
 add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_bp_default_js' );
 }}}

 Using `add_theme_support()` only makes sense if BP starts adopting use of
 `current_theme_supports()`. Can you give examples of what kinds of things
 would appear in the following conditional?

 {{{
 if ( current_theme_supports( 'bp-default' ) ) {
    // do something
 }
 }}}

 There may be cases in the future where it makes sense, for a specific new
 BP feature, to introduce use of `add_theme_support()`, but I'm not sure
 what it would mean in the case of `bp-default` itself.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4089#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list