Skip to:
Content
Pages
Categories
Search
Top
Bottom

Unable to paste YouTube code into profile fields

  • Avatar 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)
  • Avatar of Chouf1
    Chouf1
    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…

     

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

    Avatar of @ubernaut
    @ubernaut
    Participant

    @ubernaut

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

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

    Avatar of @ubernaut
    @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:

    http://codex.wordpress.org/Embeds

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Avatar of @ubernaut
    @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.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

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

    Avatar of @ubernaut
    @ubernaut
    Participant

    @ubernaut

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

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Yup.

    Avatar of @ubernaut
    @ubernaut
    Participant

    @ubernaut

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

    Avatar of Chouf1
    Chouf1
    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.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

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

    I have it in a second group called my info.

    Avatar of Chouf1
    Chouf1
    Participant

    @chouf1

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

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    updated my blog post to include other services besides youtube

    Avatar of Chouf1
    Chouf1
    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)

You must be logged in to reply to this topic.