2017-07-26 14:57:52 +03:00
|
|
|
<?php
|
|
|
|
|
namespace um\core;
|
|
|
|
|
|
|
|
|
|
// Exit if accessed directly
|
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
|
|
2018-03-26 01:27:46 +03:00
|
|
|
if ( ! class_exists( 'um\core\Modal' ) ) {
|
2017-07-26 14:57:52 +03:00
|
|
|
|
|
|
|
|
|
2018-03-20 13:24:38 +02:00
|
|
|
/**
|
|
|
|
|
* Class Modal
|
|
|
|
|
* @package um\core
|
|
|
|
|
*/
|
|
|
|
|
class Modal {
|
2017-07-26 14:57:52 +03:00
|
|
|
|
|
|
|
|
|
2018-03-20 13:24:38 +02:00
|
|
|
/**
|
|
|
|
|
* Modal constructor.
|
|
|
|
|
*/
|
|
|
|
|
function __construct() {
|
|
|
|
|
add_action('wp_footer', array(&$this, 'load_modal_content'), 9);
|
|
|
|
|
}
|
2017-07-26 14:57:52 +03:00
|
|
|
|
|
|
|
|
|
2018-03-20 13:24:38 +02:00
|
|
|
/**
|
|
|
|
|
* Load modal content
|
|
|
|
|
*/
|
|
|
|
|
function load_modal_content(){
|
|
|
|
|
if ( !is_admin() ) {
|
|
|
|
|
foreach( glob( um_path . 'templates/modal/*.php' ) as $modal_content) {
|
|
|
|
|
include_once $modal_content;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2017-07-26 14:57:52 +03:00
|
|
|
}
|