(a) If a party is absent or relocates from the family residence, the court shall not consider the absence or relocation as a factor in determining custody or visitation in either of the following circumstances:
(1) The absence or relocation is of short duration and the court finds that, during the period of absence or relocation, the party has demonstrated an interest in maintaining custody or visitation, the party maintains, or makes reasonable efforts to maintain, regular contact with the child, and the party’s behavior demonstrates no intent to abandon the child.
(2) The party is absent or relocates because of an act or acts of actual or threatened domestic or family violence by the other party.
(b) The court may consider attempts by one party to interfere with the
other party’s regular contact with the child in determining if the party has satisfied the requirements of subdivision (a).
(c) This section does not apply to either of the following:
(1) A party against whom a protective or restraining order has been issued excluding the party from the dwelling of the other party or the child, or otherwise enjoining the party from assault or harassment against the other party or the child, including, but not limited to, orders issued under Part 4 (commencing with Section 6300) of Division 10, orders preventing civil harassment or workplace violence issued pursuant to Section 527.6 or 527.8 of the Code of Civil Procedure, and criminal protective orders issued pursuant to Section 136.2 of the Penal Code.
(2) A party who abandons a child as provided in Section 7822.