mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- 2.0.30 release;
This commit is contained in:
@@ -45,22 +45,32 @@ if ( ! class_exists( 'um\admin\Admin' ) ) {
|
||||
|
||||
add_action( 'um_admin_do_action__install_core_pages', array( &$this, 'install_core_pages' ) );
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
|
||||
add_action( 'parent_file', array( &$this, 'parent_file' ), 9 );
|
||||
add_filter( 'gettext', array( &$this, 'gettext' ), 10, 4 );
|
||||
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages' ) );
|
||||
|
||||
|
||||
|
||||
add_action( 'wp_ajax_um_dynamic_modal_content', array( UM()->builder(), 'dynamic_modal_content' ) );
|
||||
add_action( 'wp_ajax_um_populate_dropdown_options', array( UM()->builder(), 'populate_dropdown_options' ) );
|
||||
add_action( 'wp_ajax_um_update_field', array( UM()->builder(), 'update_field' ) );
|
||||
add_action( 'wp_ajax_um_do_ajax_action', array( UM()->fields(), 'do_ajax_action' ) );
|
||||
add_action( 'wp_ajax_um_update_builder', array( UM()->builder(), 'update_builder' ) );
|
||||
add_action( 'wp_ajax_um_update_order', array( UM()->dragdrop(), 'update_order' ) );
|
||||
add_action( 'wp_ajax_um_rated', array( UM()->admin_menu(), 'ultimatemember_rated' ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds class to our admin pages
|
||||
*
|
||||
* @param $classes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function admin_body_class( $classes ) {
|
||||
if ( $this->is_um_screen() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function manual_upgrades_request() {
|
||||
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
||||
die();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace um\admin\core;
|
||||
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
if ( ! class_exists( 'um\admin\core\Admin_Ajax_Hooks' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* Class Admin_Ajax_Hooks
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_Ajax_Hooks {
|
||||
|
||||
|
||||
/**
|
||||
* Admin_Columns constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
add_action( 'wp_ajax_um_do_ajax_action', array( UM()->fields(), 'do_ajax_action' ) );
|
||||
add_action( 'wp_ajax_um_update_builder', array( UM()->builder(), 'update_builder' ) );
|
||||
add_action( 'wp_ajax_um_update_order', array( UM()->dragdrop(), 'update_order' ) );
|
||||
add_action( 'wp_ajax_um_update_field', array( UM()->builder(), 'update_field' ) );
|
||||
add_action( 'wp_ajax_um_dynamic_modal_content', array( UM()->builder(), 'dynamic_modal_content' ) );
|
||||
add_action( 'wp_ajax_um_populate_dropdown_options', array( UM()->builder(), 'populate_dropdown_options' ) );
|
||||
add_action( 'wp_ajax_um_rated', array( UM()->admin_menu(), 'ultimatemember_rated' ) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
|
||||
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
|
||||
|
||||
add_action( 'load-user-new.php', array( &$this, 'enqueue_role_wrapper' ) );
|
||||
@@ -344,21 +342,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds class to our admin pages
|
||||
*
|
||||
* @param $classes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function admin_body_class( $classes ) {
|
||||
if ( UM()->admin()->is_um_screen() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
|
||||
@@ -525,6 +525,7 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
if ( $this->is_request( 'ajax' ) ) {
|
||||
$this->admin();
|
||||
$this->ajax_init();
|
||||
$this->admin_ajax_hooks();
|
||||
$this->metabox();
|
||||
$this->admin_upgrade()->init_packages_ajax_handlers();
|
||||
$this->admin_gdpr();
|
||||
@@ -638,6 +639,17 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0.30
|
||||
*/
|
||||
function admin_ajax_hooks() {
|
||||
if ( empty( $this->classes['admin_ajax_hooks'] ) ) {
|
||||
$this->classes['admin_ajax_hooks'] = new um\admin\core\Admin_Ajax_Hooks();
|
||||
}
|
||||
return $this->classes['admin_ajax_hooks'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
@@ -1313,6 +1325,20 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
* @return um\core\Templates
|
||||
*/
|
||||
function templates() {
|
||||
if ( empty( $this->classes['templates'] ) ) {
|
||||
$this->classes['templates'] = new um\core\Templates();
|
||||
}
|
||||
|
||||
return $this->classes['templates'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
if ( ! class_exists( 'Templates' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* Class Templates
|
||||
* @package um\core
|
||||
*/
|
||||
class Templates {
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get template path
|
||||
*
|
||||
*
|
||||
* @param $slug
|
||||
* @return string
|
||||
*/
|
||||
function get_template( $slug ) {
|
||||
$file_list = um_path . "templates/{$slug}.php";
|
||||
$theme_file = get_stylesheet_directory() . "/ultimate-member/templates/{$slug}.php";
|
||||
|
||||
if ( file_exists( $theme_file ) ) {
|
||||
$file_list = $theme_file;
|
||||
}
|
||||
|
||||
return $file_list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<form role="search" method="get" class="search-form um-search-form" action="<?php echo esc_url( um_get_core_page( 'members' ) ); ?>">
|
||||
<input type="hidden" name="um_search" value="1">
|
||||
<div class="um-search-area">
|
||||
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ); ?></span>
|
||||
<input type="search" class="um-search-field search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ); ?>" value="<?php echo um_get_search_query(); ?>" name="search" title="<?php echo esc_attr_x( 'Search for:', 'label' ); ?>" />
|
||||
<a href="javascript: void(0);" id="um-search-button" class="um-search-icon um-faicon um-faicon-search"></a>
|
||||
</div>
|
||||
<div class="um-search-area">
|
||||
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ); ?></span>
|
||||
<input type="search" class="um-search-field search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ); ?>" value="<?php echo um_get_search_query(); ?>" name="search" title="<?php echo esc_attr_x( 'Search for:', 'label' ); ?>" />
|
||||
<a href="javascript: void(0);" id="um-search-button" class="um-search-icon um-faicon um-faicon-search"></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user