diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-23 10:32:27 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-23 10:32:27 +0000 |
commit | 655a7fc3d336fb36671e2d8ab5bda4229aecfdce (patch) | |
tree | a377e02196f988c6d3337601fbba79304950da3c /wp-includes/post.php | |
parent | d48e85e0ac5e675ca33fac173f30c75403d1033f (diff) | |
download | wordpress-mu-655a7fc3d336fb36671e2d8ab5bda4229aecfdce.tar.gz wordpress-mu-655a7fc3d336fb36671e2d8ab5bda4229aecfdce.tar.xz wordpress-mu-655a7fc3d336fb36671e2d8ab5bda4229aecfdce.zip |
WP merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@592 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/post.php')
-rw-r--r-- | wp-includes/post.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wp-includes/post.php b/wp-includes/post.php index ce1a227..b29d0d2 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1118,6 +1118,19 @@ function generate_page_uri_index() { // Attachment functions // +function is_local_attachment($url) { + if ( !strstr($url, get_bloginfo('home') ) ) + return false; + if ( strstr($url, get_bloginfo('home') . '/?attachment_id=') ) + return true; + if ( $id = url_to_postid($url) ) { + $post = & get_post($id); + if ( 'attachment' == $post->post_type ) + return true; + } + return false; +} + function wp_insert_attachment($object, $file = false, $post_parent = 0) { global $wpdb, $user_ID; |