Created
October 24, 2020 22:59
-
-
Save ronalfy/2dbb84ceee04328d6bca98b21df7fb1c to your computer and use it in GitHub Desktop.
Syntax Highlighting Block - Adding Rel Attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin code above */ | |
if ( 0 === $count ) { | |
$code_start_tag = preg_replace( | |
'/(?<=<code\b)/', | |
sprintf( ' rel="%s" class="%s"', esc_attr( $attributes['language'] ), esc_attr( $added_classes ) ), | |
$code_start_tag, | |
1 | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plugin link: https://wordpress.org/plugins/syntax-highlighting-code-block/
CSS: https://gist.github.com/ronalfy/14cf84ae018241fdbb0f0fc8f6c6f725