Several laws in place that are relevant to this issue. La Ley de Protección al Honor, Intimidad y Propia Imagen (Protection of Honour, Privacy and Own Image) that ´translates´ an individual´s fundamental rights as stated in the Spanish Constitution and the Ley de Protección de Datos, the Data Protection Law.
You need to take special care when minors are involved. In principle, you can only publish pictures of your own children and only then if both parents agree. Any others, e.g. of a birthday party with several of their friends present, need prior authorisation from the other parents. Or photoshop their faces so they are not recognisable. Even if you publish them on a private blog.
Taking pictures of people in public places if they form part of the ambiance is allowed, provided the subject of the photo is the event/activity and the focus is not on the people. If there are minors in the picture and they can be recognised, their faces should be photoshopped. Another provision is that the photos should be exclusively for personal and/or domestic use.
Sharing on Facebook is hardly that, even if you put your privacy settings to ´friends´ only.
So all and any method used to share/publish photos other than for above mentioned use requires prior consent of the persons in the photo. Even if they don´t protest at the time you take the picture, this doesn´t mean they consent to having the photo published on social media or anywhere else, except your private ´snapbook´.
For this purpose, schools need to seek the parent´s permission to publish pictures taken during school activities and published on a school blog, or yearbook for example. Good to know maybe that as of 14 years old, minors can give authorisation themselves. But, if that minor publishes a photo of another person that infringes their right to honour etc. so damages their reputation for example, the parents are still responsible under civil law and need to pay any damages should the case be taken to court.
Strictly speaking, when organising events and having pictures taken by a photographer, meant to be published anywhere later, you should clearly signpost that this is the case and that anyone entering the premises implicitly consents to this, except when they explicitly state with the organisation that they do not. Same goes for video.
Now I know of course that nowadays in practice hardly anyone will protest against their picture being taken or published on Facebook or other social media, but you need to be aware that by law they should have given explicit consent so can protest and even denounce you.