Skip to content

Commit

Permalink
Merge pull request #132 from dshanske/febfixes
Browse files Browse the repository at this point in the history
February Update
  • Loading branch information
dshanske committed Feb 5, 2019
2 parents 187f4c4 + 0db1f6f commit 6833453
Show file tree
Hide file tree
Showing 651 changed files with 1,220 additions and 290 deletions.
42 changes: 10 additions & 32 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ module.exports = function (grunt) {
src: ['static/js/simpleicons.js']
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'node_modules/simple-icons/icons/', src: ['*.svg'], dest: 'static/svg/'},
{expand: true, cwd: 'node_modules/genericons-neue/svg-min/', src: ['*.svg'], dest: 'static/svg/'},
],
},
},
checktextdomain: {
options:{
text_domain: 'indieweb',
Expand Down Expand Up @@ -48,36 +56,6 @@ module.exports = function (grunt) {
}
}
},

svg_sprite: {
icons: {
src: ['node_modules/simple-icons/icons/*.svg', 'static/genericons-neue/*.svg'],
dest: '.',
options : {

shape : {
dimension : { // Set maximum dimensions
maxWidth : 64,
maxHeight : 64
},
spacing : { // Add padding
padding : 2
},
id : {
separator : ''
}
},
mode : {
symbol : { // Activate the «symbol» mode
sprite : 'static/img/simple-icons.svg',
dest: ''
}

}
}
}
},

