is_local_attachment [ WordPress Function ]
is_local_attachment ( $url )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: is_attachment, wp_ajax_upload_attachment, wp_count_attachments, wp_delete_attachment, clean_attachment_cache
Check if the attachment URI is local one and is really an attachment.
Source
<?php
function is_local_attachment($url) {
if (strpos($url, home_url()) === false)
return false;
if (strpos($url, home_url('/?attachment_id=')) !== false)
return true;
if ( $id = url_to_postid($url) ) {
$post = & get_post($id);
if ( 'attachment' == $post->post_type )
return true;
}
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/is local attachment « WordPress Codex
Description. Check if the attachment URI is local one and is really an attachment. Usage. <?php is_local_attachment( $url ) ?> Parameters. $url: (string) ...
codex.wordpress.org - post.php
Jul 16, 2009 ... is_local_attachment(), Check if the attachment URI is local one and is really an attachment. is_sticky(), Check if post is sticky. sanitize_post() ...
www.tig12.net - is_local_attachment - условный тег (Conditional Tag) WordPress
28 апр 2012 ... Русское подробное описание условного тега (функции) WordPress is_local_attachment с примерами и пояснениями работы. Заходите :)
www.wordpressplugins.ru - Use WordPress' is_page() To Display Custom Content | Travis Berry
Jan 11, 2010 ... is_home(), is_front_page(), is_search(), is_404(), is_singular(), is_page(), is_attachment(), is_local_attachment(), is_single(), is_sticky(), ...
www.travisberry.com