A referendum was held in Slovenia on 25 March 2012 on the new family code passed by the then-governing coalition led by Borut Pahor. The code was rejected with 54.55% of voters against the law.
The family code bill passed by the government of Borut Pahor which expanded existing same-sex registered partnerships to have all rights of married couples, except adoption (excluding step-child adoption). The law also expanded provisions protecting the rights of children, such as outlawing corporal punishment and establishing a children's ombudsman. A conservative group "Civil Initiative for the Family and the Rights of Children", led by the activist and philosopher Aleš Primc (member of the conservative-centrist Slovenian People's Party), opposed to same-sex unions gathered the required signatures to force a referendum on the law.
A February/March poll carried out by Delo found that 35.9% of the respondents would vote to uphold the law, while 26.3% said they would vote to repeal it and 20.9% were undecided. The remaining 16.9% of the respondents said they would not attend the referendum. The poll was conducted on 29 February and 1 March among 504 respondents.
A Ninamedia poll for PlanetSiol.net carried out between 13 and 15 March 2012 found that 47.2% of the respondents would vote to uphold a law, while 40.4% said they would vote to repeal it and 12.4% were undecided. The poll was based on the responses of 700 people.
Another Delo poll conducted between 14 and 20 March among 709 respondents found that 46.9% of the respondents would vote to uphold a law, while 29.2% said they would vote to repeal it and 16.4% were undecided. The remaining 7.5% of the respondents didn't want to respond. Among those who said that they would definitely or probably attend the referendum, 60% said that they would vote to uphold a law while 40% said they would vote to repeal it.
The law was rejected by voters. Voter turnout was 30.1%.