Skip to content

Commit 5b789b2

Browse files
authored
Merge pull request #129 from dshanske/closingdiv
Add template and bump version
2 parents b8401d9 + a12b92a commit 5b789b2

File tree

7 files changed

+69
-50
lines changed

7 files changed

+69
-50
lines changed

includes/class-hcard-user.php

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public static function get_rel_me( $author_id = null ) {
399399
* returns a formatted <ul> list of rel=me to supported silos
400400
*/
401401
public static function rel_me_list( $author_id = null, $include_rel = false ) {
402-
echo self::get_rel_me_list( $author_id, $include_rel );
402+
echo self::get_rel_me_list( $author_id, $include_rel ); // phpcs:ignore
403403
}
404404

405405
/**
@@ -520,46 +520,10 @@ public static function hcard( $user, $args = array() ) {
520520
$url = $user->has_prop( 'user_url' ) ? $user->get( 'user_url' ) : $url = get_author_posts_url( $user->ID );
521521
$name = $user->get( 'display_name' );
522522
$email = $user->get( 'user_email' );
523-
524-
$return = '<div class="hcard-display h-card vcard p-author">';
525-
$return .= '<div class="hcard-header">';
526-
$return .= '<a class="u-url url fn u-uid" href="' . $url . '" rel="author">';
527-
if ( ! $avatar ) {
528-
$return .= '<p class="hcard-name p-name n">' . $name . '</p></a>';
529-
} else {
530-
$return .= $avatar . '</a>';
531-
$return .= '<p class="hcard-name p-name n">' . $name . '</p>';
532-
}
533-
if ( $args['email'] ) {
534-
$return .= '<p class="u-email"><a rel="me" href="mailto:' . $email . '">' . $email . '</a></p>';
535-
}
536-
$return .= '</div>';
537-
$return .= '<div class="hcard-body">';
538-
$return .= '<ul class="hcard-properties">';
539-
if ( $args['location'] && ( $user->has_prop( 'locality' ) || $user->has_prop( 'region' ) || $user->has_prop( 'country-name' ) ) ) {
540-
$return .= '<li class="h-adr adr">';
541-
if ( $user->has_prop( 'locality' ) ) {
542-
$return .= '<span class="p-locality locality">' . $user->get( 'locality' ) . '</span>, ';
543-
}
544-
if ( $user->has_prop( 'region' ) ) {
545-
$return .= '<span class="p-region region">' . $user->get( 'region' ) . '</span> ';
546-
}
547-
if ( $user->has_prop( 'country-name' ) ) {
548-
$return .= '<span class="p-country-name country-name">' . $user->get( 'country-name' ) . '</span>';
549-
}
550-
$return .= '</li>';
551-
}
552-
if ( $user->has_prop( 'tel' ) && $user->get( 'tel' ) ) {
553-
$return .= '<li><a class="p-tel tel" href="tel:' . $user->get( 'tel' ) . '">' . $user->get( 'tel' ) . '</a></li>';
554-
}
555-
$return .= '</ul>';
556-
if ( $args['me'] ) {
557-
$return .= '<p>' . self::get_rel_me_list( $user->ID ) . '</p>';
558-
}
559-
if ( $args['notes'] ) {
560-
$return .= '<p class="p-note note">' . $user->get( 'description' ) . '</p>';
561-
}
562-
$return .= '</div>';
523+
ob_start();
524+
include dirname( __FILE__ ) . '/../templates/h-card.php';
525+
$return = ob_get_contents();
526+
ob_end_clean();
563527
return $return;
564528
}
565529
}

indieweb.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Interested in connecting your WordPress site to the IndieWeb?
66
* Author: IndieWebCamp WordPress Outreach Club
77
* Author URI: https://indieweb.org/WordPress_Outreach_Club
8-
* Version: 3.3.13
8+
* Version: 3.3.14
99
* License: MIT
1010
* License URI: http://opensource.org/licenses/MIT
1111
* Text Domain: indieweb
@@ -26,7 +26,7 @@
2626
*/
2727
class IndieWeb_Plugin {
2828

29-
public static $version = '3.3.13';
29+
public static $version = '3.3.14';
3030

3131
/**
3232
* Initialize the plugin, registering WordPress hooks.

languages/wordpress-indieweb.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the MIT.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: IndieWeb 3.3.13\n"
5+
"Project-Id-Version: IndieWeb 3.3.14\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb\n"
7-
"POT-Creation-Date: 2018-12-04 00:54:25+00:00\n"
7+
"POT-Creation-Date: 2018-12-08 01:54:44+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"

phpcs.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<description>WordPress Indieweb Standards</description>
44
<file>./indieweb.php</file>
55
<file>./includes/</file>
6-
<config name="minimum_supported_wp_version" value="4.7"/>
6+
<config name="minimum_supported_wp_version" value="4.8"/>
77
<exclude-pattern>*/includes/*\.(inc|css|js|svg)</exclude-pattern>
88
<exclude-pattern>*/includes/getting-started.php</exclude-pattern>
9+
<exclude-pattern>*/includes/class-connekt-plugin-installer.php</exclude-pattern>
910
<exclude-pattern>*/vendor/*</exclude-pattern>
1011
<rule ref="PHPCompatibility"/>
1112
<config name="testVersion" value="5.3-"/>

readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
**Tags:** indieweb, webmention, POSSE, indieauth
55
**Requires at least:** 4.7
66
**Requires PHP:** 5.3
7-
**Tested up to:** 4.9.8
8-
**Stable tag:** 3.3.13
7+
**Tested up to:** 5.0
8+
**Stable tag:** 3.3.14
99
**License:** MIT
1010
**License URI:** http://opensource.org/licenses/MIT
1111

@@ -82,6 +82,10 @@ One could certainly download, install, and activate some or all of these plugins
8282

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

85+
### 3.3.14 ###
86+
* Fixed issue with missing closing tag on h-card widget
87+
* Turned h-card widget into an HTML template to allow for easier customization
88+
8589
### 3.3.13 ###
8690
* Typo causing rel-me error. Sorry folks.
8791

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Donate link: https://indieweb.org/how-to-sponsor
44
Tags: indieweb, webmention, POSSE, indieauth
55
Requires at least: 4.7
66
Requires PHP: 5.3
7-
Tested up to: 4.9.8
8-
Stable tag: 3.3.13
7+
Tested up to: 5.0
8+
Stable tag: 3.3.14
99
License: MIT
1010
License URI: http://opensource.org/licenses/MIT
1111

@@ -82,6 +82,10 @@ One could certainly download, install, and activate some or all of these plugins
8282

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

85+
= 3.3.14 =
86+
* Fixed issue with missing closing tag on h-card widget
87+
* Turned h-card widget into an HTML template to allow for easier customization
88+
8589
= 3.3.13 =
8690
* Typo causing rel-me error. Sorry folks.
8791

templates/h-card.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<div class="hcard-display h-card vcard p-author">
2+
<div class="hcard-header">
3+
<?php if ( ! $avatar ) { ?>
4+
<a class="u-url url fn u-uid" href="<?php echo esc_url( $url ); ?>" rel="author">
5+
<p class="hcard-name p-name n"><?php echo $name; ?></p>
6+
</a>
7+
<?php } else { ?>
8+
<a class="u-url url fn u-uid" href="<?php echo esc_url( $url ); ?>" rel="author"><?php echo $avatar; ?></a>
9+
<p class="hcard-name p-name n"><?php echo $name; ?></p>
10+
<?php }
11+
if ( $args['email'] ) { ?>
12+
<p class="u-email">
13+
<a rel="me" href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a>
14+
</p>
15+
<?php } ?>
16+
</div> <!-- end hcard-header -->
17+
<div class="hcard-body">
18+
<ul class="hcard-properties">
19+
<?php if ( $args['location'] && ( $user->has_prop( 'locality' ) || $user->has_prop( 'region' ) || $user->has_prop( 'country-name' ) ) ) { ?>
20+
<li class="h-adr adr">
21+
<?php if ( $user->has_prop( 'locality' ) ) { ?>
22+
<span class="p-locality locality"><?php echo $user->get( 'locality' ); ?></span>
23+
<?php }
24+
if ( $user->has_prop( 'region' ) ) { ?>
25+
<span class="p-region region"><?php echo $user->get( 'region' ); ?></span>
26+
<?php }
27+
if ( $user->has_prop( 'country-name' ) ) { ?>
28+
<span class="p-country-name country-name"><?php echo $user->get( 'country-name' ); ?></span>
29+
<?php } ?>
30+
</li>
31+
<?php }
32+
if ( $user->has_prop( 'tel' ) && $user->get( 'tel' ) ) { ?>
33+
<li>
34+
<a class="p-tel tel" href="tel:<?php echo $user->get( 'tel' ); ?>"><?php echo $user->get( 'tel' ); ?></a>
35+
</li>
36+
<?php } ?>
37+
</ul> <!-- end hcard-properties -->
38+
<?php if ( $args['me'] ) { ?>
39+
<?php self::rel_me_list( $user->ID, is_front_page() ); ?>
40+
<?php }
41+
if ( $args['notes'] && $user->has_prop( 'description' ) ) { ?>
42+
<p class="p-note note"><?php echo $user->get( 'description' ); ?></p>
43+
<?php } ?>
44+
</div> <!-- end hcard-body -->
45+
</div><!-- end hcard-display -->
46+
<?php

0 commit comments

Comments
 (0)