update_attached_file [ WordPress Function ]
update_attached_file ( $attachment_id, $file )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_attached_file, update_archived, update_post_cache, update_page_cache, update_meta_cache
Update attachment file path based on attachment ID.
Used to update the file path of the attachment, which uses post meta name '_wp_attached_file' to store the path of the attachment.
Source
<?php
function update_attached_file( $attachment_id, $file ) {
if ( !get_post( $attachment_id ) )
return false;
$file = apply_filters( 'update_attached_file', $file, $attachment_id );
$file = _wp_relative_upload_path($file);
return update_post_meta( $attachment_id, '_wp_attached_file', $file );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/update attached file « WordPress Codex
Description. Update attachment file path based on attachment ID. Used to update the file path of the attachment, which uses post meta name '_wp_attached_file' ...
codex.wordpress.org - update_attached_file Wordpress hook details -- Adam Brown, BYU ...
Applied to the attachment information prior to saving in post metadata in the update_attached_file function. Filter function arguments: attachment information, ...
adambrown.info - update_attached_file (WordPress Function) - WPSeek.com
WordPress lookup for update_attached_file, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - update_attached_file
Function and Method Cross Reference. update_attached_file(). Defined at: /wp- includes/post.php -> line 189. Referenced 4 times: ...
phpxref.ftwr.co.uk
Kullanýcý Tartýþmalarý [ wordpress.org ]
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"
- giant slayer on "How do I set feature image using the function wp_insert_post"