-
Henry Wright replied to the topic [Resolved] oEmbed in BP Profile in the forum How-to & Troubleshooting 9 years, 10 months ago
Hi @myg0t
In bp-xprofile/bp-xprofile-template.php at around line 500, you’ll see:
apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
The
$val
,$type
and$key
args in your function correspond to$field->data->value
,$field->type
,$field->id
-
Henry Wright replied to the topic [Resolved] oEmbed in BP Profile in the forum How-to & Troubleshooting 9 years, 10 months ago
Hi @myg0t
In the bp-xprofile/bp-xprofile-template.php at around line 500, you’ll see:
apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
The
$val
,$type
and$key
args in your function correspond to$field->data->value
,$field->type
,$field->id
-
Henry Wright replied to the topic [Resolved] oEmbed in BP Profile in the forum How-to & Troubleshooting 9 years, 10 months ago
Hi @myg0t
In the bp-xprofile/bp-xprofile-template.php at around line 500, you’ll see:
apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
$val
,$type
and$key
correspond to$field->data->value
,$field->type
,$field->id
-
Prince Abiola Ogundipe replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
-
Prince Abiola Ogundipe replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
did you remember to change the field name (YOUR FIELD NAME)to the name you call it in your?
I am currently using the code and working fine for me.
-
Hugo Ashmore replied to the topic [INFO] Useful s2member/buddypress knowledge in the forum Creating & Extending 10 years, 1 month ago
@shanebp thanks for clarifying the changes.
@myg0t Big thanks for adding this to the codex, please don’t be put off by us pestering on the changes 🙂 bp_parse_args greatly simplifies things in terms of not having to have people locate, overload, possibly set up a child theme etc. wp_login is important to ensure you only run your function…[Read more]
-
aces replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
I haven’t tried the above code, but the location of bp-custom.php should be /wp-content/plugins/bp-custom.php not the buddypress plugin directory.
-
aces replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
I haven’t tried the above code, but bp-custom.php should be in /wp-content/plugins/bp-custom.php not the buddypress plugin directory.
-
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
@myg0t I think the problem is with the hook I’ve used. How did you get on with @naijaping‘s code?
-
Prince Abiola Ogundipe replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
@myg0t, try the code below
// Enable oembed in profile
function bp_youtube_in_profile() {
add_filter( 'bp_get_the_profile_field_value', 'bp_enable_youtube_in_profile', 9, 3 );
}
add_action( 'bp_init', 'bp_youtube_in_profile', 0 );function bp_enable_youtube_in_profile( $val, $type, $key ) {
$field = new BP_XProfile_Field( $key…[Read more]
-
Prince Abiola Ogundipe replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
@myg0t, try the code below
// Enable oembed in profile
function bp_youtube_in_profile() {
add_filter( ‘bp_get_the_profile_field_value’, ‘bp_enable_youtube_in_profile’, 9, 3 );
}
add_action( ‘bp_init’, ‘bp_youtube_in_profile’, 0 );function bp_enable_youtube_in_profile( $val, $type, $key ) {
$field = new BP_XProfile_Field( $key…[Read more]
-
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
Hi @myg0t,
Try doing this:
function my_oembed_function( $value ) {
global $wp_embed;
$value = $wp_embed->autoembed( $value );
return $value;
}
add_filter( 'bp_get_the_profile_field_value', 'my_oembed_function' );Please note I’ve not had a chance to test.
I’m assuming
bp_get_the_profile_field_value
is the right hook here.…[Read more] -
Henry Wright replied to the topic oEmbed in BP Profile Field in the forum How-to & Troubleshooting 10 years, 1 month ago
Hi @myg0t,
Try doing this:
function my_oembed_function( $value ) {
global $wp_embed;
$value = $wp_embed->autoembed( $value );
retrun $value;
}
add_filter( 'bp_get_the_profile_field_value', 'my_oembed_function' );Please note I’ve not had a chance to test.
I’m assuming
bp_get_the_profile_field_value
is the right hook here. Grateful…[Read more] -
Hugo Ashmore replied to the topic [INFO] Useful s2member/buddypress knowledge in the forum Creating & Extending 10 years, 1 month ago
@myg0t Thanks for sharing that with the community, S2 Member has wide use so this ought to be useful to people.
One point though it’s best not to advise that people edit a core file /buddypress/bp-templates/bp-legacy/..etc BP has a fairly well defined template hierarchy overload allowing files to be copied to the theme or child theme, those are…[Read more]
@myg0t
Active 9 years, 9 months ago