Skip to content

Commit

Permalink
Merge pull request #115 from dshanske/aug2fixes
Browse files Browse the repository at this point in the history
Additional Fixes
  • Loading branch information
pfefferle committed Aug 6, 2018
2 parents 7c18b6a + d2a7240 commit 534c09e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
7 changes: 6 additions & 1 deletion includes/class-hcard-author-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function form( $instance ) {
'location' => 1,
'notes' => 1,
'avatar_size' => '125',
'reveal_email' => '',
'email' => 0,
);

$instance = wp_parse_args( (array) $instance, $defaults );
Expand All @@ -126,6 +126,11 @@ public function form( $instance ) {
<label for="<?php echo esc_attr( $this->get_field_id( 'notes' ) ); ?>"><?php esc_html_e( 'Show Notes:', 'indieweb' ); ?></label>
<input type="hidden" name="<?php echo esc_attr( $this->get_field_name( 'notes' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'notes' ) ); ?>" value="0" />
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'notes' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'notes' ) ); ?>" value="1" <?php checked( $instance['notes'], 1 ); ?> />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'email' ) ); ?>"><?php esc_html_e( 'Show Email:', 'indieweb' ); ?></label>
<input type="hidden" name="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'email' ) ); ?>" value="0" />
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'email' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'email' ) ); ?>" value="1" <?php checked( $instance['email'], 1 ); ?> />
</p>
<?php
}
Expand Down
13 changes: 9 additions & 4 deletions includes/class-hcard-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ public static function url_to_name( $url ) {
if ( false !== stripos( $url, 'lanyard' ) ) {
return 'lanyrd';
}

if ( false !== stripos( $url, 'micro.blog' ) ) {
return 'micro-dot-blog';
}
// Anything with WordPress in the name that is not matched return WordPress
if ( false !== stripos( $domain, 'WordPress' ) ) {
return 'WordPress';
Expand Down Expand Up @@ -481,6 +485,7 @@ public static function get_hcard_display_defaults() {
'avatar' => true, // Display Avatar
'location' => true, // Display location elements
'notes' => true, // Display Bio/Notes
'email' => false, // Display email
);
return apply_filters( 'hcard_display_defaults', $defaults );
}
Expand Down Expand Up @@ -508,9 +513,9 @@ public static function hcard( $user, $args = array() ) {
} else {
$avatar = '';
}
$url = $user->has_prop( 'user_url' ) ? $user->get( 'user_url' ) : $url = get_author_posts_url( $user->ID );
$name = $user->get( 'display_name' );
$email = $user->get( 'user_email' );
$url = $user->has_prop( 'user_url' ) ? $user->get( 'user_url' ) : $url = get_author_posts_url( $user->ID );
$name = $user->get( 'display_name' );
$email = $user->get( 'user_email' );

$return = '<div class="hcard-display h-card vcard p-author">';
$return .= '<div class="hcard-header">';
Expand All @@ -521,7 +526,7 @@ public static function hcard( $user, $args = array() ) {
$return .= $avatar . '</a>';
$return .= '<p class="hcard-name p-name n">' . $name . '</p>';
}
if ( 'on' === $r['reveal_email'] ) {
if ( $args['email'] ) {
$return .= '<p class="u-email"><a rel="me" href="mailto:' . $email . '">' . $email . '</a></p>';
}
$return .= '</div>';
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.9
* Version: 3.3.10
* 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.9';
public static $version = '3.3.10';

/**
* Initialize the plugin, registering WordPress hooks.
Expand Down
16 changes: 10 additions & 6 deletions languages/wordpress-indieweb.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: IndieWeb 3.3.9\n"
"Project-Id-Version: IndieWeb 3.3.10\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb\n"
"POT-Creation-Date: 2018-08-05 14:12:26+00:00\n"
"POT-Creation-Date: 2018-08-06 04:18:29+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -127,22 +127,26 @@ msgstr ""
msgid "A widget that allows you to display author profile marked up as an h-card"
msgstr ""

#: includes/class-hcard-author-widget.php:107
#: includes/class-hcard-author-widget.php:112
msgid "Avatar Size:"
msgstr ""

#: includes/class-hcard-author-widget.php:111
#: includes/class-hcard-author-widget.php:116
msgid "Show Avatar:"
msgstr ""

#: includes/class-hcard-author-widget.php:116
#: includes/class-hcard-author-widget.php:121
msgid "Show Location:"
msgstr ""

#: includes/class-hcard-author-widget.php:121
#: includes/class-hcard-author-widget.php:126
msgid "Show Notes:"
msgstr ""

#: includes/class-hcard-author-widget.php:131
msgid "Show Email:"
msgstr ""

#: includes/class-hcard-user.php:55
msgid "Github username"
msgstr ""
Expand Down
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**Requires at least:** 4.7
**Requires PHP:** 5.3
**Tested up to:** 4.9.8
**Stable tag:** 3.3.9
**Stable tag:** 3.3.10
**License:** MIT
**License URI:** http://opensource.org/licenses/MIT

Expand Down Expand Up @@ -83,6 +83,11 @@ One could certainly download, install, and activate some or all of these plugins

Project maintained on github at [indieweb/wordpress-indieweb](https://github.com/indieweb/wordpress-indieweb).

### 3.3.10 ###
* Fix email property not being used and hook it to setting
* Fix micro.blog icon
* Fix PHP notice

### 3.3.9 ###
* Update dependencies
* Change text on widgets to be more descriptive
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: indieweb, webmention, POSSE, indieauth
Requires at least: 4.7
Requires PHP: 5.3
Tested up to: 4.9.8
Stable tag: 3.3.9
Stable tag: 3.3.10
License: MIT
License URI: http://opensource.org/licenses/MIT

Expand Down Expand Up @@ -83,6 +83,11 @@ One could certainly download, install, and activate some or all of these plugins

Project maintained on github at [indieweb/wordpress-indieweb](https://github.com/indieweb/wordpress-indieweb).

= 3.3.10 =
* Fix email property not being used and hook it to setting
* Fix micro.blog icon
* Fix PHP notice

= 3.3.9 =
* Update dependencies
* Change text on widgets to be more descriptive
Expand Down

0 comments on commit 534c09e

Please sign in to comment.