Description
add_filter( 'render_block', function( $block_content, $block ) {
// Social Links Only
if( $block['blockName'] != 'core/social-link' ) {
return $block_content;
}
// Block Attributes
// extract( $block['attrs'] );
// $url, $service, $label
// Change Labels To Titles
$block_content = str_replace(
'aria-label=', 'title=', $block_content
);
// Add Target To Links
$block_content = str_replace(
'href=',
'target="_blank" rel="noreferrer noopener" href=',
$block_content
);
// Output
return $block_content;
}, 10, 2 );
Support
Using our Google upload form:
- Describe the issue and what you’ve observed.
- Describe your expected outcome(s).
- List steps to reproduce the issue.
- Optionally attach screen-shot images or a video.
Credits
We code all of our code snippets directly. Our clients provide most of the ideas and demand for the functionality provided by our code snippets.
There are several sources one can find on Google for code that has inspired or contributed to this open-source library. Here’s some main ones:
License & Disclaimer
All code snippets are licensed GPLv2 (or later) matching WordPress licensing.
Disclaimer of warranty:
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.