1006 | | // The join or leave group header button should default to 'button' |
1007 | | // Reverse the earler button var to set default as 'button' not 'a' |
1008 | | if ( empty( $args['button_element'] ) ) { |
1009 | | $button_element = 'button'; |
1010 | | } |
| 1007 | // The join or leave group header button should default to 'button'. |
| 1008 | // Reverse the earlier button var to set default as 'button' not 'a'. |
| 1009 | if ( empty( $args['button_element'] ) ) { |
| 1010 | $button_element = 'button'; |
| 1011 | } |
1012 | | $buttons['group_membership'] = array( |
1013 | | 'id' => 'group_membership', |
1014 | | 'position' => 5, |
1015 | | 'component' => $button_args['component'], |
1016 | | 'must_be_logged_in' => $button_args['must_be_logged_in'], |
1017 | | 'block_self' => $button_args['block_self'], |
1018 | | 'parent_element' => $parent_element, |
1019 | | 'button_element' => $button_element, |
1020 | | 'link_text' => $button_args['link_text'], |
1021 | | 'link_title' => $button_args['link_title'], |
1022 | | 'parent_attr' => array( |
1023 | | 'id' => $button_args['wrapper_id'], |
1024 | | 'class' => $parent_class, |
1025 | | ), |
1026 | | 'button_attr' => array( |
1027 | | 'id' => ! empty( $button_args['link_id'] ) ? $button_args['link_id'] : '', |
1028 | | 'class' => $button_args['link_class'] . ' button', |
1029 | | 'rel' => ! empty( $button_args['link_rel'] ) ? $button_args['link_rel'] : '', |
1030 | | 'title' => '', |
1031 | | ), |
1032 | | ); |
| 1013 | $buttons['group_membership'] = array( |
| 1014 | 'id' => 'group_membership', |
| 1015 | 'position' => 5, |
| 1016 | 'component' => $button_args['component'], |
| 1017 | 'must_be_logged_in' => $button_args['must_be_logged_in'], |
| 1018 | 'block_self' => $button_args['block_self'], |
| 1019 | 'parent_element' => $parent_element, |
| 1020 | 'button_element' => $button_element, |
| 1021 | 'link_text' => $button_args['link_text'], |
| 1022 | 'link_title' => $button_args['link_title'], |
| 1023 | 'parent_attr' => array( |
| 1024 | 'id' => $button_args['wrapper_id'], |
| 1025 | 'class' => $parent_class, |
| 1026 | ), |
| 1027 | 'button_attr' => array( |
| 1028 | 'id' => ! empty( $button_args['link_id'] ) ? $button_args['link_id'] : '', |
| 1029 | 'class' => $button_args['link_class'] . ' button', |
| 1030 | 'rel' => ! empty( $button_args['link_rel'] ) ? $button_args['link_rel'] : '', |
| 1031 | 'title' => '', |
| 1032 | ), |
| 1033 | ); |
1034 | | // If button element set add nonce 'href' link to data-attr attr. |
1035 | | if ( 'button' === $button_element ) { |
1036 | | $buttons['group_membership']['button_attr']['data-bp-nonce'] = $button_args['link_href']; |
1037 | | } else { |
1038 | | // Else this is an anchor so use an 'href' attr. |
1039 | | $buttons['group_membership']['button_attr']['href'] = $button_args['link_href']; |
| 1035 | // If button element set add nonce 'href' link to data-attr attr. |
| 1036 | if ( 'button' === $button_element ) { |
| 1037 | $buttons['group_membership']['button_attr']['data-bp-nonce'] = $button_args['link_href']; |
| 1038 | } else { |
| 1039 | // Else this is an anchor so use an 'href' attr. |
| 1040 | $buttons['group_membership']['button_attr']['href'] = $button_args['link_href']; |
| 1041 | } |