Forum Replies Created
-
In reply to: PHP to get Field-Group-ID given Field-Group-Name?
The name of the field:
xprofile_get_field_id_from_name( 'Address' )In reply to: Custom post type comment trackingAre you 100% certain that the cpt is called ‘namaste_lesson’ ?
In reply to: Assign member type based on user metaCurrently, you are using the
bp_inithook to set the member type.
That won’t work because you are getting the member id frombp_displayed_user_id()which is only available on profile pages. And that’s why you get an error.
And even if it worked – it’s very bad to set a member type on every page load.The example you linked to uses a specific hook to call the function that sets the member type.
You need to find or create a hook for your situation – probably from wherever the_wcv_custom_settings_vendortypefield is set.
And then use the same approach as used in the example you linked to.In reply to: Custom post type comment tracking@agnesmeil – Try:
function agnes_customize_lesson_tracking_args() { if ( ! bp_is_active( 'activity' ) ) return; add_post_type_support( 'namaste_lesson', 'buddypress-activity' ); bp_activity_set_post_type_tracking_args( 'namaste_lesson', array( 'action_id' => 'new_namaste_lesson', 'bp_activity_admin_filter' => __( 'Published a new Lesson', 'custom-textdomain' ), 'bp_activity_front_filter' => __( 'Lessons', 'custom-textdomain' ), 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">Lesson</a>', 'custom-textdomain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">Lesson</a>, on the site %3$s', 'custom-textdomain' ), 'contexts' => array( 'activity', 'member' ), 'comment_action_id' => 'new_namaste_lesson_comment', 'bp_activity_comments_admin_filter' => __( 'Commented a Lesson', 'custom-textdomain' ), 'bp_activity_comments_front_filter' => __( 'Lessons Comments', 'custom-textdomain' ), 'bp_activity_new_comment' => __( '%1$s commented on the <a href="%2$s">Lesson</a>', 'custom-textdomain' ), 'bp_activity_new_comment_ms' => __( '%1$s commented on the <a href="%2$s">Lesson</a>, on the site %3$s', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'agnes_customize_lesson_tracking_args' );In reply to: ‘bp_email_use_wp_mail’ Causing IssuesFormatting for all devices is tough.
Re debug, maybe try running this version as a plugin:
https://gist.github.com/shanebp/4270480b6afcb179ed77Did you create the phone & address fields via wp-admin > Users > Profile Fields?
BP stores profile data in a table called
{your table prefix as set in wp-config}_bp_xprofile_data.
So you need to write those fields to that table.Unless somebody here has used Form Maker, it is doubtful that you will get a detailed answer.
In reply to: Using bp_parse_args() to filter members loopAnd
$field_value = 'Woman';to$value = 'Woman';In reply to: Using bp_parse_args() to filter members loopI wrote the
class BP_Custom_User_Idsexample.But for what you want,
bp_parse_argsis much more appropriate.Change the $query to this:
$query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . " AND value = '" . $value . "'";In reply to: Solved – BP 2.5 Emails not sendingI had to tweak your
bp-email-debug-2.phpso that the$emailobject is not overwritten.function pg_bp25_email_debug_failure( $status, $email ) { $email_admin = bp_get_option( 'admin_email' ); if ( is_wp_error( $status ) ) { $message = $status->get_error_message() . PHP_EOL . PHP_EOL . print_r( $email, true ); } else { $message = 'Failure but not WP_Error.'; } wp_mail( $email_admin, 'BuddyPress 2.5 email -- debug', $message ); }I’ve sent you an email with the
$emailobject.In reply to: Solved – BP 2.5 Emails not sendingIs PHP Safe Mode enabled?
No, afaik.
Host is running php 5.4 in which, I believe, safe_mode was removed.In reply to: Using bp_parse_args() to filter members loopretval['include'] = $woman_ids;
should be
$retval['include'] = $woman_ids;In reply to: Using bp_parse_args() to filter members loopPlease use the
codebutton when sharing code.The fields
field_idandfield_valuedo not exist in the function you are attempting to filter.
See this for accepted fields:
https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-members/bp-members-template.php#L453I think you want this field
retval['include'].Something like:
function see_woman_gender( $retval ) { global $wpdb; $field_id = 3; $field_value = 'Woman'; $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . ' AND field_value = ' . $field_value; $woman_ids = $wpdb->get_col( $query ); if ( !empty( $woman_ids ) ) $retval['include'] = $woman_ids; return $retval; } add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );There are field re meta data; I don’t think they work with profile data.
But you could try this and let us know if it works:function see_woman_gender( $retval ) { $retval['meta_key'] = '3'; $retval['meta_value'] = 'Woman'; return $retval; } add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );In reply to: BuddyPress + bbPress Breaks bbPress Search WidgetIs there a private method to provide a user/pw?
There is no PMing for this site.
But Dan has confirmed the issue with WP 2015, so it will be looked at.
Perhaps you could confirm that it does not occur with another WP theme, maybe try 2013?
And state which theme you are using?In reply to: Emails showing as being sent from wordpressPerhaps this is due to the new BP Email API?
If so, try this for BP emails:add_action( 'bp_email', function( $email_type, $email_obj ) { $email_obj->set_from( "custom@example.com", "Custom Website Name" ); }, 10, 2 );And use Dan’s functions to handle WP emails.
In reply to: BuddyPress Sub NavIn reply to: Filtering Activity LoopsIn order to filter activity entries re posts, you’ll need to use an existing plugin that allows front-end posting and create activity items. I’ll already provided the google terms to search on.
In reply to: Filtering Activity LoopsBP does not provide the ability to create WP posts on the front end.
You could give each member the Editor role and then they could create posts via wp-admin.
You will need to write some code to filter out various kinds of post-related activity entries.In reply to: Paragraph breaks in messagesYou mean when viewing a single conversation / thread on your site?
Paragraph breaks are shown properly when viewed in WP themes like 2013.
Try switching momentarily to a WP theme to see if your issue is related to your theme.In reply to: Filtering Activity LoopsWhat you want is the ability for members to create posts in the front end.
And have filterable activity items created for those posts.Both items are very doable – via other plugins or custom code.
To see the current offerings, Google:
buddypress front end postIn reply to: BuddyPress + bbPress Breaks bbPress Search WidgetYou need to provide a user / pw if you want someone to look at your forums.
Make sure your issue is not related to your theme; switch momentarily to a WP theme like 2013.
In reply to: Visible profile fieldsYou can get a profile field value like so:
$child = xprofile_get_field_data( 'child', $user_id ); if ( ! empty( $child ) ) echo $child;Getting the
$user_idand changing the layout are both questions specific to bbPress and best asked on their forums.In reply to: BuddyPress Sub NavIn reply to: BuddyPress 2.5.0 Medici 3 problemsPlease use the
codebutton when sharing code or error-log entries.Thanks for your report.
Re #3: See https://buddypress.trac.wordpress.org/ticket/6937
Re #2: Use the new BP filters.
See: https://buddypress.org/support/topic/bp-2-4-x-to-2-5-wp_mail_from-not-working-with-new-emails-in-bp/#post-250532Re #1: You can open an enhancement ticket here..
Use the same user / pw you use on these forums.
The new BP Mail API is generating a lot of tickets – per usual for a new API.In reply to: How to create profile fields for certain roles?You’ll need to be able to write and debug code.
You can create a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.phpSet a variable with the current user role. Google how to get that value.
Then create an array of profile field ids for a role.
For example :if ( $current_role == 'model' ) $show_fields = array( 1, 5, 23 ); elseif( $current_role == 'photographer' ) $show_fields = array( 1, 7, 12, 35 );Then check if the current profile field is in that array.
Something like:<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( in_array( bp_get_the_profile_field_id(), $show_fields ) ) : ?> <?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; ?> <?php endif; ?>Avoid setting any fields to ‘required’ if you’re only going to show them based on role.
In reply to: Compose Private Message IssueFor private messages, auto-complete only shows your friends.
To access everyone, put this in your theme/functions.php or in plugins/bp-custom.php
define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true );