Mã ngắn này tạo nút, bật lên hiển thị trên nhấp chuột với iframe trang bên trong.
- popup_page_link: liên kết đến trang, mẫu "TABLEON Trang trống"nên được chọn
- button_text: văn bản liên kết, ví dụ: 'Gửi tin nhắn cho người quản lý sản phẩm'
- popup_title: Tiêu đề cửa sổ bật lên
- css_class: Lớp CSS của liên kết
- help_title: văn bản của liên kết trên tiêu đề bật lên từ bên phải
- help_link: liên kết trong tiêu đề bật lên
Demo shortcode: https://demo.posts-table.com/tableon_popup_iframe_button/
Mã làm ví dụ cho các nhà phát triển:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
add_shortcode('tableon_popup_iframe_button', function($args) { wp_enqueue_script('tableon-helper', TABLEON_ASSETS_LINK . 'js/helper.js', [], TABLEON_VERSION, true); wp_enqueue_script('popup-23', TABLEON_ASSETS_LINK . 'js/popup-23.js', ['tableon-helper'], TABLEON_VERSION, true); wp_enqueue_style('tableon-popup-23', TABLEON_ASSETS_LINK . 'css/popup-23.css', [], TABLEON_VERSION); wp_enqueue_style('tableon-general', TABLEON_ASSETS_LINK . 'css/general.css', [], TABLEON_VERSION); $popup_page_link = ''; if (isset($args['popup_page_link'])) { $popup_page_link = $args['popup_page_link']; } $button_text = 'Send message to the product manager'; if (isset($args['button_text'])) { $button_text = $args['button_text']; } $popup_header_text = ''; if (isset($args['popup_header_text'])) { $popup_header_text = $args['popup_header_text']; } $css_class = ''; if (isset($args['css_class'])) { $css_class = $args['css_class']; } return TABLEON_HELPER::draw_html_item('a', [ 'href' => "javascript: new Popup23({iframe:\"{$popup_page_link}\", title:\"{$popup_header_text}\", style:\"height: 100vh\"});void(0);", 'class' => $css_class ], $button_text); }); |