-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
146 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* This template contains the Friends Dashboard Widget Welcome. | ||
* | ||
* @package Friends | ||
*/ | ||
|
||
?> | ||
<p><?php esc_html_e( "In this widget, you'd usually see your latest friends' posts. But since you haven't added any friends yet, these are your options:", 'friends' ); ?></p> | ||
<ul> | ||
<li><a href="<?php echo esc_url( home_url( '/friends/?welcome' ) ); ?>"><span class="ab-icon dashicons dashicons-groups"></span> <?php esc_html_e( 'Check out your Friends page to learn more', 'friends' ); ?></a></li> | ||
<li><a href="<?php echo esc_url( self_admin_url( 'admin.php?page=add-friend' ) ); ?>"><span class="ab-icon dashicons dashicons-businessperson"></span> <?php esc_html_e( 'Add a new friend right away', 'friends' ); ?></a></li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* This template contains the Friends Dashboard Widget. | ||
* | ||
* @package Friends | ||
*/ | ||
|
||
namespace Friends; | ||
|
||
?><ul> | ||
<?php | ||
foreach ( $args['posts'] as $_post ) : | ||
$friend_user = User::get_post_author( $_post ); | ||
$author_name = $args['friend_user']->display_name; | ||
$override_author_name = apply_filters( 'friends_override_author_name', '', $author_name, $_post->ID ); | ||
$avatar = $friend_user->get_avatar_url(); | ||
if ( ! $avatar ) { | ||
$avatar = get_avatar_url( $friend_user->ID ); | ||
} | ||
$avatar = apply_filters( 'friends_author_avatar_url', $avatar, $friend_user, $_post->ID ); | ||
|
||
?> | ||
<li> | ||
<a href="<?php echo esc_attr( $friend_user->get_local_friends_page_url() ); ?>" class="author-avatar"> | ||
<img src="<?php echo esc_url( $avatar ); ?>" width="16" height="16" /> | ||
</a> | ||
<a href="<?php echo esc_url( $friend_user->get_local_friends_page_url() ); ?>"> | ||
<strong><?php echo esc_html( $friend_user->display_name ); ?></strong> | ||
<?php if ( $override_author_name && trim( str_replace( $override_author_name, '', $author_name ) ) === $author_name ) : ?> | ||
– <?php echo esc_html( $override_author_name ); ?> | ||
<?php endif; ?> | ||
</a>: | ||
<a href="<?php echo esc_url( $_post->guid ); ?>"> | ||
<?php | ||
if ( $_post->post_title ) { | ||
echo esc_html( $_post->post_title ); | ||
} else { | ||
echo esc_html( wp_trim_words( get_the_excerpt( $_post ), 18 ) ); | ||
} | ||
?> | ||
</a> | ||
</li> | ||
<?php endforeach; ?> | ||
</ul> | ||
<a href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><?php esc_html_e( 'Go to your friends page for all posts', 'friends' ); ?></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters