You may have already seen our Sharing buttons, which allow users to easily share their content on other services. If you run a service which is not currently supported in our list of default options, you might like to help users set up your service as a sharing option on their blog. We offer a simple inbound link option which will trigger the service creation process for a user, requiring them to click a single button to confirm the addition of your button.
Get A Base URL
Before you can create an inbound link, you will need to gather the URL of the specific blog for which the user would like to add your sharing button.
- If you’re an OAuth2 partner, you can get a listing of a users blogs via XML-RPC request, then provide them with a simple, clickable list.
- If you are not using OAuth, or don’t want to require your users to connect, you can just offer a text field where you have them enter their URL (make sure you validate it, add the “
http://
” etc).
Once you have the base URL, you can construct a complete link into our sharing services.
Creating The Link
The link you need to create goes directly to the Settings > Sharing option within wp-admin, and looks something like this:
https://SUBDOMAIN.wordpress.com/wp-admin/options-general.php?page=sharing&create_new_service=true&name=YOUR-SERVICE-NAME&url=YOUR-SHARING-URL&icon=YOUR-SERVICE-ICON
All of the values in capital letters should be replaced with appropriate substitutions:
- SUBDOMAIN: The name of the specific blog to which this button will be added.
- YOUR-SERVICE-NAME: A user-facing label for your button. Appears on the actual button in text-only or text+icon modes. Must be URL-encoded.
- YOUR-SHARING-URL: The URL to trigger a “share” action on your service. Include the variables detailed in the dialog to pass specific information (%post_title% etc). Must be URL-encoded.
- YOUR-SERVICE-ICON: The URL to a 16x16px icon to show as part of your button. Must be URL-encoded.
When a user clicks on a link such as this, they will be taken to the Settings > Sharing page within their wp-admin, and be presented with a screen such as this:
All they need to do is click the “Create Share Button” button at the bottom of the screen and the new button will be created. Their page will reload and then they can drag the new service into the “Enabled Services” section to display it on their blog.