Encapsulates the logic for Attach/Detach actions.
$parent_id, $action = 'attach'
Sortie :
@param int $parent_id Attachment parent ID. @param string $action Optional. Attach/detach action. Accepts 'attach' or 'detach'.
// Utilisation de la fonction wp_media_attach_action
$result = wp_media_attach_action($parent_id, $action = 'attach');
if ($result) {
// Votre logique ici
}
Chargement des actualités...