Skip to content

Commit

Permalink
Custom replacement for ShareDaddy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipstenu committed Feb 5, 2025
1 parent f3f0c3c commit 9925eae
Show file tree
Hide file tree
Showing 16 changed files with 822 additions and 26 deletions.
12 changes: 6 additions & 6 deletions composer.lock

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

2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Versioning for efficient developers.
if ( ! defined( 'LWTV_THEME_VERSION' ) ) {
$versions = array(
'lwtv-underscores' => '6.2.8', // Bump this any time you make serious CSS changes.
'lwtv-underscores' => '6.3.0', // Bump this any time you make serious CSS changes.
'font-awesome' => '6.7.2', // Bump when you update Font Awesome.
'bootstrap' => '5.3.3', // Bump when you update bootstrap.
'bootstrap_dark' => '1.1.0', // Bump when you update the dark mode.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwtv-underscores",
"version": "6.2.8",
"version": "6.3.0",
"description": "LezWatch.TV Custom Theme.",
"main": "index.js",
"workspaces": [
Expand Down
49 changes: 42 additions & 7 deletions plugins/lwtv-plugin/php/_components/class-plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,60 @@ public function init(): void {
*/
public function get_template_tags(): array {
return array(
'jetpack_post_meta' => array( $this, 'jetpack_post_meta' ),
'post_meta_sharing' => array( $this, 'post_meta_sharing' ),
);
}

/**
* Get Jetpack Post Meta
* Create post meta sharing
*
* @param int $post_id
* @param string $meta_key
* @return mixed
*/
public function jetpack_post_meta() {
public function post_meta_sharing( $post_id = 0 ) {
if ( function_exists( 'sharing_display' ) ) {
sharing_display( '', true );
}

if ( class_exists( 'Jetpack_Likes' ) ) {
$custom_likes = new \Jetpack_Likes();
$post_meta = $custom_likes->post_likes( '' );
if ( 0 === $post_id ) {
return;
}

$title = get_the_title( $post_id );
$post_url = get_permalink( $post_id );

?>
<div class="lwtvshare lwtv-sharing-enabled">
<div class="robots-nocontent sd-block sd-social lwtv-social-icon lwtv-sharing">
<h3 class="lwtv-share-title">Share this:</h3>
<div class="lwtv-share-content">
<ul data-sharing-events-added="true">
<li class="share-bluesky">
<a rel="nofollow noopener noreferrer" data-shared="sharing-bluesky-<?php echo esc_attr( $post_id ); ?>" class="share-bluesky lwtv-share-button share-icon no-text" href="https://bsky.app/intent/compose?text=<?php echo esc_url( $post_url ); ?>&text=<?php echo esc_attr( the_title() ); ?>" target="_blank" title="Click to share on Bluesky" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on Bluesky (Opens in new window)</span></a>
</li>
<li class="share-tumblr">
<a rel="nofollow noopener noreferrer" data-shared="sharing-tumblr-<?php echo esc_attr( $post_id ); ?>" class="share-tumblr lwtv-share-button share-icon no-text" href="http://www.tumblr.com/share/link?url=<?php echo rawurlencode( $post_url ); ?>" target="_blank" title="Click to share on Tumblr" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on Tumblr (Opens in new window)</span></a>
</li>
<li class="share-facebook">
<a rel="nofollow noopener noreferrer" data-shared="sharing-facebook-<?php echo esc_attr( $post_id ); ?>" class="share-facebook lwtv-share-button share-icon no-text" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo esc_url( $post_url ); ?>" target="_blank" title="Click to share on Facebook" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on Facebook (Opens in new window)</span></a>
</li>
<li class="share-mastodon">
<a rel="nofollow noopener noreferrer" data-shared="sharing-mastodon-<?php echo esc_attr( $post_id ); ?>" class="share-mastodon lwtv-share-button share-icon no-text" href="https://mastodonshare.com/share?text=<?php echo esc_attr( $title ) . rawurlencode( $post_url ); ?>" target="_blank" title="Click to share on Mastodon" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on Mastodon (Opens in new window)</span></a>
</li>
<li class="share-reddit">
<a rel="nofollow noopener noreferrer" data-shared="sharing-reddit-<?php echo esc_attr( $post_id ); ?>" class="share-reddit lwtv-share-button share-icon no-text" href="http://www.reddit.com/submit?url=<?php echo esc_url( $post_url ); ?>&title=<?php echo esc_attr( $title ); ?>" target="_blank" title="Click to share on Reddit" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on Reddit (Opens in new window)</span></a>
</li>
<li class="share-x">
<a rel="nofollow noopener noreferrer" data-shared="sharing-x-<?php echo esc_attr( $post_id ); ?>" class="share-x lwtv-share-button share-icon no-text" href="<?php echo esc_url( $post_url ); ?>&text=<?php echo esc_attr( the_title() ); ?>&via=lezwatchtv" target="_blank" title="Click to share on X/Twitter" onclick="window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=468,width=768');return false;"><span></span><span class="sharing-screen-reader-text">Click to share on X/Twitter (Opens in new window)</span></a>
</li>
<li class="share-email">
<a rel="nofollow noopener noreferrer" data-shared="sharing-email-<?php echo esc_attr( $post_id ); ?>" class="share-email lwtv-share-button share-icon no-text" href="mailto:?subject=%5BShared%20Post%5D%20New%20Feature%3A%20Calendar%20Views&amp;body=https%3A%2F%2Flezwatchtv.com%2F2024%2Fnew-feature-calendar-views%2F&amp;share=email&amp;nb=1" target="_blank" title="Click to email a link to a friend" data-email-share-error-title="Do you have email set up?" data-email-share-error-text="If you're having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself." data-email-share-nonce="bf74ce8659" data-email-share-track-url="https://lezwatchtv.com/2024/new-feature-calendar-views/?share=email" jetpack-share-click-count="0"><span></span><span class="sharing-screen-reader-text">Click to email a link to a friend (Opens in new window)</span></a>
</li>
<li class="share-end"></li>
</ul>
</div>
</div>
</div>
<?php
}
}
2 changes: 1 addition & 1 deletion plugins/lwtv-plugin/php/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @method string get_rss_otd_feed() \_Components\Of_The_Day
*
* PLUGINS
* @method array jetpack_post_meta() \_Components\Plugins
* @method array post_meta_sharing() \_Components\Plugins
*
* QUEERY / LOOPS
* @method bool is_actor_queer( $the_id ) \_Components\Queeries
Expand Down
2 changes: 1 addition & 1 deletion rss-otd.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<sy:updateFrequency><?php echo esc_html( apply_filters( 'rss_update_frequency', '1' ) ); ?></sy:updateFrequency>
<generator>https://wordpress.org/?v=<?php echo floatval( lwtv_plugin()->get_wp_version() ); ?></generator>
<image>
<url><?php echo esc_url( get_option( 'jetpack_site_icon_url' ) ); ?></url>
<url><?php echo esc_url( get_site_icon_url( 32, includes_url( 'images/w-logo-blue-white-bg.png' ) ) ); ?></url>
<title>LezWatch.TV Of The Day - Feed</title>
<link><?php echo esc_url( get_site_url() ); ?>/feed/otd/</link>
<width>32</width>
Expand Down
2 changes: 1 addition & 1 deletion scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://lezwatchtv.com/
Author: Tracy Levesque, Mika Epstein
Author URI: https://lezwatchtv.com/
Description: LezWatch.TV Theme Episode III - Return of the Custom Theme
Version: 6.2.8
Version: 6.3.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yikes_starter
Expand Down
2 changes: 1 addition & 1 deletion scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ h1.entry-title {
margin-top: 1rem;
}

.sharedaddy.sd-sharing-enabled {
.lwtvshare.lwtv-sharing-enabled {
padding: 1.25em;
}

Expand Down
Loading

0 comments on commit 9925eae

Please sign in to comment.