Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Links Block: Allow plugins to add additional logos/social links #17277

Closed
jasmussen opened this issue Aug 30, 2019 · 2 comments · Fixed by #19887
Closed

Social Links Block: Allow plugins to add additional logos/social links #17277

jasmussen opened this issue Aug 30, 2019 · 2 comments · Fixed by #19887
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

In #16897 a "social links" block is likely to land in its first version.

Based on feedback for that first version, we'd like to explore some additional features.

At launch, the Social Links block will have a wide range of icons for most present social networks and sites to link to.

But there will always be some network, service, or tool that the block does not link to, but which the block does not contain. It would be good to explore how to add a simple way for plugins or themes to register new child blocks, so that the core list of blocks can remain relatively slim for maintenance purposes, but still allow flexibility for themers and developers.

@mcsf
Copy link
Contributor

mcsf commented Feb 5, 2020

If/once #19887, this becomes automatically possible thanks to the Variations API:

wp.blocks.__experimentalRegisterBlockVariation('core/social-link', {
    name: 'latin-wikipedia',
    title: 'Vicipædia',
    icon: 'smiley',
    attributes: {
        site: 'latin-wikipedia',
        url: 'https://la.wikipedia.org/',
    }
});

Captura de ecrã 2020-02-05, às 13 36 15

Captura de ecrã 2020-02-05, às 13 36 26

@mcsf
Copy link
Contributor

mcsf commented Feb 6, 2020

Once #20068 lands, the API becomes wp.blocks.registerBlockVariation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants