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

support other social networks #219

Closed
aschweigert opened this issue Apr 21, 2014 · 6 comments
Closed

support other social networks #219

aschweigert opened this issue Apr 21, 2014 · 6 comments
Assignees
Labels
priority: low Nice-to-have in a release. type: improvement
Milestone

Comments

@aschweigert
Copy link

have received requests for pinterest and instagram.

@aschweigert
Copy link
Author

do we want to add this? or just make it easy to extend from a child theme for the sites that might want it?

@aschweigert aschweigert modified the milestones: 0.6, 0.4 Dec 12, 2014
@aschweigert
Copy link
Author

also sina weibo, basically let's just add a filter to register additional social networks from a child theme.

@aschweigert
Copy link
Author

pinterest and instagram are added, should probably still have a way to register additional ones from a child theme

@benlk
Copy link
Collaborator

benlk commented Jan 29, 2016

For users or for the whole site, or both? We filter the theme options: https://github.com/INN/Largo/blob/master/options.php#L704 Adding a site-wide option is just some array splicing.

For users, there would need to either be two filters or one filter and a unified system for generating options in coauthors and in normal users, and a filter upon that.

@aschweigert
Copy link
Author

for the whole site, the options are there but we'd need to add support for the places where the additional options might appear (header/footer, follow widget, etc.)

@benlk
Copy link
Collaborator

benlk commented Jan 29, 2016

The floating social buttons, article-top social buttons, and the Largo Follow widget all use largo_post_social_links, which we can extend using this filter https://github.com/INN/Largo/blob/master/inc/post-tags.php#L322

But that would be a mess of string manipulation.

We should probably do this:

  • make the core of largo_post_social_links an action, upon which each individual button is a function.
  • make the additional-items menu of largo_post_social_link a separate action.
  • make every button in those areas a function hooked upon the action.
  • move those button functions into their own file, so as to decrease clutter in post-tags.php
  • Make the $fields array of largo_social_links filterable #1100

We'd be able to more-easily reorder buttons in child themes by deregistering and reregistering with different priorities, and it would be a lot easier to add more buttons from within Largo and from child themes by just adding more button-actions on the hook. This change wouldn't be a breaking change as long as the largo_post_social_links filter on the output HTML remained. Child themes with redefined largo_post_social_links functions would still be doing the right thing in that area.

For the header and other places using largo_social_links, we don't currently have a filter on the social links used there: https://github.com/INN/Largo/tree/master/inc/header-footer.php#L94 This area uses different button markup than largo_post_social_links, so I wouldn't want to take the same approach suggested above for largo_post_social_links. It's probably okay to just filter the array inside largo_social_links. This is #1100

We might want to add a filter in the middle of options.php, right after the social options are added to the $options framework, https://github.com/INN/Largo/blob/master/options.php#L171-L222 , just to make it easier to add things there. This would make adding new options as easy as $options[] = array( ... ) instead of having to do tricks with array_splice.

And we'd want documentation. and reference implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Nice-to-have in a release. type: improvement
Projects
None yet
Development

No branches or pull requests

3 participants