This component introduces a neat concept through the mm_get_social_networks function. Now we register and then pass around an array of social networks that we want to support for a given site through the mm_social_networks filter. This allows us to set all the specific social networks we want to support and then have those networks get included across all of our components. Now adding new networks and reordering the existing networks is as easy as filtering an array.
The order of the networks will get respected when we output them on the front end and in our UI if we make sure to always refer back to the array of registered networks and loop over the registered networks when building any output. This component takes that approach in both the render function and the VC param mapping function.
The default networks at this point are Facebook, Twitter, Instagram, Pinterest, and Youtube, in that order, and we're currently defaulting to Font Awesome Icons but we also have an Images option.
I still need to figure out how we should make sure Font Awesome is included on the page (currently Font Awesome loads on every page in Trestle or when using BFA, so it will already be there if we're using those). We should probably just include the BFA library as a dependency to avoid enqueing the files twice and support using it without the BFA plugin.
I also need to add some default styling and the widget, so this PR still needs a few commits before it will be ready for merge. If anyone wants to jump in and take it from here feel free to send a PR of your own against this branch.
This component introduces a neat concept through the
mm_get_social_networks
function. Now we register and then pass around an array of social networks that we want to support for a given site through themm_social_networks
filter. This allows us to set all the specific social networks we want to support and then have those networks get included across all of our components. Now adding new networks and reordering the existing networks is as easy as filtering an array.The order of the networks will get respected when we output them on the front end and in our UI if we make sure to always refer back to the array of registered networks and loop over the registered networks when building any output. This component takes that approach in both the render function and the VC param mapping function.
The default networks at this point are Facebook, Twitter, Instagram, Pinterest, and Youtube, in that order, and we're currently defaulting to Font Awesome Icons but we also have an Images option.
I still need to figure out how we should make sure Font Awesome is included on the page (currently Font Awesome loads on every page in Trestle or when using BFA, so it will already be there if we're using those). We should probably just include the BFA library as a dependency to avoid enqueing the files twice and support using it without the BFA plugin.
I also need to add some default styling and the widget, so this PR still needs a few commits before it will be ready for merge. If anyone wants to jump in and take it from here feel free to send a PR of your own against this branch.