mirror of
https://github.com/ulaulaman/widget-for-co-authors.git
synced 2024-12-22 02:55:00 +01:00
Update to Wordpress version
This commit is contained in:
parent
a0215dc183
commit
af4d254a68
33
readme.txt
Normal file → Executable file
33
readme.txt
Normal file → Executable file
@ -8,29 +8,30 @@ Stable tag: trunk
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus, but it is not strictly required.
|
||||
The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus.
|
||||
|
||||
== Description ==
|
||||
[Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs: using it you can add more than one author to your posts and you can define also guest authors without user creation. Despite this, not all themes are able to show all the authors of a post or to show the avatar of the guest author. This plugin add a widget to show users' avatars to post also for guest authors and for posts with multiple authors.
|
||||
You can also add avatars using the shordcode [blog-post-coauthors].
|
||||
[Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/) is one of the most useful plugin for multiple authors blogs. This plugin add a widget to add users' avatars to post also for guest authors and for posts with multiple authors.
|
||||
You can also add avatars with a shordcode [blog-post-coauthors].
|
||||
The plugin add also a slider in order to show user's profile. If you want change the style, you can modify blog-spoiler.css file in the plugin folder.
|
||||
|
||||
== Installation ==
|
||||
1. Extract the widget-for-coauthors.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
|
||||
2. Activate the plugin through the "Plugins" menu in WordPress.
|
||||
3. Add the widget to your sidebar or the shortcode to your posts or pages.
|
||||
1. Make sure that Co-Authors Plus is installed and active.
|
||||
2. Extract the widget-for-coauthors.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
|
||||
3. Activate the plugin through the "Plugins" menu in WordPress.
|
||||
4. Add the widget to your sidebar or the shortcode to your posts or pages.
|
||||
|
||||
== Screenshots ==
|
||||
1. The result of the widget in a multiple authors post (italian language)
|
||||
|
||||
== Changelog ==
|
||||
0.6 add author's info also in case Co-Authors Plus doesn't installed
|
||||
0.5.3 add the correct lang files
|
||||
0.5.2 fix error code in domain name in widget
|
||||
0.5.1 fix error code in domain name for messages
|
||||
0.5 support for translations
|
||||
0.4 translation italian messages in english
|
||||
0.3.1 test with wp 4.9.2
|
||||
0.3 add profile link and css
|
||||
0.2 creation of the widget to show authors' avatars
|
||||
0.1 creation of the shortcode to add post's authors
|
||||
* 0.6 extended html class also in case Co-Authors Plus is not installed
|
||||
* 0.5.3 add the correct lang files
|
||||
* 0.5.2 fix error code in domain name in widget
|
||||
* 0.5.1 fix error code in domain name for messages
|
||||
* 0.5 support for translations
|
||||
* 0.4 translation italian messages in english
|
||||
* 0.3.1 test with wp 4.9.2
|
||||
* 0.3 add profile link and css
|
||||
* 0.2 creation of the widget to show authors' avatars
|
||||
* 0.1 creation of the shortcode to add post's authors
|
||||
|
76
widget-for-co-authors.php
Normal file → Executable file
76
widget-for-co-authors.php
Normal file → Executable file
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Co-Authors Widget Dev
|
||||
Plugin Name: Co-Authors Widget
|
||||
Description: The plugin add a widget and a shortcode in order to show authors of an article. It is compatible with Co-Authors Plus.
|
||||
Version: 0.6
|
||||
Author: Gianluigi Filippelli
|
||||
Author URI: http://dropseaofulaula.blogspot.it/
|
||||
Plugin URI: https://github.com/ulaulaman/widget-for-co-authors
|
||||
Plugin URI: https://ulaulaman.github.io/#CoAuthorsWidget
|
||||
License: GPLv2 or later
|
||||
*/
|
||||
/* ------------------------------------------------------ */
|
||||
@ -25,55 +25,53 @@ function blog_post_coauthors() {
|
||||
|
||||
# Widget to show authors' avatars
|
||||
function blog_avatars() {
|
||||
$show_profile = __( 'Show profile', 'widget-for-co-authors' );
|
||||
$hide_profile = __( 'Hide profile', 'widget-for-co-authors' );
|
||||
if ( function_exists( 'get_coauthors' ) ) {
|
||||
$coauthors = get_coauthors();
|
||||
$user_posts = get_author_posts_url( $coauthor->ID, $coauthor->user_nicename );
|
||||
|
||||
$show_profile = __( 'Show profile', 'widget-for-co-authors' );
|
||||
$hide_profile = __( 'Hide profile', 'widget-for-co-authors' );
|
||||
$i = 0;
|
||||
foreach ( $coauthors as $coauthor ) {
|
||||
$i++;
|
||||
?>
|
||||
<div class="block-item-text">
|
||||
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
|
||||
<div class="read-more-wrap">
|
||||
<p><?php echo coauthors_get_avatar( $coauthor, 65 ); ?>
|
||||
<a href=<?php echo get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); ?>><?php echo $coauthor->display_name; ?></a></p>
|
||||
<p class="read-more-target">
|
||||
<?php echo $coauthor->description; ?>
|
||||
</p>
|
||||
</div>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
|
||||
<strong>+ <?php printf( $show_profile ); ?></strong>
|
||||
</label>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_opened">
|
||||
<strong>- <?php printf( $hide_profile ); ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
<div class="block-item-text">
|
||||
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
|
||||
<div class="read-more-wrap">
|
||||
<p><?php echo coauthors_get_avatar( $coauthor, 65 ); ?>
|
||||
<a href=<?php echo get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); ?>><?php echo $coauthor->display_name; ?></a></p>
|
||||
<p class="read-more-target">
|
||||
<?php echo $coauthor->description; ?>
|
||||
</p>
|
||||
</div>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
|
||||
<strong>+ <?php printf( $show_profile ); ?></strong>
|
||||
</label>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_opened">
|
||||
<strong>- <?php printf( $hide_profile ); ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
//
|
||||
} else {
|
||||
$i = 0;
|
||||
|
||||
?>
|
||||
<div class="block-item-text">
|
||||
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
|
||||
<div class="read-more-wrap">
|
||||
<p><?php echo get_avatar( get_the_author_meta( 'user_email' ), 65 ); ?>
|
||||
<a href=<?php echo get_the_author_meta( 'user_url' ); ?>><?php echo get_the_author_meta( 'display_name' ); ?></a></p>
|
||||
<p class="read-more-target">
|
||||
<?php echo get_the_author_meta( 'description' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
|
||||
<strong>+ <?php printf( $show_profile ); ?></strong>
|
||||
</label>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_opened">
|
||||
<strong>- <?php printf( $hide_profile ); ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="block-item-text">
|
||||
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
|
||||
<div class="read-more-wrap">
|
||||
<p><?php echo get_avatar( get_the_author_meta( 'user_email' ), 65 ); ?>
|
||||
<a href=<?php echo get_the_author_meta( 'user_url' ); ?>><?php echo get_the_author_meta( 'display_name' ); ?></a></p>
|
||||
<p class="read-more-target">
|
||||
<?php echo get_the_author_meta( 'description' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_closed">
|
||||
<strong>+ <?php printf( $show_profile ); ?></strong>
|
||||
</label>
|
||||
<label for="<?php echo $i; ?>" class="read-more-trigger_opened">
|
||||
<strong>- <?php printf( $hide_profile ); ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user