This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add a Sort By option to the members loop. | |
// this code assumes that the 'Extended Profile' (xprofile) component is activated | |
// this code assumes that a Profile Field called 'Price' and of type = 'Number' has been created | |
function shanebp_add_sortby_price() { | |
?> | |
<option value="price">Price</option> | |
<?php | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
be specific re php version: sudo apt-get install php7.0-tidy | |
vagrant@vvv:~$ sudo apt-get install php-tidy | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
libtidy5 php7.1-common php7.1-tidy | |
The following NEW packages will be installed: | |
libtidy5 php-tidy php7.1-common php7.1-tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_members_directory_tab_nouveau( $nav_items ) { | |
$nav_items['custom'] = array( | |
'component' => 'members', | |
'slug' => 'custom', | |
'li_class' => array('custom no-ajax'), | |
'link' => trailingslashit( bp_get_members_directory_permalink() . 'custom' ), | |
'text' => __( 'Custom', 'buddypress' ), | |
'count' => false, | |
'position' => 15.8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pp_check_group_name( $group_new ) { | |
if ( 'group-details' == bp_get_groups_current_create_step() ) { | |
$args = array( | |
'per_page' => null, | |
'populate_extras' => false, | |
'update_meta_cache' => false | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add the custom column header | |
function philopress_modify_user_columns($column_headers) { | |
$column_headers['extended'] = 'Meta Fields'; | |
return $column_headers; | |
} | |
add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using the Nouveau template pack | |
// Add a count bubble on a custom tab on a user profile is straightforward | |
$count = get_the_count_profile( $group_id ); | |
$class = ( 0 === $count ) ? 'no-count' : 'count'; | |
$name = sprintf( __( 'Events <span class="%s">%s</span>', 'bp-simple-events' ), esc_attr( $class ), number_format_i18n( $count ) ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shanebp_user_groups(){ | |
$group_ids = groups_get_user_groups( bp_get_member_user_id() ); | |
foreach( $group_ids["groups"] as $id ) { | |
$group = groups_get_group( array( 'group_id' => $id ) ); | |
echo '<a href=' . trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ) . '>' . $group->name . '<a/><br>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'bp_setup_nav', 'add_videos_subnav_tab', 100 ); | |
function add_videos_subnav_tab() { | |
global $bp; | |
bp_core_new_subnav_item( array( | |
'name' => 'Videos', | |
'slug' => 'videos', | |
'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'friends' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* example of using BP_Group_Extension | |
* replace 'test' with something else - remember that it is case-sensitive | |
* checks for any selected Group Types in the 'Settings' step | |
*/ | |
function test_add_group_extension() { | |
if ( bp_is_active( 'groups' ) ) : |