Skip to content

Commit

Permalink
Merge pull request #55 from NHSLeadership/develop
Browse files Browse the repository at this point in the history
Develop v1.3.5
  • Loading branch information
maheshmuralip authored Apr 11, 2023
2 parents 6b4156c + db6588d commit 3379f44
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 39 deletions.
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "nhsleadership/nightingale-companion",
"version": "1.3.4",
"version": "1.3.5",
"dist": {
"url": "https://github.com/NHSLeadership/nightingale-companion/archive/master.zip",
"type": "zip"
},
"description": "Companion plugin for Nightingale theme",
"type": "wordpress-plugin",
"require": {
"composer/installers": "^1.3"
}
"type": "wordpress-plugin"
}
63 changes: 34 additions & 29 deletions display/social-sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,41 @@

function nightingale_companion_sharing_caring( $content ) {
global $nightingale_companion_options;
$post_type = get_post_type();
$include = array( 'post' );
$output = '';
if ( is_single() && in_array( $post_type, $include ) ):

$output .= '<div class="nhsuk-panel nhsuk-panel--grey"><!-- AddToAny BEGIN -->
<h4 style="float: left;">'.$nightingale_companion_options[ 'sharing_title' ].'&nbsp;&nbsp;</h4><div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_linkedin"></a>
<a class="a2a_button_pinterest"></a>
<a class="a2a_button_whatsapp"></a>
<a class="a2a_button_evernote"></a>
<a class="a2a_button_email"></a>
<a class="a2a_button_copy_link"></a>
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>
<script async src="https://static.addtoany.com/menu/page.js"></script>
<!-- AddToAny END -->
</div>';
endif;
$position = $nightingale_companion_options[ 'sharing_buttons' ];
if ('top' === $position) {
$content = $output.$content;
} else if ('bottom' === $position ) {
$content = $content . $output;
} else if ('both' === $position ) {
$content = $output.$content.$output;
if ( ! empty( $nightingale_companion_options ) ) {
$post_type = get_post_type();
$include = array( 'post' );
$output = '';
if ( is_single() && in_array( $post_type, $include ) ) {
if ( isset( $nightingale_companion_options['sharing_title'] ) ) {
$output .= '<div class="nhsuk-panel nhsuk-panel--grey"><!-- AddToAny BEGIN -->
<h4 style="float: left;">' . $nightingale_companion_options['sharing_title'] . '&nbsp;&nbsp;</h4><div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_linkedin"></a>
<a class="a2a_button_pinterest"></a>
<a class="a2a_button_whatsapp"></a>
<a class="a2a_button_evernote"></a>
<a class="a2a_button_email"></a>
<a class="a2a_button_copy_link"></a>
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>
<!-- AddToAny END -->
</div>';
}
}
$position = isset( $nightingale_companion_options['sharing_buttons'] ) ? $nightingale_companion_options['sharing_buttons'] : null;
if ( 'top' === $position ) {
$content = $output . $content;
} elseif ( 'bottom' === $position ) {
$content = $content . $output;
} elseif ( 'both' === $position ) {
$content = $output . $content . $output;
}
if ( ! empty( $output ) ) {
$content = $content . '<script async src="https://static.addtoany.com/menu/page.js"></script>';
}
return $content;
}
return $content;
}

add_action( 'the_content', 'nightingale_companion_sharing_caring' );
2 changes: 1 addition & 1 deletion nightingale-companion.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License: GPL v3
* Requires at least: 5.0
* Tested up to: 6.0
* Version: 1.3.4
* Version: 1.3.5
*
* @package nightingale-companion
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightingale-companion",
"version": "1.3.4",
"version": "1.3.5",
"license": "GPL-3.0-or-later",
"main": "nightingale-companion.php",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: theme, nightingale, nhs
Plugin Name:: Nightingale Companion
Requires at least: 5.0
Tested up to: 6.0
Stable tag: 1.3.4
Stable tag: 1.3.5
Requires PHP: 5.6
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -68,6 +68,10 @@ with sample content on a site running the Nightingale theme, this plgin and the

== Changelog ==

= 1.3.5 =

-Fix php warning when there is no social sharing configured.

= 1.3.4 =

-Fix issue with previous release process
Expand Down

0 comments on commit 3379f44

Please sign in to comment.