| Property | Value |
|---|---|
| Name | prc-block/social-share-text-link |
| Title | Social Share Text Link |
| Category | widgets |
| Version | 1.0.0 |
| Description | Add a text link to a social share group. |
| Feature | Enabled |
|---|---|
| HTML editing | No |
| Anchor | Yes |
| Alignment | No |
| Spacing | blockGap, margin (top/bottom), padding |
| Typography | fontSize, fontFamily |
| Attribute | Type | Default | Description |
|---|---|---|---|
label |
string |
(none) | The visible text of the link. |
opensInNewTab |
boolean |
false |
Whether the link opens in a new browser tab. |
url |
string |
(none) | The URL the link points to. |
| Context Key | Description |
|---|---|
openInNewTab |
Whether links open in a new tab. |
showLabels |
Whether to show labels on social links. |
iconColor |
Color slug for the icon/text color. |
iconColorValue |
Hex color value for the icon/text. |
iconBackgroundColor |
Color slug for the background. |
iconBackgroundColorValue |
Hex color value for the background. |
None defined.
This block does not accept inner blocks.
Required parent: core/social-links
This block must be placed inside a Social Links block.
- Insert a Social Links (
core/social-links) block. - Add the Social Share Text Link block as a child.
- Type the link text directly in the block using the inline RichText editor (supports bold formatting).
- Use
Cmd+K(Mac) orCtrl+K(Windows) or the link toolbar button to set the URL. - The link will inherit icon color and background color from the parent Social Links block.
- If no label is set, the block will not render on the frontend.
From block.json:
{
"attributes": {
"label": "Read more..."
}
}<a class="wp-block-prc-block-social-share-text-link has-white-color"
href="https://example.com/article"
rel="nofollow"
target="_blank">
Read more...
</a>The block is server-side rendered via Social_Share_Text_Link::render_callback():
- Returns empty string if no
labelis set or if the block object is invalid. - Reads
iconColorandiconBackgroundColorfrom context and applies them as CSS classes. - Renders as an
<a>tag with:hreffrom theurlattribute.rel="nofollow"always set.target="_blank"ifopensInNewTabis true.
- The label content is sanitized via
wp_kses(), allowingcode,em,img,s,span,strongtags.
No view script. This is a static rendered link.
core/social-links-- Parent block providing context for colors and layout.prc-block/social-share-sheet-- Another social sharing child block for native share sheet.prc-block/social-share-url-field-- Provides a copyable URL field within social links.