contextual-info-script.php
30 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display contextual info script. |
| 4 | * |
| 5 | * @package Contextual Info. |
| 6 | * |
| 7 | * @var $html_elements_ids string |
| 8 | * @var $info_id string |
| 9 | * @var $phrases_in string[] |
| 10 | * @var $info_html string |
| 11 | * @var $phrases_not_in string[] |
| 12 | */ |
| 13 | |
| 14 | ?> |
| 15 | <script type="text/javascript"> |
| 16 | jQuery( document ).ready( |
| 17 | function () { |
| 18 | jQuery( "<?php echo esc_attr( $html_elements_ids ); ?>" ).contextualInfo( |
| 19 | { |
| 20 | 'id': '<?php echo esc_attr( $info_id ); ?>', |
| 21 | 'phrases_in': <?php echo json_encode( $phrases_in ); // phpcs:ignore ?>, |
| 22 | 'info_html': <?php echo json_encode( $info_html ); // phpcs:ignore ?>, |
| 23 | 'phrases_not_in': <?php echo json_encode( $phrases_not_in ); // phpcs:ignore ?>, |
| 24 | 'is_limited_width': <?php echo wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' ) && wpdesk_is_plugin_active( 'flexible-shipping-import-export/flexible-shipping-import-export.php' ) ? 'false' : 'true'; ?> |
| 25 | } |
| 26 | ); |
| 27 | } |
| 28 | ); |
| 29 | </script> |
| 30 |