How to do social links with icons as a link field in a block?
I had a similar task, for me was better creating a Custom Block Type, named 'Social networks' with one field of type 'Link'. 

In this field you can configure how many links you can handle (remember once you create one block of this type, you'll cannot change this value).

Once this Custom Block Type was created you can configure 'Manage form display' and 'Manage display' if you need.

Now you'll be able to create a Custom Block of type 'Social Networks' that provide a couple of links that you can set/edit, rearrange and use proper template per block, and place where you want.

This was the solution found to not use any piece of code.