Continues the Bookshelf history. The three plugins tracked there are consolidated into umbra-bookshelf/ and this repository becomes the canonical home for the plugin and the theme. bd-bookshelf/ -> theme/ separate artifact, name unchanged (root specs) -> umbra-bookshelf/spec/ aligned to Umbra Bookshelf old plugin zips -> archive/pre-umbra-releases/ Adds a repository README and drops the Bookshelf closure notice.
74 lines
5.7 KiB
PHP
74 lines
5.7 KiB
PHP
<?php
|
|
// Copyright 2026 Umbra Tools (umbratools.com)
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/**
|
|
* Social Share Template Part
|
|
*
|
|
* @package BD_Murphy
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
$share_url = isset($short_url) ? $short_url : get_permalink();
|
|
$share_title = get_the_title();
|
|
|
|
$show_facebook = get_theme_mod('share_facebook', true);
|
|
$show_twitter = get_theme_mod('share_twitter', true);
|
|
$show_linkedin = get_theme_mod('share_linkedin', true);
|
|
$show_whatsapp = get_theme_mod('share_whatsapp', true);
|
|
?>
|
|
|
|
<div class="social-share-buttons" role="group" aria-label="<?php esc_attr_e('Share this', 'bd-bookshelf'); ?>">
|
|
<span class="share-label"><?php esc_html_e('Share:', 'bd-bookshelf'); ?></span>
|
|
|
|
<?php if ($show_facebook) : ?>
|
|
<a href="<?php echo esc_url('https://www.facebook.com/sharer/sharer.php?u=' . urlencode($share_url)); ?>"
|
|
class="share-btn share-facebook"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
aria-label="<?php esc_attr_e('Share on Facebook', 'bd-bookshelf'); ?>">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($show_twitter) : ?>
|
|
<a href="<?php echo esc_url('https://twitter.com/intent/tweet?url=' . urlencode($share_url) . '&text=' . urlencode($share_title)); ?>"
|
|
class="share-btn share-twitter"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
aria-label="<?php esc_attr_e('Share on X/Twitter', 'bd-bookshelf'); ?>">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($show_linkedin) : ?>
|
|
<a href="<?php echo esc_url('https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode($share_url) . '&title=' . urlencode($share_title)); ?>"
|
|
class="share-btn share-linkedin"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
aria-label="<?php esc_attr_e('Share on LinkedIn', 'bd-bookshelf'); ?>">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.678 2.678 0 01-2.643-2.68 2.68 2.68 0 112.68 2.68zm1.5 13.019H3.823V9h2.014v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($show_whatsapp) : ?>
|
|
<a href="<?php echo esc_url('https://wa.me/?text=' . urlencode($share_title . ' ' . $share_url)); ?>"
|
|
class="share-btn share-whatsapp"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
aria-label="<?php esc_attr_e('Share on WhatsApp', 'bd-bookshelf'); ?>">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.119-1.473-.425-.517-.71-.954-.793-1.115-.082-.161.008-.33.103-.435.098-.098.218-.253.335-.382.113-.125.201-.227.297-.378.098-.151.174-.252.248-.252.071 0 .177-.035.37-.164.196-.129.325-.29.44-.469.119-.18.21-.378.297-.567.088-.188.176-.387.251-.579.078-.193.04-.356-.018-.498-.058-.147-.267-.352-.535-.537-.256-.177-.456-.313-.655-.499-.197-.185-.37-.409-.52-.634-.15-.227-.126-.419-.035-.652.092-.231.419-.493.576-.663.152-.166.31-.347.44-.534.133-.187.22-.31.298-.388.076-.076.14-.127.2-.17.058-.042.11-.066.165-.079.052-.013.108-.01.165-.003.057.008.117.035.204.088.086.052.147.139.201.238.054.098.108.209.156.323.049.114.088.198.132.264.044.065.078.105.117.138.039.033.085.05.14.06l.163.03c.102.012.203-.009.328-.077.124-.067.247-.185.366-.32.117-.136.225-.307.307-.493.081-.186.125-.339.159-.46.034-.12.038-.21.03-.27-.007-.06-.032-.098-.06-.124-.026-.027-.059-.046-.083-.062-.024-.016-.042-.031-.059-.043-.015-.012-.026-.018-.036-.021-.01-.002-.015-.003-.021-.001zM12 0C5.373 0 0 5.373 0 12c0 2.108.554 4.074 1.511 5.78L.789 23.172l5.463-1.433c1.596.88 3.432 1.379 5.348 1.379 6.627 0 12-5.373 12-12S18.627 0 12 0zm5.073 11.225c-.051.14-.373.648-.818.915.476.259.918.416 1.226.473.305.057.646.068.951.017.309-.051.508-.094.704-.165.195-.072.416-.36.565-.617.146-.258.216-.48.243-.635.026-.156.024-.356-.102-.734-.125-.379-.261-.523-.395-.623-.134-.1-.278-.14-.405-.092-.127.049-.545.255-.988.856-.444.601-.741 1.34-.82 1.56-.08.222-.03.338.063.446.094.108.214.275.314.413.097.139.197.296.271.414.072.118.12.221.163.303.042.082.073.123.092.153.019.03.026.049.034.067.008.018.01.035-.002.058-.013.023-.04.095-.107.193z"/></svg>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<button class="share-btn share-copy"
|
|
data-url="<?php echo esc_url($share_url); ?>"
|
|
type="button"
|
|
aria-label="<?php esc_attr_e('Copy link', 'bd-bookshelf'); ?>">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>
|
|
</button>
|
|
</div>
|