In the plugin this function is responsible for updating the name fields from buddypress to wordpress profile:
add_filter( 'bp_xprofile_set_field_data_pre_validate', array( &$this, 'bp2wp_update_sync_field' ), 1, 3 );
public function bp2wp_update_sync_field( $value, $field, $field_type_obj ) {
if ( $field ) {
$childs = $field->get_children();
if (isset($childs) && $childs && count($childs) > 0
&& is_object($childs[0]) && $childs[0]->type == 'bp2wp_sync') {
if ( null !== bp_displayed_user_id() && bp_displayed_user_id() > 0 )
$this->bp_user_id = bp_displayed_user_id();
$this->synced = true;
update_user_meta( $this->bp_user_id, $childs[0]->name, $value );
}
}
return $value;
}
So something like this should be added to the custom registration form I guess. Preferably as a function in the child theme to make it update proof.
If its considers a bit of work would it be possible to take it up as a paid customization?
Kind regards
Okey, would be great if that could be added in the upcoming update! A rounded percentage doesn't work for us sadly.
Thanks,
Thanks!
I tried the snippet but it breaks the site (cannot load it anymore). Also I am not really sure what you mean with adding an extra field?
Do you mean adding a buddypress field? If so what type and name?
Kind regards
Hi Alex,
Thank you very much! Tested and put to our live environment. All works as expected, great work!
This reply has been marked as private.
Hi
The problem is that courses and order are both stored in the same table (post-meta). This makes the database use, and the query of the user count slow because it also needs to look through not relevant data (like the orders).
Isn't there any possiblity maybe to have a separate database table for the courses, to make the query into courses very quick?
Kind regards
This reply has been marked as private.
This reply has been marked as private.
Hi Alex,
Thanks for the quick reply. We are using a strong server, based on the Google Cloud platform (Kinsta, Business2).
The posts table (and postmeta with it), are indeed large. (50k+, 1.6mln+). This is mainly due to WooCommerce orders (+50 p/d). Just a quick count - in postmeta, getting WooComm orders out of it would mean a 30% reduction in size.
To do this, we have found this: https://github.com/liquidweb/woocommerce-custom-orders-table. Will WPLMS work with this? Or will it screw something up (or do we need to alter the code somewhere?).
Thanks in advance.
I think one of the main reasons that the query is slow is of all the woocommerce data that is in the wp post table.
Do you think this solution may work and is applicable with wplms: https://github.com/liquidweb/woocommerce-custom-orders-table
This reply has been marked as private.
This reply has been marked as private.
This reply has been marked as private.
Hi Diana,
I am not so sure what you mean. Do mean the plugin WPML (because I am not using this). How would I copy this page?
Kind regards,