fazarcon

add attribute

Jul 17th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function db_rerender_gb_block( $block_content, $block ) {
  2.  
  3. if (! is_admin() && ! empty( $block['attrs']['className'] ) && 'my-headline' === $block['attrs']['className'] ) {
  4.  
  5. $my_search='class="gb-headline';
  6. $my_replace='tabindex="0" ';
  7. $new_content = str_replace($my_search, $my_replace . $my_search, $block_content);
  8. return $new_content;
  9. }
  10. }
  11. return $block_content;
  12.  
  13.  
  14. add_filter( 'render_block', 'db_rerender_gb_block', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment