Auto Embed don't work in content post

This topic contains 4 reply and 3 voices, and was last updated by HispanicSearching 10 years, 3 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
December 31, 2013 at 5:32 am 14065
HispanicSearching Hi, when I create or edit a post content with wpuf in the created post oembed from wordpress only display the url and don't display the generated embed. BUT if the same post is edited in wp-admin oembed work. I have read http://codex.wordpress.org/Embeds as suggested but I don't find the reason. The user creating the post under wpuf is subscriber role. Any idea ? Thanks.
December 31, 2013 at 6:07 am 14066
Mahi Mahi

Please provide your site url, user login and password so we can check it. Also mark your reply as Private reply to keep it safe.

December 31, 2013 at 6:23 am 14067
HispanicSearching HispanicSearching

Thank Mahi, I found the error. The problem is when I save the post with wpuf it change all newline with <br /> and put entire content in one line. In this way the regex from autoembed to math url don’t work, it’s this:

function autoembed( $content ) {
  return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this,'autoembed_callback' ), $content );
}

With this, a line like:

"fahsflks http://www.youtube.com/watch?v=fusdhfsk sfhsakjf sha"

will match, but a line like

"<br />http://www.youtube.com/watch?v=fusdhfsk<br />"

don’t

I don’t know why this append using tinymce in wpuf but in wp-admin it don’t replace newlines by
.

I have check function theme and plugins and don’t find who can modify this behaviour in wpuf.

Any suggestions ?

December 31, 2013 at 12:56 pm 14071
Tareq Hasan Tareq Hasan

Can you check if that happens with all user role? unfiltered_html permission might create some problem. Please check with admin, author, subscriber and contributor role and let me know 🙂

December 31, 2013 at 4:14 pm 14072
HispanicSearching HispanicSearching

Tareq, the same problem with editor and admin role.

First I thought the same, the unfiltered_html permission, but this is need only for “discover” oembed but if the embed is in the know list it’s not need this permission. If I use de [embed][/embed] code it works. The problem I think is how tinymce conver newlines to br’s using it in wpuf and in this manner the preg_replace_callback don’t match the urls.

Viewing 4 Posts - 1 through 4 (of 4 total)