PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.3.7
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.3.7
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / wpmu-lib / view / pointer.php
wordpress-popup / lib / wpmu-lib / view Last commit date
list.php 5 years ago pointer.php 5 years ago
pointer.php
107 lines
1 <?php
2 /**
3 * Code-snippet for WordPress pointers.
4 * Used in function lib3()->html->pointer()
5 *
6 * @since 1.0.0
7 *
8 * Variables:
9 * - $pointer_id
10 * - $html_el
11 * - $title
12 * - $body
13 * - $once
14 * - $modal
15 * - $blur
16 */
17
18 /**
19 * Filter pointer classes
20 *
21 * @since 3.1.0
22 */
23 $class = implode( ' ', apply_filters( 'wpmui_pointer_classes', $classes ) );
24 if ( ! empty( $title ) ) {
25 $title = '<h3>' . $title . '</h3>';
26 } else {
27 $title = '';
28 $class .= ' no-title';
29 }
30
31 $code = sprintf(
32 '<div class="%3$s">%1$s<p>%2$s</p></div>',
33 $title,
34 $body,
35 esc_attr( $class )
36 );
37
38 // Remove linebreaks to avoid JS errors
39 $code = str_replace( array( "\r", "\n" ), '', $code );
40
41 ?>
42 <script>
43 jQuery(document).ready(function() {
44 var wpcontent = jQuery( '#wpbody' ),
45 body = jQuery( 'body' );
46
47 if ( jQuery().pointer !== undefined ) {
48 var target = jQuery( '<?php echo $html_el; ?>' );
49 if ( ! target.length ) { return; }
50 target = target.first();
51
52 <?php if ( $blur ) : ?>
53 wpcontent.addClass( 'wpmui-blur' );
54 <?php else : ?>
55 body.addClass( 'no-blur' );
56 <?php endif; ?>
57
58 <?php if ( $modal ) : ?>
59 var modal = wpmUi._make_modal( 'light' );
60 if ( undefined !== modal ) {
61 modal.on( 'click', function( ev ) {
62 target.pointer( 'close' );
63 });
64 } else {
65 wpmUi._close_modal();
66 }
67 <?php endif; ?>
68
69 // Insert the pointer HTML code
70 target.pointer({
71 content: '<?php echo $code; ?>',
72 position: {
73 edge: 'left',
74 align: 'center'
75 },
76 close: function() {
77 <?php if ( $blur ) : ?>
78 wpcontent.removeClass( 'wpmui-blur' );
79 <?php else : ?>
80 body.removeClass( 'no-blur' );
81 <?php endif; ?>
82
83 <?php if ( $modal ) : ?>
84 wpmUi._close_modal();
85 <?php endif; ?>
86
87 <?php if ( $once ) : ?>
88 jQuery.post( ajaxurl, {
89 pointer: '<?php echo esc_js( $pointer_id ) ?>',
90 action: 'dismiss-wp-pointer'
91 });
92 <?php endif; ?>
93 }
94 }).pointer('open');
95
96 // Modify the default pointer style
97 jQuery( '.wpmui-pointer-handler.prepared' ).each(function() {
98 var me = jQuery(this),
99 ptr = me.closest('.wp-pointer');
100 me.removeClass('prepared');
101 ptr.addClass( me.attr( 'class' ) );
102 me.removeClass('wpmui-pointer-handler');
103 });
104 }
105 });
106 </script>
107