sass: { // Task
dist: { // Target
options: { // Target options
Expand Down Expand Up @@ -107,10 +85,10 @@ module.exports = function (grunt) {

grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
grunt.loadNpmTasks('grunt-wp-i18n');
grunt.loadNpmTasks('grunt-svg-sprite');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-checktextdomain');
grunt.loadNpmTasks('grunt-execute');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s).
grunt.registerTask('default', ['wp_readme_to_markdown', 'makepot', 'execute', 'checktextdomain', 'svg_sprite']);
grunt.registerTask('default', ['wp_readme_to_markdown', 'makepot', 'execute', 'checktextdomain', 'copy' ]);
};
18 changes: 13 additions & 5 deletions includes/class-hcard-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,14 @@ public static function get_title( $name ) {
* @return string svg icon
*/
public static function get_icon( $name ) {
// Substitute another svg sprite file
$sprite = apply_filters( 'indieweb_icon_sprite', plugins_url( 'static/img/simple-icons.svg', dirname( __FILE__ ) ), $name );

return '<svg class="svg-icon svg-' . $name . '" aria-hidden="true"><use xlink:href="' . $sprite . '#' . $name . '"></use><svg>';
$svg = sprintf( '%1$s/static/svg/%2$s.svg', plugin_dir_path( __DIR__ ), $name );
if ( file_exists( $svg ) ) {
$icon = file_get_contents( $svg );
if ( $icon ) {
return sprintf( '<span class="svg-icon svg-%1$s" aria-hidden="true" aria-label="%2$s" title="%2$s" >%3$s</span>', esc_attr( $name ), esc_attr( $name ), $icon );
}
}
return '';
}

/**
Expand Down Expand Up @@ -451,7 +455,11 @@ public static function get_author() {
return get_option( 'iw_default_author' ); // Set the author ID to default
} elseif ( is_author() ) {
$author = get_user_by( 'slug', get_query_var( 'author_name' ) );
return $author->ID;
if ( $author instanceof WP_User ) {
return $author->ID;
} else {
return $author;
}
} else {
return null;
}
Expand Down
27 changes: 26 additions & 1 deletion includes/simple-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function simpleicons_iw_get_names() {
'500px' => '500px',
'acm' => 'ACM',
'amd' => 'AMD',
'at&t' => 'AT&T',
'atandt' => 'AT&T',
'aboutme' => 'About.me',
'addthis' => 'AddThis',
'adobe' => 'Adobe',
Expand All @@ -23,10 +23,12 @@ function simpleicons_iw_get_names() {
'adobetypekit' => 'Adobe Typekit',
'airbnb' => 'Airbnb',
'amazon' => 'Amazon',
'amazonaws' => 'Amazon AWS',
'americanexpress' => 'American Express',
'android' => 'Android',
'angellist' => 'AngelList',
'angular' => 'Angular',
'appveyor' => 'AppVeyor',
'apple' => 'Apple',
'applemusic' => 'Apple Music',
'applepay' => 'Apple Pay',
Expand All @@ -41,6 +43,7 @@ function simpleicons_iw_get_names() {
'automatic' => 'Automatic',
'autotask' => 'Autotask',
'aventrix' => 'Aventrix',
'azuredevops' => 'Azure DevOps',
'baidu' => 'Baidu',
'bandcamp' => 'Bandcamp',
'basecamp' => 'Basecamp',
Expand Down Expand Up @@ -82,19 +85,22 @@ function simpleicons_iw_get_names() {
'codecov' => 'Codecov',
'codeforces' => 'Codeforces',
'coderwall' => 'Coderwall',
'codeship' => 'Codeship',
'codewars' => 'Codewars',
'codio' => 'Codio',
'coffeescript' => 'CoffeeScript',
'compropago' => 'ComproPago',
'conekta' => 'Conekta',
'coursera' => 'Coursera',
'd3js' => 'D3.js',
'dazn' => 'DAZN',
'dtube' => 'DTube',
'dailymotion' => 'Dailymotion',
'debian' => 'Debian',
'deezer' => 'Deezer',
'delicious' => 'Delicious',
'dell' => 'Dell',
'dependabot' => 'Dependabot',
'designernews' => 'Designer News',
'deviantart' => 'DeviantArt',
'diaspora' => 'Diaspora',
Expand All @@ -112,6 +118,7 @@ function simpleicons_iw_get_names() {
'dropbox' => 'Dropbox',
'drupal' => 'Drupal',
'eslint' => 'ESLint',
'eclipseide' => 'Eclipse IDE',
'elastic' => 'Elastic',
'elasticcloud' => 'Elastic Cloud',
'elasticstack' => 'Elastic Stack',
Expand All @@ -125,6 +132,7 @@ function simpleicons_iw_get_names() {
'eventbrite' => 'Eventbrite',
'evernote' => 'Evernote',
'everplaces' => 'Everplaces',
'expertsexchange' => 'Experts Exchange',
'fsecure' => 'F-Secure',
'facebook' => 'Facebook',
'fandango' => 'Fandango',
Expand All @@ -133,6 +141,7 @@ function simpleicons_iw_get_names() {
'figma' => 'Figma',
'firebase' => 'Firebase',
'fitbit' => 'Fitbit',
'flask' => 'Flask',
'flattr' => 'Flattr',
'flickr' => 'Flickr',
'flipboard' => 'Flipboard',
Expand All @@ -143,6 +152,7 @@ function simpleicons_iw_get_names() {
'furrynetwork' => 'Furry Network',
'gnu' => 'GNU',
'gnusocial' => 'GNU social',
'gogcom' => 'GOG.com',
'govuk' => 'GOV.UK',
'garmin' => 'Garmin',
'gatsby' => 'Gatsby',
Expand Down Expand Up @@ -179,7 +189,9 @@ function simpleicons_iw_get_names() {
'gulp' => 'Gulp',
'gumroad' => 'Gumroad',
'gumtree' => 'Gumtree',
'here' => 'HERE',
'html5' => 'HTML5',
'hackhands' => 'HackHands',
'hackerrank' => 'HackerRank',
'hackster' => 'Hackster',
'haskell' => 'Haskell',
Expand Down Expand Up @@ -214,6 +226,7 @@ function simpleicons_iw_get_names() {
'jenkins' => 'Jenkins',
'jira' => 'Jira',
'joomla' => 'Joomla',
'jupyter' => 'Jupyter',
'justgiving' => 'JustGiving',
'kaggle' => 'Kaggle',
'kaios' => 'KaiOS',
Expand All @@ -229,13 +242,15 @@ function simpleicons_iw_get_names() {
'kofi' => 'Ko-fi',
'koding' => 'Koding',
'kotlin' => 'Kotlin',
'lgtm' => 'LGTM',
'linewebtoon' => 'LINE WEBTOON',
'lanyrd' => 'Lanyrd',
'laravel' => 'Laravel',
'lastfm' => 'Last.fm',
'launchpad' => 'Launchpad',
'leetcode' => 'LeetCode',
'letterboxd' => 'Letterboxd',
'liberapay' => 'Liberapay',
'librarything' => 'LibraryThing',
'line' => 'Line',
'linkedin' => 'LinkedIn',
Expand All @@ -252,6 +267,7 @@ function simpleicons_iw_get_names() {
'makerbot' => 'MakerBot',
'mastercard' => 'MasterCard',
'mastodon' => 'Mastodon',
'matrix' => 'Matrix',
'matternet' => 'Matternet',
'mediatemple' => 'MediaTemple',
'medium' => 'Medium',
Expand All @@ -277,6 +293,7 @@ function simpleicons_iw_get_names() {
'mongodb' => 'MongoDB',
'monkeytie' => 'Monkey tie',
'monogram' => 'Monogram',
'monzo' => 'Monzo',
'moo' => 'Moo',
'mozilla' => 'Mozilla',
'mozillafirefox' => 'Mozilla Firefox',
Expand Down Expand Up @@ -324,6 +341,7 @@ function simpleicons_iw_get_names() {
'plurk' => 'Plurk',
'pocket' => 'Pocket',
'podcasts' => 'Podcasts',
'postgresql' => 'PostgreSQL',
'powershell' => 'PowerShell',
'prismic' => 'Prismic',
'processwire' => 'ProcessWire',
Expand Down Expand Up @@ -355,6 +373,7 @@ function simpleicons_iw_get_names() {
'runkeeper' => 'Runkeeper',
'rust' => 'Rust',
'sap' => 'SAP',
'spdx' => 'SPDX',
'safari' => 'Safari',
'salesforce' => 'Salesforce',
'samsung' => 'Samsung',
Expand All @@ -363,6 +382,7 @@ function simpleicons_iw_get_names() {
'saucelabs' => 'Sauce Labs',
'scala' => 'Scala',
'scribd' => 'Scribd',
'scrutinizerci' => 'Scrutinizer CI',
'sega' => 'Sega',
'sellfy' => 'Sellfy',
'sentry' => 'Sentry',
Expand All @@ -381,10 +401,12 @@ function simpleicons_iw_get_names() {
'slides' => 'Slides',
'smashingmagazine' => 'Smashing Magazine',
'snapchat' => 'Snapchat',
'snyk' => 'Snyk',
'sogou' => 'Sogou',
'songkick' => 'Songkick',
'soundcloud' => 'SoundCloud',
'sourceforge' => 'SourceForge',
'sourcegraph' => 'Sourcegraph',
'sparkfun' => 'SparkFun',
'sparkpost' => 'SparkPost',
'speakerdeck' => 'Speaker Deck',
Expand Down Expand Up @@ -494,15 +516,18 @@ function simpleicons_iw_get_names() {
'yelp' => 'Yelp',
'youtube' => 'YouTube',
'zapier' => 'Zapier',
'zeit' => 'Zeit',
'zendesk' => 'Zendesk',
'zerply' => 'Zerply',
'zillow' => 'Zillow',
'dblp' => 'dblp',
'devto' => 'dev.to',
'devrant' => 'devRant',
'ebay' => 'eBay',
'elementary' => 'elementary',
'freecodecamp' => 'freeCodeCamp',
'homify' => 'homify',
'icloud' => 'iCloud',
'ifixit' => 'iFixit',
'jquery' => 'jQuery',
'rollupjs' => 'rollup.js',
Expand Down
4 changes: 2 additions & 2 deletions indieweb.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Interested in connecting your WordPress site to the IndieWeb?
* Author: IndieWebCamp WordPress Outreach Club
* Author URI: https://indieweb.org/WordPress_Outreach_Club
* Version: 3.3.14
* Version: 3.4.0
* License: MIT
* License URI: http://opensource.org/licenses/MIT
* Text Domain: indieweb
Expand All @@ -26,7 +26,7 @@
*/
class IndieWeb_Plugin {

public static $version = '3.3.14';
public static $version = '3.4.0';

/**
* Initialize the plugin, registering WordPress hooks.
Expand Down

0 comments on commit 6833453

Please sign in to comment.