All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
What this husband uttered is conditioning the divorce of his wife, upon her doing a specific matter, using one of the metaphors of divorce. If he conditioned that on something which she did, then conditioning divorce on a matter that took place in the past makes divorce effective immediately, because its essence is that he has realized the divorce and did not condition it.
Therefore, if the wife has done it in the manner that he had intended, then divorce took place; this is in case his intention with that metaphor is to initiate divorce, but if he did not intend to initiate divorce, then this does not lead to anything.
If she did it after he had uttered divorce, then what he had conditioned divorce upon has taken place. In this case, it depends on his intention: if he intended divorce to take place immediately, then divorce took place as soon as she did that even if he had only intended to threaten her, according to the view of the majority of the scholars. However, Ibn Taymiyyah is of the view that divorce does not take place if he intended to threaten her, but he must pay an expiation for breaking an oath.
If he intended a promise, meaning that he will divorce her (in the future), then she is not divorced by doing what he has set as a condition, unless he fulfills his promise and divorces her (by actually uttering divorce). Nevertheless, he should not fulfill this promise; Ibn Taymiyyah said: “The promise of divorce does not take place even if it is said many times; it is neither an obligation to fulfill this promise nor is it desirable to do so.” [End of quote]
Whether she did this act with the knowledge of her husband or without his knowledge, then this does not have any effect on the ruling.
Allah knows best.