5324. Standing for any form of physical custody or legal custody
The following individuals may file an action under this chapter for any form of physical custody or legal custody:
(1) A parent of the child.
(2) A person who stands in loco parentis to the child.
(3) A grandparent of the child who is not in loco parentis to the child:
(i) whose relationship with the child began either with the consent of a parent of the child or under a court order;
(ii) who assumes or is willing to assume responsibility for the child; and
(iii) when one of the following conditions is met:
(A) the child has been determined to be a dependent child under 42 Pa.C.S. Ch. 63 (relating to juvenile matters);
(B) the child is substantially at risk due to parental abuse, neglect, drug or alcohol abuse or incapacity; or
(C) the child has, for a period of at least 12 consecutive months, resided with the grandparent, excluding brief temporary absences of the child from the home, and is removed from the home by the parents, in which case the action must be filed within six months after the removal of the child from the home.