mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
b83da8b814
* um_url -> UM_URL * um_path -> UM_PATH * um_plugin -> UM_PLUGIN * ultimatemember_version -> UM_VERSION * ultimatemember_plugin_name -> UM_PLUGIN_NAME
55 lines
819 B
PHP
55 lines
819 B
PHP
<?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;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|