Replies
Thanks Brajesh! so, this is not the way…
Excuse, if possible i ask the last question.. why does google index this url “xx.com/activity/p/4/” and not this xx.com/members/brajesh/activity/4? is it possible that be the first link on the activity?
im thinking about generate a url and redirect to xx.com/members/brajesh/activity/4regards!
Hi!!
It is for example:
Brajesh has updated an entry in the group Fashion<a href="xx.com/activity/p/4/">1 hour ago</a>
this url redirect to:
xx.com/members/brajesh/activity/4/
Im working in the SEO of the page, when i see the activity on Google, i see this url
<a href="xx.com/activity/p/4/">
For it, I need change the activity_id4
(and/p
if it is possible) with the content of my activity (this is short) or a custom meta_key.Could this be possible?
Thanks!!Hi Ravi!!
Im using Buddypress.I m looking for a way to modify this link:
https://ibb.co/ysbVf1xThis is: title of activity post in google search (in my page appear like the “Admin- Activity with yoast)
and the description (for each activity post)
Can you understand me?Thanks very much!
regards,
Jennifer- This reply was modified 3 years, 4 months ago by Jennifer.
Hi Brajesh, if i use the search of buddypress, should i replace the search.php? Because i tried this code (search in meta_key “descr” and “titulo”) but i cant do it work
And in the example, the user is using noveau theme.function buddydev_filter_activities_query_args( $r ) { $searched_category = empty( $r[ 'search_terms' ] ) ? false : $r[ 'search_terms' ]; if ( ! $searched_category ) { return $r; } $r['search_terms'] = false; if ( empty( $r['meta_query'] ) ) { $r['meta_query'] = array( array( 'key' => 'descr', 'value' => $searched_category, ) ); } else { array_push( $r['meta_query'], array( 'key' => 'titulo', 'value' => $searched_category, ) ); } return $r; } add_filter( 'bp_after_has_activities_parse_args', 'buddydev_filter_activities_query_args' );
Thanks!!
Hi Brajesh
I’m trying differently, it dont works ..a validation with a xprofile fieldadd_action( 'quform_post_process_7', function ( array $result, Quform_Form $form ) { if ( ! function_exists( 'bp_core_signup_user' ) ) { return; } $username = $form->getValueText( 'quform_7_6' ); $email = $form->getValueText( 'quform_7_6' ); $password = $form->getValueText( 'quform_7_7' ); // XProfile fields $usermeta = array( //name 'field_1' => $form->getValueText('quform_7_28'), 'field_43' => $form->getValueText( 'quform_7_6' ), 'field_59' => 'Inmobiliaria', ); $usermeta['profile_field_ids'] = '1,43,44,59'; $usermeta['password'] = wp_hash_password( $password ); $user_id = bp_core_signup_user($username, $password, $email, $usermeta); return $result; }, 10, 2 ); function after_bp_activated_user( $user_id, $key, $user ) { global $bp; $user = get_userdata( $user_id ); $role='shop_manager'; $profile_stage = xprofile_get_field_data('59'); if ('Inmobiliaria' == $profile_stage){ $user->set_role( $role ); } } add_action( 'bp_core_activated_user', 'after_bp_activated_user', 30, 2 );
- This reply was modified 4 years, 10 months ago by Jennifer.
Hi! i used your code, but I can’t change the user’s role.
the current default role is *subscriber* and the one that has to be is * shop_manager *
i tried with a priority different like:add_action( 'bp_core_activated_user', 'after_bp_activated_user', 10, 2 );
and replace in the code
$user->set_role( $role );
for this:
`$user = new WP_User( $user_id );
$user->remove_role( ‘subscriber’ );
$user->add_role( ‘shop_manager’ );`but I couldn’t do it yet.
do u have any suggestions?
Thanks very much!