diff options
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; |
