Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: profile-gallery
- Description: Add gallery to buddypress profiles
- */
- // Setup the navigation
- // Props to http://wordpress.stackexchange.com/questions/16223/add-buddypress-profile-menu-item for helping me figure this out
- // and http://themekraft.com/customize-profile-and-group-menus-in-buddypress/
- function my_setup_nav() {
- global $bp;
- bp_core_new_nav_item( array(
- 'name' => __( 'My Gallery', 'buddypress' ),
- 'slug' => 'my-gallery',
- 'position' => 75,
- 'screen_function' => 'my_gallery_link',
- 'show_for_displayed_user' => true,
- 'default_subnav_slug' => 'my-gallery',
- 'item_css_id' => 'my-gallery'
- ) );
- }
- add_action( 'bp_setup_nav', 'my_setup_nav', 1000 );
- function my_gallery_title() {
- echo 'My Gallery';
- }
- function my_gallery_content() {
- echo do_shortcode( '[nggallery id=3]' );
- }
- function my_gallery_link () {
- add_action( 'bp_template_title', 'my_gallery_title' );
- add_action( 'bp_template_content', 'my_gallery_content' );
- bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement