mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- reviewed #1496;
This commit is contained in:
+11
-16
@@ -553,7 +553,6 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
$this->builtin();
|
||||
$this->form()->hooks();
|
||||
$this->permalinks();
|
||||
$this->modal();
|
||||
$this->cron();
|
||||
$this->mobile();
|
||||
$this->external_integrations();
|
||||
@@ -879,6 +878,17 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
return $this->admin()->enqueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
* @deprecated 2.8.6
|
||||
*
|
||||
* @return um\frontend\Modal
|
||||
*/
|
||||
function modal() {
|
||||
_deprecated_function( __METHOD__, '2.8.6', 'UM()->frontend()->modal()' );
|
||||
return $this->frontend()->modal();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
@@ -1387,21 +1397,6 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
return $this->classes['logout'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
* @return um\core\Modal
|
||||
*/
|
||||
function modal() {
|
||||
if ( empty( $this->classes['modal'] ) ) {
|
||||
$this->classes['modal'] = new um\core\Modal();
|
||||
}
|
||||
|
||||
return $this->classes['modal'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<?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.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'wp_footer', array( &$this, 'load_modal_content' ), $this->get_priority() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function get_priority() {
|
||||
return apply_filters( 'um_core_includes_modals_priority', 9 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load modal content
|
||||
*/
|
||||
public function load_modal_content() {
|
||||
if ( ! is_admin() ) {
|
||||
$modal_templates = glob( UM_PATH . 'templates/modal/*.php' );
|
||||
$modal_templates = array_map( 'basename', $modal_templates );
|
||||
if ( ! empty( $modal_templates ) ) {
|
||||
foreach ( $modal_templates as $modal_content ) {
|
||||
UM()->get_template( 'modal/' . $modal_content, '', array(), true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ if ( ! class_exists( 'um\frontend\Init' ) ) {
|
||||
*/
|
||||
public function includes() {
|
||||
$this->enqueue();
|
||||
$this->modal();
|
||||
$this->secure();
|
||||
}
|
||||
|
||||
@@ -37,6 +38,19 @@ if ( ! class_exists( 'um\frontend\Init' ) ) {
|
||||
return UM()->classes['um\frontend\enqueue'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.8.6
|
||||
*
|
||||
* @return Modal
|
||||
*/
|
||||
public function modal() {
|
||||
if ( empty( UM()->classes['um\frontend\modal'] ) ) {
|
||||
UM()->classes['um\frontend\modal'] = new Modal();
|
||||
}
|
||||
|
||||
return UM()->classes['um\frontend\modal'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.6.8
|
||||
*
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace um\frontend;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Modal
|
||||
*
|
||||
* @package um\frontend
|
||||
*/
|
||||
class Modal {
|
||||
|
||||
/**
|
||||
* Modal constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'wp_footer', array( &$this, 'load_modal_content' ), $this->get_priority() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
private function get_priority() {
|
||||
return apply_filters( 'um_core_includes_modals_priority', 9 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load modal content.
|
||||
*/
|
||||
public function load_modal_content() {
|
||||
$modal_templates = glob( UM_PATH . 'templates/modal/*.php' );
|
||||
$modal_templates = array_map( 'basename', $modal_templates );
|
||||
if ( ! empty( $modal_templates ) ) {
|
||||
foreach ( $modal_templates as $modal_content ) {
|
||||
UM()->get_template( 'modal/' . $modal_content, '', array(), true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,13 @@
|
||||
/**
|
||||
* Template for the modal form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/ultimate-member/modal/um_upload_single.php
|
||||
* This template can be overridden by copying it to yourtheme/ultimate-member/modal/upload-single.php
|
||||
*
|
||||
* @version 2.6.1
|
||||
* @version 2.8.6
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="um_upload_single" style="display:none"></div>
|
||||
<div id="um_upload_single" style="display:none;"></div>
|
||||
@@ -2,23 +2,21 @@
|
||||
/**
|
||||
* Template for the modal photo
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/ultimate-member/modal/um_view_photo.php
|
||||
* This template can be overridden by copying it to yourtheme/ultimate-member/modal/view-photo.php
|
||||
*
|
||||
* @version 2.6.1
|
||||
* @version 2.8.6
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="um_view_photo" style="display:none">
|
||||
|
||||
<a href="javascript:void(0);" data-action="um_remove_modal" class="um-modal-close"
|
||||
aria-label="<?php esc_attr_e( 'Close view photo modal', 'ultimate-member' ) ?>">
|
||||
<div id="um_view_photo" style="display:none;">
|
||||
<a href="javascript:void(0);" data-action="um_remove_modal" class="um-modal-close" aria-label="<?php esc_attr_e( 'Close view photo modal', 'ultimate-member' ); ?>">
|
||||
<i class="um-faicon-times"></i>
|
||||
</a>
|
||||
|
||||
<div class="um-modal-body photo">
|
||||
<div class="um-modal-photo"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user