[wp-trac] [WordPress Trac] #23831: Insert Into Post for Audio / Video doesn't always work
WordPress Trac
noreply at wordpress.org
Sun Apr 7 20:27:02 UTC 2013
#23831: Insert Into Post for Audio / Video doesn't always work
------------------------------+--------------------
Reporter: wonderboymusic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.6
Component: Post Formats | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch commit |
------------------------------+--------------------
Comment (by azaozz):
Replying to [comment:7 wonderboymusic]:
> Introduces `attachment_url_to_postid()` which will try to convert a URL
containing a `home_url()` front into post ID by looking at the `guid`
column for an attachment in the posts table
This will not work on many sites. The guid is _not_ the url to an
attachment when the site or the uploads directory has been moved. To do
something like this you will need to look at `_wp_attached_file` post
meta, etc. Check out [http://core.trac.wordpress.org/browser/trunk/wp-
includes/post.php#L4159 wp_get_attachment_url()].
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23831#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list