class-modal.php
871 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace um\core;
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Modal' ) ) {
/**
* Class Modal
*
* @package um\core
*/
class Modal {
/**
* Modal constructor.
*/
function __construct() {
add_action( 'wp_footer', array( &$this, 'load_modal_content' ), $this->get_priority() );
}
/**
* @return int
*/
function get_priority() {
return apply_filters( 'um_core_includes_modals_priority', 9 );
}
/**
* Load modal content
*/
function load_modal_content() {
if ( ! is_admin() ) {
$modal_templates = glob( um_path . 'templates/modal/*.php' );
if ( ! empty( $modal_templates ) ) {
foreach ( $modal_templates as $modal_content ) {
include_once $modal_content;
}
}
}
}
}
}