Skip to:
Content
Pages
Categories
Search
Top
Bottom

Unable to paste YouTube code into profile fields

  • @scoobydoobydoo

    Participant

    I’ve created some extended profile fields for my users to add videos. If you paste YouTube code into those profile fields and save the profile, the YouTube code gets stripped out and the field remains empty. Is this normal??

Viewing 16 replies - 1 through 16 (of 16 total)
  • @chouf1

    Participant

    Hi @scoobydoobydoo wouaaaaaaaah,

    the rock’n’roll answer of the day is NO ! I tested on my site and i can insert a youtube URI without problem. The field shows a well formed URI

    If you use a custom theme test your config with bp-default and all plugins deactivated and begin to debug…
    If you use bp-default, deactivate all plugins and begin to debug…

     

    @scoobydoobydoo

    Participant

    Thanks for your reply! I guess it’s yet *another* thing that’s not working using the non standard theme. I had thought as much, just wanted someone to confirm. Very frustrating 🙁

    @ubernaut

    Participant

    fyi you should not be pasting embed code you should be pasting the youtube page url or shortlink for the video

    @scoobydoobydoo

    Participant

    Ben, do you mean I can’t embed the video on the page, and that I can only put a link to YouTube (and therefore send the visitor away from my site)?

    @ubernaut

    Participant

    no i’m saying if you put the link (as text not anchor tag) it will substitute the embed automatically it’s called an oEmbed more info here:

    https://codex.wordpress.org/Embeds

    @modemlooper

    Moderator

    @ubernaut

    Participant

    oh i figured she was just talking about as an update. That code you have there is pretty cool @modemlooper would that work with any oEmbed or just youtube? you know me and code but it looks like it would work with any oEmbed. Also is that something which would be placed inside bp-custom? BTW i like your site design.

    @modemlooper

    Moderator

    Any oEmbed WordPress allows but you have to match up field name with code

    @ubernaut

    Participant

    ah gotcha so just put that into the bp-custom file then?

    @modemlooper

    Moderator

    Yup.

    @ubernaut

    Participant

    nice one thanks for that might have to add an embed field to see what folks do with that.

    @chouf1

    Participant

    Thank you @modemlooper,
    the code is ok, but it will work only on the first field group.
    It would be better to have this “information” on a custom field group.

    @modemlooper

    Moderator

    Not true, http://dev.taptappress.com/admin/profile/

    I have it in a second group called my info.

    @chouf1

    Participant

    You’re right @modemlooper !Sorry…
    Though i tried several times before posting, but now it works. Huh ! 🙄

    @modemlooper

    Moderator

    updated my blog post to include other services besides youtube

    @chouf1

    Participant

    I modified the function because $var strip the whole profile information.

    Insert the $var in the if and it’s ok !<code>
    if(  strtolower( $field_name ) == ‘youtube’ ) {
    $val = strip_tags( $val );
    return wp_oembed_get( $val, array(‘width’=>400) );
    return $val;</code>

Viewing 16 replies - 1 through 16 (of 16 total)
  • The topic ‘Unable to paste YouTube code into profile fields’ is closed to new replies.
Skip to toolbar