Forum Replies Created
-
You can mark this ticket as resolved. I figured out by myself how to retrieve the fields directly from the database.
Thanks for your assistance anyway.
Nothing has changed. This is the code I’ve tried to use.
function my_custom_buddypress_function() { var_dump(__FUNCTION__); if ( ! function_exists('xprofile_get_field_data') ) { echo '<pre>BuddyPress xprofile component has not been loaded yet.</pre>'; } else { echo '<pre>'; var_dump(xprofile_get_field_data('Targa', wp_get_current_user()->ID)); echo '</pre>'; } exit; } add_action('bp_init', 'my_custom_buddypress_function', 20);And this is the output I received:
string(29) “my_custom_buddypress_function”
BuddyPress xprofile component has not been loaded yet.BuddyPress 12.5.0 is installed and active.
It keeps throwing the same error: The function does not exist. I’m already developing a plugin and I’m inside a
initcallback.Hasn’t BP been auto-loaded yet at this stage?
I also tried to recursively auto-load every single file contained in the buddypress/ folder. But this is not enough as I encounter other dependency errors. Therefore there must be a function/method/class to invoke in order to properly set up the system.
Thanks for your reply. The problem is that I’m getting the following error message:
Fatal error: Uncaught Error: Call to undefined function xprofile_get_field_data()
I’ve also tried to use the following code to auto-load the BuddyPress dependencies:
require_once WP_PLUGIN_DIR . '/buddypress/bp-loader.php';What’s the correct way to auto-boot BuddyPress?