Skip to:
Content
Pages
Categories
Search
Top
Bottom

Unable to paste YouTube code into profile fields

  • Profile photo of ninjini
    ninjini
    Participant

    @scoobydoobydoo

    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)
  • Profile photo of danbpfr
    danbpfr
    Participant

    @chouf1

    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…

     

    Profile photo of ninjini
    ninjini
    Participant

    @scoobydoobydoo

    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 :-(

    Profile photo of Ben Hansen (ubernaut)
    Ben Hansen (ubernaut)
    Participant

    @ubernaut

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

    Profile photo of ninjini
    ninjini
    Participant

    @scoobydoobydoo

    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)?

    Profile photo of Ben Hansen (ubernaut)
    Ben Hansen (ubernaut)
    Participant

    @ubernaut

    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

    Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

    Profile photo of Ben Hansen (ubernaut)
    Ben Hansen (ubernaut)
    Participant

    @ubernaut

    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.

    Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

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

    Profile photo of Ben Hansen (ubernaut)
    Ben Hansen (ubernaut)
    Participant

    @ubernaut

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

    Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

    Yup.

    Profile photo of Ben Hansen (ubernaut)
    Ben Hansen (ubernaut)
    Participant

    @ubernaut

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

    Profile photo of danbpfr
    danbpfr
    Participant

    @chouf1

    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.

    Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

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

    I have it in a second group called my info.

    Profile photo of danbpfr
    danbpfr
    Participant

    @chouf1

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

    Profile photo of modemlooper
    modemlooper
    Moderator

    @modemlooper

    updated my blog post to include other services besides youtube

    Profile photo of danbpfr
    danbpfr
    Participant

    @chouf1

    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