Support Forum

Links to external media files

38 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

well that number 17 looks suspicious to me…. Now I will check a couple of things.

(1) We call the WP oEmbed function as a matter of course. Normally in these circumstances, we would expect WP to perform the check on whether oEmbed is switched on or not and – if off – gracefully return having done nothing. I will check if this is indeed the case or if we should be checking that before we make the call. As I say if we have this wrong then this would be counter to expected behaviour.

(2) As I understood it (and this may have changed), the WP oEmbed function checked against a predetermined list of websites. This is the way it is defined in their documentation. But maybe they are in fact looking at each request regardless of the url. This would be a crazy thing to do but maybe… so I will check into this as well.

YS Yellow Swordfish
Yellow Swordfish
Member

Can you try a quick code edit?

File sp-api/sp-api-filters.php

Function sp_filter_content_save()

Line 95

Currently should be:

$content = sp_filter_save_oEmbed($content);

Can you change that to:

if (get_option('embed_autourls')) {
    $content = sp_filter_save_oEmbed($content);
}

… yes – it might have been us. See if that makes a difference…

MW Mike Warren
Mike Warren
Member

Not only does it now post, it posts very quickly (of course smile ).

However, I’m not convinced switching off the oembed on the whole site is the ultimate answer. Is this something you can raise with the WP devs?

MW Mike Warren
Mike Warren
Member

Oh, and I’ll mention that this work-around will be usable for me, so I’ll get back to trying to work out how to reattach the old attachments. I really want to take my site live before I head off to New Zealand on the 18th.

Is there a specific reason the upload system is not available in post edit mode? That would make it so easy for me to reattach the files. It would also mean that people can correct their posts when they forget the attachment rather the creating a new post.

YS Yellow Swordfish
Yellow Swordfish
Member

I’ll need to ask Steve to comment on the uploader availability in the post edit but I know he is thinking about this at the moment.

I would be interested to know if you have the same problem with the oEmbed if oEmbed in WP is turned ON but you post to the forum as an ordinary user (NOT a WP Admin or Editor).

MW Mike Warren
Mike Warren
Member

Yellow Swordfish said

I’ll need to ask Steve to comment on the uploader availability in the post edit but I know he is thinking about this at the moment.

I would be interested to know if you have the same problem with the oEmbed if oEmbed in WP is turned ON but you post to the forum as an ordinary user (NOT a WP Admin or Editor).

I just tried it. Yes it still fails when logged in as a normal user.

Edit: that is, when oEmbed is on.

YS Yellow Swordfish
Yellow Swordfish
Member

Interesting. As is often the case, WP documentation leaves a little to be desired but it does imply that oEmbed self-discovery will only be used if the current user is a WP admin or editor. If not, then a whiltelist of sites is used that have known oEmbed support (such as YouTube, Flickr etc). For such a site, WP loads the site header to establish the oEmbed provider and get the url to use.
In other words, for any site not on the whitelist no attempt should be made to do this – which does not appear to be what is happening with you.

MW Mike Warren
Mike Warren
Member

Yes. I somehow doubt my little site made it to the wordpress whitelist. smile

YS Yellow Swordfish
Yellow Swordfish
Member

The WP oEmbed was written, I believe, by an Australian!