fazarcon

Modify Image html

Jun 13th, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function db_rerender_image_url( $block_content, $block ) {
  2. if(!is_admin()){
  3. if ( ! empty( $block['attrs']['className'] ) && 'my-image-block' === $block['attrs']['className'] ) {
  4. $block_content = '<a href="(link-to-media-file.whatever" data-rel="lightbox-gallery-EkVT4NMy" data-rl_title="" data-rl_caption="" title="" data-lightbox-gallery="lightbox-gallery-EkVT">' . $block_content . '</a>';
  5. }
  6. }
  7. return $block_content;
  8. }
  9.  
  10. add_filter( 'render_block', 'db_rerender_image_url', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment