Advertisement
w3b

Untitled

w3b
Mar 7th, 2023 (edited)
985
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | Fixit | 0 0
  1. public static function before_section_render(Element_Base $element) {
  2.     $link_settings = $element->get_settings_for_display('ra_element_link');
  3.     if ($link_settings && !empty($link_settings['url'])) {
  4.       $target = ( isset( $link_settings['is_external']  ) && $link_settings['is_external']  == 'on' ) ? '_blank' : '_self';
  5.       $element->add_render_attribute(
  6.         '_wrapper',
  7.         [
  8.           'data-ra-element-link' => json_encode($link_settings),
  9.           'style' => 'cursor: pointer',
  10.           'target' => $target,
  11.           'onClick' => 'window.open("' . $link_settings['url'] . '", "'. $target .'")',
  12.         ]
  13.       );
  14.     }
  15.   }
Advertisement
Comments
  • w3b
    w3b
    1 year
    # text 0.11 KB | 0 0
    1. fix the "always open in a new tab" bug of Make Section & Column Clickable Elementor wordpress plugin, version 1.5
Add Comment
Please, Sign In to add comment
Advertisement