Update to Wordpress version

This commit is contained in:
ulaulaman 2021-10-13 13:02:25 +02:00
parent a0215dc183
commit af4d254a68
2 changed files with 54 additions and 55 deletions

33
readme.txt Normal file → Executable file
View File

@ -8,29 +8,30 @@ Stable tag: trunk
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html 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 == == 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. [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 using the shordcode [blog-post-coauthors]. 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. 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 == == 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. 1. Make sure that Co-Authors Plus is installed and active.
2. Activate the plugin through the "Plugins" menu in WordPress. 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. Add the widget to your sidebar or the shortcode to your posts or pages. 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 == == Screenshots ==
1. The result of the widget in a multiple authors post (italian language) 1. The result of the widget in a multiple authors post (italian language)
== Changelog == == Changelog ==
0.6 add author's info also in case Co-Authors Plus doesn't installed * 0.6 extended html class also in case Co-Authors Plus is not installed
0.5.3 add the correct lang files * 0.5.3 add the correct lang files
0.5.2 fix error code in domain name in widget * 0.5.2 fix error code in domain name in widget
0.5.1 fix error code in domain name for messages * 0.5.1 fix error code in domain name for messages
0.5 support for translations * 0.5 support for translations
0.4 translation italian messages in english * 0.4 translation italian messages in english
0.3.1 test with wp 4.9.2 * 0.3.1 test with wp 4.9.2
0.3 add profile link and css * 0.3 add profile link and css
0.2 creation of the widget to show authors' avatars * 0.2 creation of the widget to show authors' avatars
0.1 creation of the shortcode to add post's authors * 0.1 creation of the shortcode to add post's authors

16
widget-for-co-authors.php Normal file → Executable file
View File

@ -1,11 +1,11 @@
<?php <?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. 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 Version: 0.6
Author: Gianluigi Filippelli Author: Gianluigi Filippelli
Author URI: http://dropseaofulaula.blogspot.it/ 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 License: GPLv2 or later
*/ */
/* ------------------------------------------------------ */ /* ------------------------------------------------------ */
@ -25,12 +25,11 @@ function blog_post_coauthors() {
# Widget to show authors' avatars # Widget to show authors' avatars
function blog_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' ) ) { if ( function_exists( 'get_coauthors' ) ) {
$coauthors = get_coauthors(); $coauthors = get_coauthors();
$user_posts = get_author_posts_url( $coauthor->ID, $coauthor->user_nicename ); $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; $i = 0;
foreach ( $coauthors as $coauthor ) { foreach ( $coauthors as $coauthor ) {
$i++; $i++;
@ -50,12 +49,12 @@ if ( function_exists( 'get_coauthors' ) ) {
<label for="<?php echo $i; ?>" class="read-more-trigger_opened"> <label for="<?php echo $i; ?>" class="read-more-trigger_opened">
<strong>- <?php printf( $hide_profile ); ?></strong> <strong>- <?php printf( $hide_profile ); ?></strong>
</label> </label>
</div> </div>
<?php <?php
} }
// //
} else { } else {
$i = 0;
?> ?>
<div class="block-item-text"> <div class="block-item-text">
<input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>"> <input type="checkbox" hidden class="read-more-state" id="<?php echo $i; ?>">
@ -72,8 +71,7 @@ if ( function_exists( 'get_coauthors' ) ) {
<label for="<?php echo $i; ?>" class="read-more-trigger_opened"> <label for="<?php echo $i; ?>" class="read-more-trigger_opened">
<strong>- <?php printf( $hide_profile ); ?></strong> <strong>- <?php printf( $hide_profile ); ?></strong>
</label> </label>
</div> </div>
<?php <?php
} }
} }