WidgetCoreWidgetCore Documentation

Share Widget

Full guide to the WidgetCore Share widget: Iranian and global networks, custom share URL patterns with {url}/{title} placeholders, a copy-link button with aria-live feedback, shapes and Normal/Hover colors.

The Share widget builds the share buttons of the current page server-side from the permalink (get_permalink) and the title (get_the_title), so the links work with JavaScript disabled. Iranian and global networks are built in, and any other network is added with a custom URL pattern. The only script the widget has powers the copy-link button, and it loads solely on pages that use the widget.

ItemValue
Widget IDwgcr-share
Panel titleShare
CategoryWidgetCore widgets (wgcr)
Style / scriptwgcr-share / wgcr-share
Root class.wgcr-share

"Networks" section

The Share networks (networks) control is a repeater; pick the Network (net) in each row:

NetworkIDShare URL pattern
Telegramtelegramhttps://t.me/share/url?url={url}&text={title}
WhatsAppwhatsapphttps://api.whatsapp.com/send?text={title}%20{url}
Eitaaeitaahttps://eitaa.com/share/url?url={url}&text={title}
X (Twitter)xhttps://twitter.com/intent/tweet?url={url}&text={title}
Facebookfacebookhttps://www.facebook.com/sharer/sharer.php?u={url}
LinkedInlinkedinhttps://www.linkedin.com/sharing/share-offsite/?url={url}
Emailemailmailto:?subject={title}&body={url}
Copy linkcopyA clipboard button (not a link)
CustomcustomYour own pattern with {url} and {title} placeholders

{url} is replaced with the current page URL and {title} with its title (both percent-encoded).

Custom networks (Bale, Rubika, Soroush and anything else)

Iranian messengers other than Eitaa do not publish a documented web share endpoint; for any service that does offer one, add a Custom row and fill its three fields:

FieldIDNotes
Custom network labelcustom_labelThe button's name (e.g. "Bale"); an empty field prints "Custom network"
Share URL patterncustom_urlFor example https://example.test/share?url={url}&text={title}; a row without a pattern is skipped. The field also offers Elementor dynamic tags
Custom network iconcustom_iconShare / link / globe / envelope / phone

The rest of the section

ControlIDTypeDefaultNotes
Show the network name next to the iconshow_labelswitcherOffWhile off, the label stays in the DOM as hidden for screen readers and the copy feedback
Heading above the buttonsheadingtextEmptyFor example "Share this post:"
Copy button labelcopy_labeltext"Copy link" (translated)—
Label after copyingcopied_labeltext"Copied!" (translated)Temporary feedback on the button with aria-live="polite"
Open linkstargetselectNew tabtarget="_blank" with rel="noopener noreferrer"; email always opens in the same tab

The copy button uses the modern Clipboard API first and falls back to the legacy method (textarea + execCommand). After copying, the button label switches to "Copied!" for a moment — even when labels are hidden — and because it is aria-live="polite", screen readers announce it too.

HTML output

html
<div class="wgcr-share" data-shape="rounded">
  <p class="wgcr-share-heading">Share this post:</p>
  <ul class="wgcr-share-list">
    <li>
      <a class="wgcr-share-link" href="https://t.me/share/url?url=…&text=…" target="_blank" rel="noopener noreferrer">
        <span class="wgcr-share-ic">…svg…</span>
        <span class="wgcr-share-text" hidden>Telegram</span>
      </a>
    </li>
    <li>
      <button type="button" class="wgcr-share-link wgcr-share-copy" data-copy="https://…" data-copied="Copied!">
        <span class="wgcr-share-ic">…svg…</span>
        <span class="wgcr-share-text" aria-live="polite" hidden>Copy link</span>
      </button>
    </li>
  </ul>
</div>

If no valid row remains, the widget prints nothing. The icons are inline SVGs from the plugin's shared library (dedicated glyphs for X, Facebook, LinkedIn, Telegram, WhatsApp and Eitaa, generic icons for the rest).

Style sections

  • Buttons: "Button shape" (rounded / circle / square), "Layout", "Space between buttons", "Icon size", "Button padding" and the color controls "Button background" / "Icon and text color" in the Normal tab and "Background on hover" / "Color on hover" in the Hover tab.
  • Title and Text: "Title color" for the heading and its typography, "Network names color" and "Network names color on hover".

All colors run through the widget's CSS variables; that is why hover always applies even when Normal-state colors are set.

Custom style example

css
/* Outline buttons that fill on hover */
.wgcr-share .wgcr-share-link { box-shadow: inset 0 0 0 2px currentColor; background: transparent; }