update_attached_file

FUNCTION wp-includes\post.php (ligne 861) github
Filters the attached file based on the given ID.

Paramètres

Entrée :
$attachment_id, $file
Sortie :
@param string|false $file          The file path to where the attached file should be, false otherwise.
@param int          $attachment_id Attachment ID.
@param int    $attachment_id Attachment ID.
@param string $file          File path for the attachment.
@return int|bool Meta ID if the `_wp_attached_file` key didn't exist for the attachment.

Utilisation

// Utilisation de la fonction update_attached_file
$result = update_attached_file($attachment_id, $file);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...