How to display profile fields with no data in BuddyPress profile view? [closed]

Create a template overload of this file: buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php Then find this code: <?php if ( bp_field_has_data() ) : ?> <tr<?php bp_field_css_class(); ?>> <td class=”label”><?php bp_the_profile_field_name(); ?></td> <td class=”data”><?php bp_the_profile_field_value(); ?></td> </tr> <?php endif; ?> And change it to: <tr<?php bp_field_css_class(); ?>> <td class=”label”><?php bp_the_profile_field_name(); ?></td> <td class=”data”><?php bp_the_profile_field_value(); ?></td> </tr> EDIT: We need to force … Read more

Buddypress user registration validation not working with custom select query

There is no such thing as $bp->get_var. Try using $wpdb->get_var. Or try this: function validate_user_signup($result) { global $wpdb; $result = $wpdb->get_var(“SELECT user_id FROM wp_bp_xprofile_data WHERE value=”{$_POST[“field_2′]}'”); if( $result != NULL ){ $new_error = new WP_Error(); $new_error->add( ‘field_2’, __( ‘Phone number is already in use.’, ‘buddypress’ ) ); $result[‘errors’] = $new_error; } return $result; } add_filter(‘bp_core_validate_user_signup’, … Read more

send reply message by thread id in buddypress

Get thread id for existing conversation for users or not create new conversation, $threadId = buddydev_get_threads_between_users($sender_id, $recip_id ); if(empty($threadId)){ if ( $thread_id = messages_new_message( array(‘sender_id’ => $sender_id, ‘subject’ => $subject, ‘content’ => $message, ‘recipients’ => $recip_id ) ) ) { bp_core_add_message( __(‘Message was sent.’, ‘buddypress’ ) ); } else { bp_core_add_message( __( ‘There was an … Read more

Buddypress: Filter Members Based on If They Have Posts

Solved if anyone needs this: <?php // The Query $user_query = new WP_User_Query( array(‘has_published_posts’ => array(‘post_type’=>’post’)) ); // User Loop $published_users = array(); if ( ! empty( $user_query->results ) ) { foreach ( $user_query->results as $user ) { $published_users[] = $user->ID ; } } else { } $usersimploded = implode(“,”,$published_users); if ( bp_ajax_querystring( ‘members’ ) … Read more

how to create buddypress shortcodes?

can you just add_shortcode? add_shortcode (‘use-this’, ‘get_nickname’); now in your code call [use-this] of course change ‘use-this’ to whatever you want in both places if you want to change it.

How to add “create page” option for users in buddypress like facebook?

The code below is an example in how to add an admin page to your WordPress website – you can use the example below as starting point, minimal changes are required. add_action(‘admin_menu’, ‘awesome_page_create’); function awesome_page_create() { $page_title=”My Awesome Admin Page”; $menu_title=”Awesome Admin Page”; $capability = ‘edit_posts’; $menu_slug = ‘awesome_page’; $function = ‘my_awesome_page_display’; $icon_url=””; $position = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)