Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function db_rerender_url_new_tab( $block_content, $block ) {
- if(!is_admin()){
- if ( ! empty( $block['attrs']['className'] ) && 'open-new-tab' === $block['attrs']['className'] ) {
- $my_search='href="';
- $my_replace='target="_blank" href="';
- $new_content = str_replace($my_search, $my_replace, $block_content);
- return $new_content;
- }
- }
- return $block_content;
- }
- add_filter( 'render_block', 'db_rerender_url_new_tab', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment