Imagine one day a friend of yours asks you to take their child and help them raise him for a while because they aren't able to do so at the time. Imagine you do so, and years later your friend wants their child back. You're not related to the child, but you've been raising him and have bonded with him. Do you have any legal basis to remain part of the child's life? Under Pennsylvania law and in Allegheny County, you have the right to fight for some kind of custody with this child.
In Pennsylvania, if you have been acting as the primary, de facto custodial parent, you have standing to sue for custody. The ultimate goal of courts, of course, is to reunite families who have been separated and do what it is in the best interest of the child, however sometimes what is in the best interest is giving custody to someone other than the biological parents.
If you are involved in a case where the parent or parents have given you consent, you can have an attorney draft a consent custody order and a custody complaint that all parties may sign, or you can have a confirmation of custody drafted that all parents can consent to by signing the order of court. Once this is done, all parties can consent in front of a judge and establish a working custody order.
If the biological parents are opposed, you still have the right to sue for custody. Most courts will want the parents to remain in the child's life, however if the circumstances are bad enough, the court may grant you primary custody on an interim basis while you and the other parties go through the Generations program through the Allegheny County Court of Common Pleas. This process will allow you and the parties to mediate the custody arrangement and if mediation fails, it will allow you to go before a judge for a hearing.
The bottom line is that in Allegheny County, Pennsylvania, if you are acting as a de facto custodian to a child that is not biologically yours and there is no evidence of fraud or kidnapping, then you may have a strong custody case.