Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating custom group buttons

  • @t330

    Member

    Hello,

    I am trying to create a custom group button, i already got the button to show on the group page, but when i click the button nothing happens, the page just refreshes.

    I actually want the button to open a custom wp page.

    So can someone explain me how the button system works?

    this is my button code:
    `
    function bp_group_custom_button( $group = false ) {
    echo bp_get_group_custom_button( $group );
    }
    function bp_get_group_custom_button( $group = false ) {
    global $groups_template;

    if ( empty( $group ) )
    $group =& $groups_template->group;

    $button = array(
    ‘id’ => ‘custom’,
    ‘component’ => ‘groups’,
    ‘must_be_logged_in’ => false,
    ‘block_self’ => true,
    ‘wrapper_class’ => ‘group-button ‘ . $group->status,
    ‘wrapper_id’ => ‘groupbutton-‘ . $group->id,
    ‘link_href’ => wp_nonce_url( bp_get_group_permalink( $group ) . ‘custom’, ‘groups_custom’ ),
    ‘link_text’ => __( ‘custom’, ‘buddypress’ ),
    ‘link_title’ => __( ‘custom’, ‘buddypress’ ),
    ‘link_class’ => ‘group-button custom’,
    );

    // Filter and return the HTML button
    return bp_get_button( apply_filters( ‘bp_get_group_custom’, $button ) );
    }
    `

Viewing 1 replies (of 1 total)
  • @t330

    Member

    if you guys don’t understand wat i want, i just want the button to send the user to
    “/user-groups/(group)/custom.php”

Viewing 1 replies (of 1 total)
  • The topic ‘Creating custom group buttons’ is closed to new replies.
Skip to toolbar