Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmundo Santos committed Jun 27, 2017
0 parents commit 5dac270
Show file tree
Hide file tree
Showing 16 changed files with 1,067 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Empty file added .gitignore
Empty file.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 1.2.0: September 4th, 2016
* Remove share counts completely
* Remove JS for window popup
* Refactor CSS and update SVG icons

# 1.1.0: November 23rd, 2015
* Remove Twitter share counts as they're [no longer supported by Twitter](https://twittercommunity.com/t/clarification-about-share-counts-for-the-new-tweet-button/52868)

# 1.0.4: August 12th, 2015
* Fix issue with loading translated language files

# 1.0.3: July 2nd, 2015
* Fix issue with [share] shortcode not using the provided 'title' and 'url' attributes

# 1.0.2: June 2nd, 2015
* Don't show 'Pin It' button if post doesn't have a thumbnail
* Make sure post thumbnail URL is absolute
* Use plural name for post type labels

# 1.0.1: April 7th, 2015
* Change `&` to `&`
* Add missing `</path>` on SVGs

# 1.0.0: January 23rd, 2015
* Initial release
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Roots Share Buttons

Add lightweight social sharing buttons.

## Requirements

* PHP >= 5.3

## Features

* Supported networks: Facebook, Twitter, Google+, LinkedIn, Pinterest
* Easily set button order
* Lightweight, mobile-first stylesheet
* Automatically include share buttons:
* Before and/or after content on archive templates
* Before and/or after content on single templates
* On specified post types (custom post types are supported)
* Supports custom share button templates
* Includes a `[share]` shortcode for adding the share buttons within post content

## Customization

The `[share]` shortcode includes the template from `templates/shortcode-share.php`. If you'd like to use a custom template, copy `shortcode-share.php` into the `templates/` directory in your theme and also implement the following example snippet:

```php
/**
* Custom [share] shortcode template
*/
function custom_roots_share_buttons_template() {
return get_template_directory() . '/templates/shortcode-share.php';
}
add_action('roots/share_template', 'custom_roots_share_buttons_template');
```

## Removing plugin CSS

Roots Share Buttons includes one stylesheet. If you'd prefer to implement these styles within your theme (which is recommended), you can remove the plugin assets with this snippet:

```php
/**
* Remove Roots Share Buttons assets
*/
function remove_roots_share_buttons_assets() {
wp_dequeue_style('roots-share-buttons');
}
add_action('wp_enqueue_scripts', 'remove_roots_share_buttons_assets');
```
10 changes: 10 additions & 0 deletions assets/scripts/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
jQuery(document).ready(function() {

jQuery('#buttons-sort').sortable({
stop: function(event, ui) {
var buttonOrder = jQuery(this).sortable('toArray').toString().replace(/sort_/g, '').replace('googleplus', 'google_plus');
jQuery('#roots_share_buttons_button_order').val(buttonOrder);
}
});

});
17 changes: 17 additions & 0 deletions assets/styles/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import url('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css');

.ui-sort {
width: 20em;
}
.ui-sort li {
position: relative;
margin: 0 3px 3px 3px;
padding: 4px 3px 2px 8px;
height: 18px;
cursor: move;
}
.ui-sort li span {
position: absolute;
right: 0;
margin-right: 6px;
}
53 changes: 53 additions & 0 deletions assets/styles/share-buttons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.entry-share-btns {
margin-left: -.25em;
padding-left: 0;
list-style: none;
}
.entry-share-btns li {
display: inline-block;
margin: .25em;
}
.entry-share-btns a,
.entry-content .entry-share-btns a {
font-size: .75em;
display: block;
padding: .25em .75em;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-decoration: none;
color: #fff;
border: none;
border-radius: 6px;
background: #666;

background: #27ae60;
}
.entry-share-btns a:hover,
.entry-share-btns a:focus {
text-decoration: none;
color: #fff;
background: #555;
}
.entry-share-btn-icon {
position: relative;
top: 3px;
display: inline-block;
fill: #fff;
stroke: none;
}
.entry-share-btns svg {
width: 1em;
height: 1em;
vertical-align: top;
}
.entry-share-btns span {
display: none;
}
@media (min-width: 600px) {
.entry-share-btns span {
display: inline-block;
padding-left: .4em;
}
}
119 changes: 119 additions & 0 deletions lang/roots_share_buttons.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#: lib/admin.php:36
msgid "General Configuration"
msgstr ""

#: lib/admin.php:42
msgid "Enable Buttons"
msgstr ""

#: lib/admin.php:49
msgid "Share Count"
msgstr ""

#: lib/admin.php:56
msgid "Theme Integration"
msgstr ""

#: lib/admin.php:62
msgid "Archive Templates"
msgstr ""

#: lib/admin.php:69
msgid "Single Templates"
msgstr ""

#: lib/admin.php:76
msgid "Post Types"
msgstr ""

#: lib/admin.php:210
msgid "Twitter"
msgstr ""

#: lib/admin.php:213
msgid "Facebook"
msgstr ""

#: lib/admin.php:216
msgid "Google Plus"
msgstr ""

#: lib/admin.php:219
msgid "LinkedIn"
msgstr ""

#: lib/admin.php:222
msgid "Pinterest"
msgstr ""

#: lib/admin.php:231 lib/admin.php:238
msgid "Before the content"
msgstr ""

#: lib/admin.php:232 lib/admin.php:239
msgid "After the content"
msgstr ""

#: lib/admin.php:245
msgid "Enabled"
msgstr ""

#: lib/admin.php:246
msgid "Disabled"
msgstr ""

#: templates/shortcode-share.php:30
msgid "Share on Twitter"
msgstr ""

#: templates/shortcode-share.php:32
msgid "Tweet"
msgstr ""

#: templates/shortcode-share.php:43
msgid "Share on Facebook"
msgstr ""

#: templates/shortcode-share.php:45 templates/shortcode-share.php:71
msgid "Share"
msgstr ""

#: templates/shortcode-share.php:56
msgid "Share on Google+"
msgstr ""

#: templates/shortcode-share.php:58
msgid "+1"
msgstr ""

#: templates/shortcode-share.php:69
msgid "Share on LinkedIn"
msgstr ""

#: templates/shortcode-share.php:96
msgid "Share on Pinterest"
msgstr ""

#: templates/shortcode-share.php:98
msgid "Pin it"
msgstr ""

#. Plugin Name of the plugin/theme
msgid "Roots Share Buttons"
msgstr ""

#. Plugin URI of the plugin/theme
msgid "https://roots.io/plugins/share-buttons/"
msgstr ""

#. Description of the plugin/theme
msgid "Add lightweight social sharing buttons with optional share counts."
msgstr ""

#. Author of the plugin/theme
msgid "Ben Word"
msgstr ""

#. Author URI of the plugin/theme
msgid "https://roots.io/"
msgstr ""
7 changes: 7 additions & 0 deletions lib/activation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Roots\ShareButtons\Activation;

if (get_option('roots_share_buttons') === false) {
add_option('roots_share_buttons', \Roots\ShareButtons\Admin\get_defaults());
}
Loading

0 comments on commit 5dac270

Please sign in to comment.