PluginProbe ʕ •ᴥ•ʔ
Ocean Extra / 2.5.7
Ocean Extra v2.5.7
2.5.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.4.1 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.0.1 1.2.1 1.2.1.1 1.2.1.2 1.2.10 1.2.2 1.2.2.1 1.2.2.2 1.2.2.3 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.16 1.4.17 1.4.18 1.4.19 1.4.2 1.4.20 1.4.21 1.4.22 1.4.23 1.4.24 1.4.25 1.4.26 1.4.27 1.4.28 1.4.29 1.4.3 1.4.30 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.12 1.5.13 1.5.14 1.5.15 1.5.16 1.5.17 1.5.18 1.5.19 1.5.2 1.5.20 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6
ocean-extra / includes / preloader / helper.php
ocean-extra / includes / preloader Last commit date
assets 1 year ago customizer.php 1 year ago helper.php 1 year ago preloader.php 1 year ago
helper.php
108 lines
1 <?php
2 /**
3 * Preloader
4 *
5 * @package Ocean_Extra
6 * @category Core
7 * @author OceanWP
8 */
9
10 // Exit if accessed directly.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 /**
16 * Preloader Icon list
17 */
18 function oe_preloader_icon_list() {
19
20 $icon_array = array(
21 'roller' => '<div class="preloader-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>',
22 'circle' => '<div class="preloader-circle"><div></div></div>',
23 'ring' => '<div class="preloader-ring"><div></div><div></div><div></div><div></div></div>',
24 'dual-ring' => '<div class="preloader-dual-ring"></div>',
25 'ripple-plain' => '<div class="preloader-ripple-plain"><div></div><div></div><div></div></div>',
26 'ripple-circle' => '<div class="preloader-ripple-circle"><div></div><div></div></div>',
27 'heart' => '<div class="preloader-heart"><div></div></div>',
28 'ellipsis' => '<div class="preloader-ellipsis"><div></div><div></div><div></div><div></div></div>',
29 'spinner-dot' => '<div class="preloader-spinner-dot"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>',
30 'spinner-line' => '<div class="preloader-spinner-line"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>',
31
32 );
33
34 $icon_array = apply_filters( 'ocean_preloader_icon_list', $icon_array );
35
36 return $icon_array;
37
38 }
39
40 /**
41 * Preloader icon
42 */
43 function oe_preloader_icon( $icon = '' ) {
44
45 if ( empty( $icon ) ) {
46 return;
47 }
48
49 $icon_array = oe_preloader_icon_list();
50
51 $content = $icon_array[$icon];
52 $content = apply_filters( 'ocean_preloader_icon_html', $content );
53
54 return $content;
55
56 }
57
58 /**
59 * Returns Preloader image
60 */
61 function oe_preloader_image_html() {
62
63 $html = '';
64
65 $img_url = get_theme_mod( 'ocean_preloader_icon_image' );
66
67 $img_data = array(
68 'url' => '',
69 'width' => '',
70 'height' => '',
71 'alt' => '',
72 );
73
74 if ( $img_url ) {
75
76 $img_data['url'] = $img_url;
77
78 $img_attachment_data = oceanwp_get_attachment_data_from_url( $img_url );
79
80 if ( $img_attachment_data ) {
81 $img_data['width'] = $img_attachment_data['width'];
82 $img_data['height'] = $img_attachment_data['height'];
83 $img_data['alt'] = $img_attachment_data['alt'];
84 }
85
86 // Output image.
87 $html = sprintf(
88 '<img src="%1$s" class="preloader-attachment" width="%2$s" height="%3$s" alt="%4$s" />',
89 esc_url( $img_data['url'] ),
90 esc_attr( $img_data['width'] ),
91 esc_attr( $img_data['height'] ),
92 esc_attr( $img_data['alt'] )
93 );
94
95 }
96
97 // Return image.
98 return apply_filters( 'ocean_preloader_image', $html );
99
100 }
101
102 /**
103 * Echo Preloader image
104 */
105 function oe_preloader_image() {
106 echo wp_kses_post( oe_preloader_image_html() );
107 }
108