From 655a7fc3d336fb36671e2d8ab5bda4229aecfdce Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 23 Jun 2006 10:32:27 +0000 Subject: WP merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@592 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/post.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'wp-includes/post.php') 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; -- cgit