mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- conditional logic fixed;
- some code optimization and documentation; - fixed conflict with WP Fusion;
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,129 +5,151 @@ namespace um\admin\core;
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'Admin_Columns' ) ) {
|
||||
class Admin_Columns {
|
||||
|
||||
function __construct() {
|
||||
|
||||
$this->slug = 'ultimatemember';
|
||||
|
||||
add_filter('manage_edit-um_form_columns', array(&$this, 'manage_edit_um_form_columns') );
|
||||
add_action('manage_um_form_posts_custom_column', array(&$this, 'manage_um_form_posts_custom_column'), 10, 3);
|
||||
|
||||
add_filter('manage_edit-um_directory_columns', array(&$this, 'manage_edit_um_directory_columns') );
|
||||
add_action('manage_um_directory_posts_custom_column', array(&$this, 'manage_um_directory_posts_custom_column'), 10, 3);
|
||||
|
||||
add_filter('post_row_actions', array(&$this, 'post_row_actions'), 99, 2);
|
||||
|
||||
// Add a post display state for special UM pages.
|
||||
add_filter( 'display_post_states', array( &$this, 'add_display_post_states' ), 10, 2 );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @custom row actions
|
||||
***/
|
||||
function post_row_actions( $actions, $post ) {
|
||||
//check for your post type
|
||||
if ( $post->post_type == "um_form" ) {
|
||||
$actions['um_duplicate'] = '<a href="' . $this->duplicate_uri( $post->ID ) . '">' . __('Duplicate','ultimate-member') . '</a>';
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @duplicate a form
|
||||
***/
|
||||
function duplicate_uri( $id ) {
|
||||
$url = add_query_arg('um_adm_action', 'duplicate_form', admin_url('edit.php?post_type=um_form') );
|
||||
$url = add_query_arg('post_id', $id, $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Custom columns for Form
|
||||
***/
|
||||
function manage_edit_um_form_columns( $columns ) {
|
||||
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['title'] = __( 'Title', 'ulitmatemember' );
|
||||
$new_columns['id'] = __('ID', 'ulitmatemember' );
|
||||
$new_columns['mode'] = __( 'Type', 'ulitmatemember' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ulitmatemember' );
|
||||
$new_columns['date'] = __( 'Date', 'ulitmatemember' );
|
||||
|
||||
return $new_columns;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Custom columns for Directory
|
||||
***/
|
||||
function manage_edit_um_directory_columns( $columns ) {
|
||||
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
|
||||
$new_columns['title'] = __( 'Title', 'ultimate-member' );
|
||||
$new_columns['id'] = __( 'ID', 'ultimate-member' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ultimate-member' );
|
||||
$new_columns['date'] = __( 'Date', 'ultimate-member' );
|
||||
|
||||
return $new_columns;
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Display cusom columns for Form
|
||||
***/
|
||||
function manage_um_form_posts_custom_column( $column_name, $id ) {
|
||||
|
||||
switch ( $column_name ) {
|
||||
|
||||
case 'id':
|
||||
echo '<span class="um-admin-number">'.$id.'</span>';
|
||||
break;
|
||||
|
||||
case 'shortcode':
|
||||
echo UM()->shortcodes()->get_shortcode( $id );
|
||||
break;
|
||||
|
||||
case 'mode':
|
||||
$mode = UM()->query()->get_attr( 'mode', $id );
|
||||
echo UM()->form()->display_form_type( $mode, $id );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Display cusom columns for Directory
|
||||
***/
|
||||
function manage_um_directory_posts_custom_column($column_name, $id) {
|
||||
global $wpdb;
|
||||
|
||||
switch ($column_name) {
|
||||
|
||||
case 'id':
|
||||
echo '<span class="um-admin-number">'.$id.'</span>';
|
||||
break;
|
||||
|
||||
case 'shortcode':
|
||||
echo UM()->shortcodes()->get_shortcode( $id );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Class Admin_Columns
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_Columns {
|
||||
|
||||
|
||||
/**
|
||||
* Add a post display state for special UM pages in the page list table.
|
||||
*
|
||||
* @param array $post_states An array of post display states.
|
||||
* @param \WP_Post $post The current post object.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
* Admin_Columns constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
|
||||
add_filter( 'manage_edit-um_form_columns', array( &$this, 'manage_edit_um_form_columns' ) );
|
||||
add_action( 'manage_um_form_posts_custom_column', array( &$this, 'manage_um_form_posts_custom_column' ), 10, 3 );
|
||||
|
||||
add_filter( 'manage_edit-um_directory_columns', array( &$this, 'manage_edit_um_directory_columns' ) );
|
||||
add_action( 'manage_um_directory_posts_custom_column', array( &$this, 'manage_um_directory_posts_custom_column' ), 10, 3 );
|
||||
|
||||
add_filter( 'post_row_actions', array( &$this, 'post_row_actions' ), 99, 2 );
|
||||
|
||||
// Add a post display state for special UM pages.
|
||||
add_filter( 'display_post_states', array( &$this, 'add_display_post_states' ), 10, 2 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Custom row actions
|
||||
*
|
||||
* @param array $actions
|
||||
* @param \WP_Post $post
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function post_row_actions( $actions, $post ) {
|
||||
//check for your post type
|
||||
if ( $post->post_type == "um_form" ) {
|
||||
$actions['um_duplicate'] = '<a href="' . $this->duplicate_uri( $post->ID ) . '">' . __( 'Duplicate', 'ultimate-member' ) . '</a>';
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Duplicate a form
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function duplicate_uri( $id ) {
|
||||
$url = add_query_arg('um_adm_action', 'duplicate_form', admin_url('edit.php?post_type=um_form') );
|
||||
$url = add_query_arg('post_id', $id, $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Custom columns for Form
|
||||
*
|
||||
* @param array $columns
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function manage_edit_um_form_columns( $columns ) {
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['title'] = __( 'Title', 'ulitmatemember' );
|
||||
$new_columns['id'] = __('ID', 'ulitmatemember' );
|
||||
$new_columns['mode'] = __( 'Type', 'ulitmatemember' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ulitmatemember' );
|
||||
$new_columns['date'] = __( 'Date', 'ulitmatemember' );
|
||||
|
||||
return $new_columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Custom columns for Directory
|
||||
*
|
||||
* @param array $columns
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function manage_edit_um_directory_columns( $columns ) {
|
||||
$new_columns['cb'] = '<input type="checkbox" />';
|
||||
$new_columns['title'] = __( 'Title', 'ultimate-member' );
|
||||
$new_columns['id'] = __( 'ID', 'ultimate-member' );
|
||||
$new_columns['shortcode'] = __( 'Shortcode', 'ultimate-member' );
|
||||
$new_columns['date'] = __( 'Date', 'ultimate-member' );
|
||||
|
||||
return $new_columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display custom columns for Form
|
||||
*
|
||||
* @param string $column_name
|
||||
* @param int $id
|
||||
*/
|
||||
function manage_um_form_posts_custom_column( $column_name, $id ) {
|
||||
switch ( $column_name ) {
|
||||
case 'id':
|
||||
echo '<span class="um-admin-number">'.$id.'</span>';
|
||||
break;
|
||||
|
||||
case 'shortcode':
|
||||
echo UM()->shortcodes()->get_shortcode( $id );
|
||||
break;
|
||||
|
||||
case 'mode':
|
||||
$mode = UM()->query()->get_attr( 'mode', $id );
|
||||
echo UM()->form()->display_form_type( $mode, $id );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display cusom columns for Directory
|
||||
*
|
||||
* @param string $column_name
|
||||
* @param int $id
|
||||
*/
|
||||
function manage_um_directory_posts_custom_column( $column_name, $id ) {
|
||||
switch ( $column_name ) {
|
||||
case 'id':
|
||||
echo '<span class="um-admin-number">'.$id.'</span>';
|
||||
break;
|
||||
case 'shortcode':
|
||||
echo UM()->shortcodes()->get_shortcode( $id );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a post display state for special UM pages in the page list table.
|
||||
*
|
||||
* @param array $post_states An array of post display states.
|
||||
* @param \WP_Post $post The current post object.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function add_display_post_states( $post_states, $post ) {
|
||||
|
||||
foreach ( UM()->config()->core_pages as $page_key => $page_value ) {
|
||||
@@ -141,5 +163,5 @@ if ( ! class_exists( 'Admin_Columns' ) ) {
|
||||
return $post_states;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,212 +5,227 @@ namespace um\admin\core;
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'Admin_DragDrop' ) ) {
|
||||
class Admin_DragDrop {
|
||||
|
||||
function __construct() {
|
||||
add_action( 'admin_footer', array( &$this, 'load_field_order' ), 9 );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @update order of fields
|
||||
***/
|
||||
function update_order() {
|
||||
|
||||
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) )
|
||||
die( 'Please login as administrator' );
|
||||
|
||||
extract( $_POST );
|
||||
|
||||
$fields = UM()->query()->get_attr( 'custom_fields', $form_id );
|
||||
|
||||
$this->row_data = get_option( 'um_form_rowdata_' . $form_id, array() );
|
||||
$this->exist_rows = array();
|
||||
|
||||
if ( ! empty( $fields ) ) {
|
||||
foreach ( $fields as $key => $array ) {
|
||||
if ( $array['type'] == 'row' ) {
|
||||
$this->row_data[$key] = $array;
|
||||
unset( $fields[$key] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$fields = array();
|
||||
}
|
||||
|
||||
foreach ( $_POST as $key => $value ) {
|
||||
|
||||
// adding rows
|
||||
if ( 0 === strpos( $key, '_um_row_' ) ) {
|
||||
|
||||
$update_args = null;
|
||||
|
||||
$row_id = str_replace( '_um_row_', '', $key );
|
||||
|
||||
$row_array = array(
|
||||
'type' => 'row',
|
||||
'id' => $value,
|
||||
'sub_rows' => $_POST[ '_um_rowsub_'.$row_id .'_rows' ],
|
||||
'cols' => $_POST[ '_um_rowcols_'.$row_id .'_cols' ],
|
||||
'origin' => $_POST[ '_um_roworigin_'.$row_id . '_val' ],
|
||||
);
|
||||
|
||||
$row_args = $row_array;
|
||||
|
||||
if ( isset( $this->row_data[ $row_array['origin'] ] ) ) {
|
||||
foreach( $this->row_data[ $row_array['origin'] ] as $k => $v ){
|
||||
if ( $k != 'position' && $k != 'metakey' ) {
|
||||
$update_args[$k] = $v;
|
||||
}
|
||||
}
|
||||
if ( isset( $update_args ) ) {
|
||||
$row_args = array_merge( $update_args, $row_array );
|
||||
}
|
||||
$this->exist_rows[] = $key;
|
||||
}
|
||||
|
||||
$fields[$key] = $row_args;
|
||||
|
||||
}
|
||||
|
||||
// change field position
|
||||
if ( 0 === strpos( $key, 'um_position_' ) ) {
|
||||
$field_key = str_replace('um_position_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['position'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field master row
|
||||
if ( 0 === strpos( $key, 'um_row_' ) ) {
|
||||
$field_key = str_replace('um_row_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_row'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field sub row
|
||||
if ( 0 === strpos( $key, 'um_subrow_' ) ) {
|
||||
$field_key = str_replace('um_subrow_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_sub_row'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field column
|
||||
if ( 0 === strpos( $key, 'um_col_' ) ) {
|
||||
$field_key = str_replace('um_col_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_column'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// add field to group
|
||||
if ( 0 === strpos( $key, 'um_group_' ) ) {
|
||||
$field_key = str_replace('um_group_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_group'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach ( $this->row_data as $k => $v ) {
|
||||
if ( ! in_array( $k, $this->exist_rows ) )
|
||||
unset( $this->row_data[$k] );
|
||||
}
|
||||
|
||||
update_option( 'um_existing_rows_' . $form_id, $this->exist_rows );
|
||||
|
||||
update_option( 'um_form_rowdata_' . $form_id , $this->row_data );
|
||||
|
||||
UM()->query()->update_attr( 'custom_fields', $form_id, $fields );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @load form to maintain form order
|
||||
***/
|
||||
function load_field_order() {
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( ! isset( $screen->id ) || $screen->id != 'um_form' ) return;
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-col-demon-settings" data-in_row="" data-in_sub_row="" data-in_column="" data-in_group=""></div>
|
||||
|
||||
<div class="um-col-demon-row" style="display:none;">
|
||||
|
||||
<div class="um-admin-drag-row-icons">
|
||||
<a href="#" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php _e('Add Row','ultimate-member'); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
|
||||
<a href="#" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php _e('Edit Row','ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo get_the_ID(); ?>"><i class="um-faicon-pencil"></i></a>
|
||||
<span class="um-admin-drag-row-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-rowsubs">
|
||||
<div class="um-admin-drag-rowsub">
|
||||
|
||||
<div class="um-admin-drag-ctrls columns">
|
||||
<a href="#" class="active" data-cols="1"></a>
|
||||
<a href="#" data-cols="2"></a>
|
||||
<a href="#" data-cols="3"></a>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-rowsub-icons">
|
||||
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-col">
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-col-dynamic"></div>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-col-demon-subrow" style="display:none;">
|
||||
|
||||
<div class="um-admin-drag-ctrls columns">
|
||||
<a href="#" class="active" data-cols="1"></a>
|
||||
<a href="#" data-cols="2"></a>
|
||||
<a href="#" data-cols="3"></a>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-rowsub-icons">
|
||||
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-col">
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-col-dynamic"></div>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<form action="" method="post" class="um_update_order">
|
||||
/**
|
||||
* Class Admin_DragDrop
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_DragDrop {
|
||||
|
||||
<input type="hidden" name="form_id" id="form_id" value="<?php echo get_the_ID(); ?>" />
|
||||
|
||||
<div class="um_update_order_fields">
|
||||
/**
|
||||
* Admin_DragDrop constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
add_action( 'admin_footer', array( &$this, 'load_field_order' ), 9 );
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
/**
|
||||
* Update order of fields
|
||||
*/
|
||||
function update_order() {
|
||||
|
||||
<?php
|
||||
if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) )
|
||||
die( 'Please login as administrator' );
|
||||
|
||||
}
|
||||
/**
|
||||
* @var $form_id
|
||||
*/
|
||||
extract( $_POST );
|
||||
|
||||
}
|
||||
$fields = UM()->query()->get_attr( 'custom_fields', $form_id );
|
||||
|
||||
$this->row_data = get_option( 'um_form_rowdata_' . $form_id, array() );
|
||||
$this->exist_rows = array();
|
||||
|
||||
if ( ! empty( $fields ) ) {
|
||||
foreach ( $fields as $key => $array ) {
|
||||
if ( $array['type'] == 'row' ) {
|
||||
$this->row_data[$key] = $array;
|
||||
unset( $fields[$key] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$fields = array();
|
||||
}
|
||||
|
||||
foreach ( $_POST as $key => $value ) {
|
||||
|
||||
// adding rows
|
||||
if ( 0 === strpos( $key, '_um_row_' ) ) {
|
||||
|
||||
$update_args = null;
|
||||
|
||||
$row_id = str_replace( '_um_row_', '', $key );
|
||||
|
||||
$row_array = array(
|
||||
'type' => 'row',
|
||||
'id' => $value,
|
||||
'sub_rows' => $_POST[ '_um_rowsub_'.$row_id .'_rows' ],
|
||||
'cols' => $_POST[ '_um_rowcols_'.$row_id .'_cols' ],
|
||||
'origin' => $_POST[ '_um_roworigin_'.$row_id . '_val' ],
|
||||
);
|
||||
|
||||
$row_args = $row_array;
|
||||
|
||||
if ( isset( $this->row_data[ $row_array['origin'] ] ) ) {
|
||||
foreach( $this->row_data[ $row_array['origin'] ] as $k => $v ){
|
||||
if ( $k != 'position' && $k != 'metakey' ) {
|
||||
$update_args[$k] = $v;
|
||||
}
|
||||
}
|
||||
if ( isset( $update_args ) ) {
|
||||
$row_args = array_merge( $update_args, $row_array );
|
||||
}
|
||||
$this->exist_rows[] = $key;
|
||||
}
|
||||
|
||||
$fields[$key] = $row_args;
|
||||
|
||||
}
|
||||
|
||||
// change field position
|
||||
if ( 0 === strpos( $key, 'um_position_' ) ) {
|
||||
$field_key = str_replace('um_position_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['position'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field master row
|
||||
if ( 0 === strpos( $key, 'um_row_' ) ) {
|
||||
$field_key = str_replace('um_row_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_row'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field sub row
|
||||
if ( 0 === strpos( $key, 'um_subrow_' ) ) {
|
||||
$field_key = str_replace('um_subrow_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_sub_row'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// change field column
|
||||
if ( 0 === strpos( $key, 'um_col_' ) ) {
|
||||
$field_key = str_replace('um_col_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_column'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// add field to group
|
||||
if ( 0 === strpos( $key, 'um_group_' ) ) {
|
||||
$field_key = str_replace('um_group_','',$key);
|
||||
if ( isset( $fields[$field_key] ) ) {
|
||||
$fields[$field_key]['in_group'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach ( $this->row_data as $k => $v ) {
|
||||
if ( ! in_array( $k, $this->exist_rows ) )
|
||||
unset( $this->row_data[$k] );
|
||||
}
|
||||
|
||||
update_option( 'um_existing_rows_' . $form_id, $this->exist_rows );
|
||||
|
||||
update_option( 'um_form_rowdata_' . $form_id , $this->row_data );
|
||||
|
||||
UM()->query()->update_attr( 'custom_fields', $form_id, $fields );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load form to maintain form order
|
||||
*/
|
||||
function load_field_order() {
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( ! isset( $screen->id ) || $screen->id != 'um_form' ) return;
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-col-demon-settings" data-in_row="" data-in_sub_row="" data-in_column="" data-in_group=""></div>
|
||||
|
||||
<div class="um-col-demon-row" style="display:none;">
|
||||
|
||||
<div class="um-admin-drag-row-icons">
|
||||
<a href="#" class="um-admin-drag-rowsub-add um-admin-tipsy-n" title="<?php _e('Add Row','ultimate-member'); ?>" data-row_action="add_subrow"><i class="um-icon-plus"></i></a>
|
||||
<a href="#" class="um-admin-drag-row-edit um-admin-tipsy-n" title="<?php _e('Edit Row','ultimate-member'); ?>" data-modal="UM_edit_row" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="row" data-arg2="<?php echo get_the_ID(); ?>"><i class="um-faicon-pencil"></i></a>
|
||||
<span class="um-admin-drag-row-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-row"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-rowsubs">
|
||||
<div class="um-admin-drag-rowsub">
|
||||
|
||||
<div class="um-admin-drag-ctrls columns">
|
||||
<a href="#" class="active" data-cols="1"></a>
|
||||
<a href="#" data-cols="2"></a>
|
||||
<a href="#" data-cols="3"></a>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-rowsub-icons">
|
||||
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-col">
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-col-dynamic"></div>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="um-col-demon-subrow" style="display:none;">
|
||||
|
||||
<div class="um-admin-drag-ctrls columns">
|
||||
<a href="#" class="active" data-cols="1"></a>
|
||||
<a href="#" data-cols="2"></a>
|
||||
<a href="#" data-cols="3"></a>
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-rowsub-icons">
|
||||
<span class="um-admin-drag-rowsub-start"><i class="um-icon-arrow-move"></i></span>
|
||||
<a href="#" class="um-admin-tipsy-n" title="<?php _e('Delete Row','ultimate-member'); ?>" data-remove_element="um-admin-drag-rowsub"><i class="um-faicon-trash-o"></i></a>
|
||||
</div><div class="um-admin-clear"></div>
|
||||
|
||||
<div class="um-admin-drag-col">
|
||||
</div>
|
||||
|
||||
<div class="um-admin-drag-col-dynamic"></div>
|
||||
|
||||
<div class="um-admin-clear"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<form action="" method="post" class="um_update_order">
|
||||
|
||||
<input type="hidden" name="form_id" id="form_id" value="<?php echo get_the_ID(); ?>" />
|
||||
|
||||
<div class="um_update_order_fields">
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,455 +5,441 @@ namespace um\admin\core;
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'Admin_Enqueue' ) ) {
|
||||
class Admin_Enqueue {
|
||||
var $js_url;
|
||||
var $css_url;
|
||||
|
||||
function __construct() {
|
||||
$this->slug = 'ultimatemember';
|
||||
|
||||
$this->js_url = um_url . 'includes/admin/assets/js/';
|
||||
$this->css_url = um_url . 'includes/admin/assets/css/';
|
||||
/**
|
||||
* Class Admin_Enqueue
|
||||
* @package um\admin\core
|
||||
*/
|
||||
class Admin_Enqueue {
|
||||
var $js_url;
|
||||
var $css_url;
|
||||
|
||||
add_action('admin_head', array(&$this, 'admin_head'), 9);
|
||||
|
||||
add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts') );
|
||||
/**
|
||||
* Admin_Enqueue constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->slug = 'ultimatemember';
|
||||
|
||||
add_filter( 'admin_body_class', array( &$this, 'admin_body_class' ), 999 );
|
||||
$this->js_url = um_url . 'includes/admin/assets/js/';
|
||||
$this->css_url = um_url . 'includes/admin/assets/css/';
|
||||
|
||||
add_filter('enter_title_here', array(&$this, 'enter_title_here') );
|
||||
add_action( 'admin_head', array( &$this, 'admin_head' ), 9 );
|
||||
|
||||
add_action( 'load-user-new.php', array( &$this, 'enqueue_role_wrapper' ) );
|
||||
add_action( 'load-user-edit.php', array( &$this, 'enqueue_role_wrapper' ) );
|
||||
}
|
||||
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' ) );
|
||||
add_action( 'load-user-edit.php', array( &$this, 'enqueue_role_wrapper' ) );
|
||||
}
|
||||
|
||||
function enqueue_role_wrapper() {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'load_role_wrapper' ) );
|
||||
}
|
||||
|
||||
function enqueue_role_wrapper() {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'load_role_wrapper' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load js for Add/Edit User form
|
||||
*/
|
||||
function load_role_wrapper() {
|
||||
|
||||
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_role_wrapper' );
|
||||
|
||||
$localize_roles_data = get_option( 'um_roles' );
|
||||
|
||||
wp_localize_script( 'um_admin_settings', 'um_roles', $localize_roles_data );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @enter title placeholder
|
||||
***/
|
||||
function enter_title_here( $title ) {
|
||||
$screen = get_current_screen();
|
||||
if ( 'um_directory' == $screen->post_type ){
|
||||
$title = 'e.g. Member Directory';
|
||||
}
|
||||
if ( 'um_form' == $screen->post_type ){
|
||||
$title = 'e.g. New Registration Form';
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Runs on admin head
|
||||
***/
|
||||
function admin_head(){
|
||||
|
||||
if ( UM()->admin()->is_plugin_post_type() ){
|
||||
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#slugdiv,
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#minor-publishing,
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#screen-meta-links
|
||||
{display:none}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Form
|
||||
***/
|
||||
function load_form() {
|
||||
|
||||
wp_register_style( 'um_admin_form', $this->css_url . 'um-admin-form.css' );
|
||||
wp_enqueue_style( 'um_admin_form' );
|
||||
|
||||
wp_register_script( 'um_admin_form', $this->js_url . 'um-admin-form.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_form' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Form
|
||||
***/
|
||||
function load_forms() {
|
||||
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css' );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
|
||||
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_forms' );
|
||||
|
||||
$localize_data = array(
|
||||
'texts' => array(
|
||||
'remove' => __( 'Remove', 'ultimate-member' ),
|
||||
'select' => __( 'Select', 'ultimate-member' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_forms', 'php_data', $localize_data );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load dashboard
|
||||
***/
|
||||
function load_dashboard() {
|
||||
|
||||
wp_register_style( 'um_admin_dashboard', $this->css_url . 'um-admin-dashboard.css' );
|
||||
wp_enqueue_style( 'um_admin_dashboard' );
|
||||
|
||||
wp_register_script( 'um_admin_dashboard', $this->js_url . 'um-admin-dashboard.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_dashboard' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load settings
|
||||
***/
|
||||
function load_settings() {
|
||||
|
||||
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css' );
|
||||
wp_enqueue_style( 'um_admin_settings' );
|
||||
|
||||
wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_settings' );
|
||||
|
||||
$localize_data = array(
|
||||
'delete_email_template' => UM()->get_ajax_route( 'um\core\Mail', 'delete_email_template' ),
|
||||
'onbeforeunload_text' => __( 'Are sure, maybe some settings not saved', 'ultimate-member' ),
|
||||
'texts' => array(
|
||||
'remove' => __( 'Remove', 'ultimate-member' ),
|
||||
'select' => __( 'Select', 'ultimate-member' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_settings', 'php_data', $localize_data );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load modal
|
||||
***/
|
||||
function load_modal() {
|
||||
|
||||
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css' );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
|
||||
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_modal' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'dynamic_modal_content' ),
|
||||
'dropdown_ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'populate_dropdown_options' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_modal', 'um_admin_modal_data', $localize_data );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Field Processing
|
||||
***/
|
||||
function load_field() {
|
||||
|
||||
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_field' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'update_field' ),
|
||||
'do_ajax_url' => UM()->get_ajax_route( 'um\core\Fields', 'do_ajax_action' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_field', 'um_admin_field_data', $localize_data );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Builder
|
||||
***/
|
||||
function load_builder() {
|
||||
|
||||
wp_register_script( 'um_admin_builder', $this->js_url . 'um-admin-builder.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_builder' );
|
||||
|
||||
//hide footer text on add/edit UM Forms
|
||||
//layouts crashed because we load and hide metaboxes
|
||||
//and WP calculate page height
|
||||
$hide_footer = false;
|
||||
global $pagenow, $post;
|
||||
if ( ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) &&
|
||||
( ( isset( $_GET['post_type'] ) && 'um_form' == $_GET['post_type'] ) ||
|
||||
( isset( $post->post_type ) && 'um_form' == $post->post_type ) ) ) {
|
||||
$hide_footer = true;
|
||||
}
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'update_builder' ),
|
||||
'hide_footer' => $hide_footer,
|
||||
);
|
||||
wp_localize_script( 'um_admin_builder', 'um_admin_builder_data', $localize_data );
|
||||
|
||||
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_dragdrop' );
|
||||
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_DragDrop', 'update_order' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_dragdrop', 'um_admin_dragdrop_data', $localize_data );
|
||||
|
||||
|
||||
wp_register_style( 'um_admin_builder', $this->css_url . 'um-admin-builder.css' );
|
||||
wp_enqueue_style( 'um_admin_builder' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load core WP styles/scripts
|
||||
***/
|
||||
function load_core_wp() {
|
||||
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
|
||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||
wp_enqueue_script( 'jquery-ui-sortable' );
|
||||
|
||||
wp_enqueue_script( 'jquery-ui-tooltip' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Admin Styles
|
||||
***/
|
||||
function load_css() {
|
||||
|
||||
wp_register_style( 'um_admin_menu', $this->css_url . 'um-admin-menu.css' );
|
||||
wp_enqueue_style( 'um_admin_menu' );
|
||||
|
||||
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css' );
|
||||
wp_enqueue_style( 'um_admin_columns' );
|
||||
|
||||
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css' );
|
||||
wp_enqueue_style( 'um_admin_misc' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load functions js
|
||||
***/
|
||||
function load_functions() {
|
||||
|
||||
wp_register_script('um_functions', um_url . 'assets/js/um-functions' . '.js' );
|
||||
wp_enqueue_script('um_functions');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Fonticons
|
||||
***/
|
||||
function load_fonticons() {
|
||||
|
||||
wp_register_style('um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css' );
|
||||
wp_enqueue_style('um_fonticons_ii');
|
||||
|
||||
wp_register_style('um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css' );
|
||||
wp_enqueue_style('um_fonticons_fa');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load global css
|
||||
***/
|
||||
function load_global_css() {
|
||||
|
||||
wp_register_style( 'um_admin_global', $this->css_url . 'um-admin-global.css' );
|
||||
wp_enqueue_style( 'um_admin_global' );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load jQuery custom code
|
||||
***/
|
||||
function load_custom_scripts() {
|
||||
|
||||
wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_scripts' );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Load jQuery custom code
|
||||
***/
|
||||
function load_nav_manus_scripts() {
|
||||
|
||||
wp_register_script( 'um_admin_nav_manus', $this->js_url . 'um-admin-nav-menu.js', array('jquery','wp-util'), '', true );
|
||||
wp_enqueue_script( 'um_admin_nav_manus' );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Load AJAX
|
||||
***/
|
||||
function load_ajax_js() {
|
||||
|
||||
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_ajax' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\core\Fields', 'do_ajax_action' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_ajax', 'um_admin_ajax_data', $localize_data );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load localize scripts
|
||||
*/
|
||||
function load_localize_scripts(){
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_admin_enqueue_localize_data
|
||||
* @description Extend localize data at wp-admin side
|
||||
* @input_vars
|
||||
* [{"var":"$localize_data","type":"array","desc":"Localize Data"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_filter( 'um_admin_enqueue_localize_data', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_admin_enqueue_localize_data', 'my_admin_enqueue_localize_data', 10, 1 );
|
||||
* function my_admin_enqueue_localize_data( $localize_data ) {
|
||||
* // your code here
|
||||
* return $localize_data;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$localize_data = apply_filters('um_admin_enqueue_localize_data', array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_scripts', 'um_admin_scripts', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Boolean check if we're viewing UM backend
|
||||
***/
|
||||
function is_UM_admin() {
|
||||
global $current_screen;
|
||||
|
||||
$screen_id = $current_screen->id;
|
||||
if ( strstr( $screen_id, 'ultimatemember' ) || strstr( $screen_id, 'um_' ) || strstr( $screen_id, 'user' ) || strstr( $screen_id, 'profile' ) || $screen_id == 'nav-menus' ) return true;
|
||||
|
||||
global $post;
|
||||
if ( isset( $post->post_type ) ) return true;
|
||||
|
||||
global $tax;
|
||||
if ( isset( $tax->name ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Adds class to our admin pages
|
||||
***/
|
||||
function admin_body_class($classes){
|
||||
if ( $this->is_UM_admin() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Enqueue scripts and styles
|
||||
***/
|
||||
function admin_enqueue_scripts() {
|
||||
if ( $this->is_UM_admin() ) {
|
||||
|
||||
/*if ( get_post_type() != 'shop_order' ) {
|
||||
/**
|
||||
* Load js for Add/Edit User form
|
||||
*/
|
||||
function load_role_wrapper() {
|
||||
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_role_wrapper' );
|
||||
|
||||
$localize_roles_data = get_option( 'um_roles' );
|
||||
|
||||
wp_localize_script( 'um_admin_settings', 'um_roles', $localize_roles_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter title placeholder
|
||||
*
|
||||
* @param $title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function enter_title_here( $title ) {
|
||||
$screen = get_current_screen();
|
||||
if ( 'um_directory' == $screen->post_type ){
|
||||
$title = 'e.g. Member Directory';
|
||||
}
|
||||
if ( 'um_form' == $screen->post_type ){
|
||||
$title = 'e.g. New Registration Form';
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runs on admin head
|
||||
*/
|
||||
function admin_head() {
|
||||
if ( UM()->admin()->is_plugin_post_type() ) { ?>
|
||||
<style type="text/css">
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#slugdiv,
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#minor-publishing,
|
||||
.um-admin.post-type-<?php echo get_post_type(); ?> div#screen-meta-links
|
||||
{display:none}
|
||||
</style>
|
||||
<?php }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Form
|
||||
*/
|
||||
function load_form() {
|
||||
wp_register_style( 'um_admin_form', $this->css_url . 'um-admin-form.css' );
|
||||
wp_enqueue_style( 'um_admin_form' );
|
||||
|
||||
wp_register_script( 'um_admin_form', $this->js_url . 'um-admin-form.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_form' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Forms
|
||||
*/
|
||||
function load_forms() {
|
||||
wp_register_style( 'um_admin_forms', $this->css_url . 'um-admin-forms.css' );
|
||||
wp_enqueue_style( 'um_admin_forms' );
|
||||
|
||||
wp_register_script( 'um_admin_forms', $this->js_url . 'um-admin-forms.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_forms' );
|
||||
|
||||
$localize_data = array(
|
||||
'texts' => array(
|
||||
'remove' => __( 'Remove', 'ultimate-member' ),
|
||||
'select' => __( 'Select', 'ultimate-member' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_forms', 'php_data', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load dashboard
|
||||
*/
|
||||
function load_dashboard() {
|
||||
wp_register_style( 'um_admin_dashboard', $this->css_url . 'um-admin-dashboard.css' );
|
||||
wp_enqueue_style( 'um_admin_dashboard' );
|
||||
|
||||
wp_register_script( 'um_admin_dashboard', $this->js_url . 'um-admin-dashboard.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_dashboard' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load settings
|
||||
*/
|
||||
function load_settings() {
|
||||
wp_register_style( 'um_admin_settings', $this->css_url . 'um-admin-settings.css' );
|
||||
wp_enqueue_style( 'um_admin_settings' );
|
||||
|
||||
wp_register_script( 'um_admin_settings', $this->js_url . 'um-admin-settings.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_settings' );
|
||||
|
||||
$localize_data = array(
|
||||
'delete_email_template' => UM()->get_ajax_route( 'um\core\Mail', 'delete_email_template' ),
|
||||
'onbeforeunload_text' => __( 'Are sure, maybe some settings not saved', 'ultimate-member' ),
|
||||
'texts' => array(
|
||||
'remove' => __( 'Remove', 'ultimate-member' ),
|
||||
'select' => __( 'Select', 'ultimate-member' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_settings', 'php_data', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load modal
|
||||
*/
|
||||
function load_modal() {
|
||||
wp_register_style( 'um_admin_modal', $this->css_url . 'um-admin-modal.css' );
|
||||
wp_enqueue_style( 'um_admin_modal' );
|
||||
|
||||
wp_register_script( 'um_admin_modal', $this->js_url . 'um-admin-modal.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_modal' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'dynamic_modal_content' ),
|
||||
'dropdown_ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'populate_dropdown_options' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_modal', 'um_admin_modal_data', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Field Processing
|
||||
*/
|
||||
function load_field() {
|
||||
wp_register_script( 'um_admin_field', $this->js_url . 'um-admin-field.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_field' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'update_field' ),
|
||||
'do_ajax_url' => UM()->get_ajax_route( 'um\core\Fields', 'do_ajax_action' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_field', 'um_admin_field_data', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Builder
|
||||
*/
|
||||
function load_builder() {
|
||||
wp_register_script( 'um_admin_builder', $this->js_url . 'um-admin-builder.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_builder' );
|
||||
|
||||
//hide footer text on add/edit UM Forms
|
||||
//layouts crashed because we load and hide metaboxes
|
||||
//and WP calculate page height
|
||||
$hide_footer = false;
|
||||
global $pagenow, $post;
|
||||
if ( ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) &&
|
||||
( ( isset( $_GET['post_type'] ) && 'um_form' == $_GET['post_type'] ) ||
|
||||
( isset( $post->post_type ) && 'um_form' == $post->post_type ) ) ) {
|
||||
$hide_footer = true;
|
||||
}
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_Builder', 'update_builder' ),
|
||||
'hide_footer' => $hide_footer,
|
||||
);
|
||||
wp_localize_script( 'um_admin_builder', 'um_admin_builder_data', $localize_data );
|
||||
|
||||
wp_register_script( 'um_admin_dragdrop', $this->js_url . 'um-admin-dragdrop.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_dragdrop' );
|
||||
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\admin\core\Admin_DragDrop', 'update_order' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_dragdrop', 'um_admin_dragdrop_data', $localize_data );
|
||||
|
||||
|
||||
wp_register_style( 'um_admin_builder', $this->css_url . 'um-admin-builder.css' );
|
||||
wp_enqueue_style( 'um_admin_builder' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load core WP styles/scripts
|
||||
*/
|
||||
function load_core_wp() {
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
|
||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||
wp_enqueue_script( 'jquery-ui-sortable' );
|
||||
|
||||
wp_enqueue_script( 'jquery-ui-tooltip' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Admin Styles
|
||||
*/
|
||||
function load_css() {
|
||||
wp_register_style( 'um_admin_menu', $this->css_url . 'um-admin-menu.css' );
|
||||
wp_enqueue_style( 'um_admin_menu' );
|
||||
|
||||
wp_register_style( 'um_admin_columns', $this->css_url . 'um-admin-columns.css' );
|
||||
wp_enqueue_style( 'um_admin_columns' );
|
||||
|
||||
wp_register_style( 'um_admin_misc', $this->css_url . 'um-admin-misc.css' );
|
||||
wp_enqueue_style( 'um_admin_misc' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load functions js
|
||||
*/
|
||||
function load_functions() {
|
||||
wp_register_script( 'um_functions', um_url . 'assets/js/um-functions' . '.js' );
|
||||
wp_enqueue_script( 'um_functions' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load Fonticons
|
||||
*/
|
||||
function load_fonticons() {
|
||||
wp_register_style( 'um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css' );
|
||||
wp_enqueue_style( 'um_fonticons_ii' );
|
||||
|
||||
wp_register_style( 'um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css' );
|
||||
wp_enqueue_style( 'um_fonticons_fa' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load global css
|
||||
*/
|
||||
function load_global_css() {
|
||||
wp_register_style( 'um_admin_global', $this->css_url . 'um-admin-global.css' );
|
||||
wp_enqueue_style( 'um_admin_global' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load jQuery custom code
|
||||
*/
|
||||
function load_custom_scripts() {
|
||||
wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_scripts' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load jQuery custom code
|
||||
*/
|
||||
function load_nav_manus_scripts() {
|
||||
wp_register_script( 'um_admin_nav_manus', $this->js_url . 'um-admin-nav-menu.js', array('jquery','wp-util'), '', true );
|
||||
wp_enqueue_script( 'um_admin_nav_manus' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load AJAX
|
||||
*/
|
||||
function load_ajax_js() {
|
||||
wp_register_script( 'um_admin_ajax', $this->js_url . 'um-admin-ajax.js', '', '', true );
|
||||
wp_enqueue_script( 'um_admin_ajax' );
|
||||
|
||||
$localize_data = array(
|
||||
'ajax_url' => UM()->get_ajax_route( 'um\core\Fields', 'do_ajax_action' ),
|
||||
);
|
||||
wp_localize_script( 'um_admin_ajax', 'um_admin_ajax_data', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load localize scripts
|
||||
*/
|
||||
function load_localize_scripts() {
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
* @type filter
|
||||
* @title um_admin_enqueue_localize_data
|
||||
* @description Extend localize data at wp-admin side
|
||||
* @input_vars
|
||||
* [{"var":"$localize_data","type":"array","desc":"Localize Data"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage add_filter( 'um_admin_enqueue_localize_data', 'function_name', 10, 1 );
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_admin_enqueue_localize_data', 'my_admin_enqueue_localize_data', 10, 1 );
|
||||
* function my_admin_enqueue_localize_data( $localize_data ) {
|
||||
* // your code here
|
||||
* return $localize_data;
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$localize_data = apply_filters('um_admin_enqueue_localize_data', array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' )
|
||||
)
|
||||
);
|
||||
|
||||
wp_localize_script( 'um_admin_scripts', 'um_admin_scripts', $localize_data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Boolean check if we're viewing UM backend
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_UM_admin() {
|
||||
global $current_screen;
|
||||
|
||||
$screen_id = $current_screen->id;
|
||||
if ( strstr( $screen_id, 'ultimatemember' ) || strstr( $screen_id, 'um_' ) || strstr( $screen_id, 'user' ) || strstr( $screen_id, 'profile' ) || $screen_id == 'nav-menus' ) return true;
|
||||
|
||||
global $post;
|
||||
if ( isset( $post->post_type ) ) return true;
|
||||
|
||||
global $tax;
|
||||
if ( isset( $tax->name ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds class to our admin pages
|
||||
*
|
||||
* @param $classes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function admin_body_class( $classes ) {
|
||||
if ( $this->is_UM_admin() ) {
|
||||
return "$classes um-admin";
|
||||
}
|
||||
return $classes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
function admin_enqueue_scripts() {
|
||||
if ( $this->is_UM_admin() ) {
|
||||
|
||||
/*if ( get_post_type() != 'shop_order' ) {
|
||||
UM()->enqueue()->wp_enqueue_scripts();
|
||||
}*/
|
||||
|
||||
$this->load_functions();
|
||||
$this->load_global_css();
|
||||
$this->load_form();
|
||||
$this->load_forms();
|
||||
$this->load_modal();
|
||||
$this->load_dashboard();
|
||||
$this->load_settings();
|
||||
$this->load_field();
|
||||
$this->load_builder();
|
||||
$this->load_css();
|
||||
$this->load_core_wp();
|
||||
$this->load_ajax_js();
|
||||
$this->load_custom_scripts();
|
||||
$this->load_fonticons();
|
||||
$this->load_localize_scripts();
|
||||
$this->load_functions();
|
||||
$this->load_global_css();
|
||||
$this->load_form();
|
||||
$this->load_forms();
|
||||
$this->load_modal();
|
||||
$this->load_dashboard();
|
||||
$this->load_settings();
|
||||
$this->load_field();
|
||||
$this->load_builder();
|
||||
$this->load_css();
|
||||
$this->load_core_wp();
|
||||
$this->load_ajax_js();
|
||||
$this->load_custom_scripts();
|
||||
$this->load_fonticons();
|
||||
$this->load_localize_scripts();
|
||||
|
||||
|
||||
//scripts for frontend preview
|
||||
UM()->enqueue()->load_imagecrop();
|
||||
UM()->enqueue()->load_css();
|
||||
UM()->enqueue()->load_tipsy();
|
||||
UM()->enqueue()->load_modal();
|
||||
UM()->enqueue()->load_responsive();
|
||||
//scripts for frontend preview
|
||||
UM()->enqueue()->load_imagecrop();
|
||||
UM()->enqueue()->load_css();
|
||||
UM()->enqueue()->load_tipsy();
|
||||
UM()->enqueue()->load_modal();
|
||||
UM()->enqueue()->load_responsive();
|
||||
|
||||
wp_register_style('um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style('um_default_css');
|
||||
wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style( 'um_default_css' );
|
||||
|
||||
if ( is_rtl() ) {
|
||||
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css' );
|
||||
wp_enqueue_style( 'um_admin_rtl' );
|
||||
}
|
||||
if ( is_rtl() ) {
|
||||
wp_register_style( 'um_admin_rtl', $this->css_url . 'um-admin-rtl.css' );
|
||||
wp_enqueue_style( 'um_admin_rtl' );
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$this->load_global_css();
|
||||
$this->load_global_css();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -695,7 +695,7 @@ if ( ! class_exists( 'Admin_Metabox' ) ) {
|
||||
|
||||
$roles_metaboxes = array(
|
||||
array(
|
||||
'id' => 'um-admin-form-admin',
|
||||
'id' => 'um-admin-form-admin-permissions',
|
||||
'title' => __( 'Administrative Permissions', 'ultimate-member' ),
|
||||
'callback' => $callback,
|
||||
'screen' => 'um_role_meta',
|
||||
|
||||
@@ -1,171 +1,275 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) )
|
||||
exit; // Exit if accessed directly
|
||||
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
global $wpdb;
|
||||
|
||||
if ( isset($_REQUEST['_wp_http_referer']) ) {
|
||||
$redirect = remove_query_arg(array('_wp_http_referer' ), wp_unslash( $_REQUEST['_wp_http_referer'] ) );
|
||||
$redirect = remove_query_arg(array('_wp_http_referer' ), wp_unslash( $_REQUEST['_wp_http_referer'] ) );
|
||||
} else {
|
||||
$redirect = get_admin_url(). 'admin.php?page=ultimatemember';
|
||||
$redirect = get_admin_url(). 'admin.php?page=ultimatemember';
|
||||
}
|
||||
|
||||
//remove extra query arg
|
||||
if ( !empty( $_GET['_wp_http_referer'] ) ) {
|
||||
um_js_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
um_js_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
}
|
||||
|
||||
$order_by = 'u.user_registered';
|
||||
if ( isset( $_GET['orderby'] ) ) {
|
||||
switch( $_GET['orderby'] ) {
|
||||
case 'username' :
|
||||
$order_by = 'u.user_login';
|
||||
break;
|
||||
case 'nickname' :
|
||||
$order_by = 'u.user_nicename';
|
||||
break;
|
||||
case 'email' :
|
||||
$order_by = 'u.user_email';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$order = ( isset( $_GET['order'] ) && 'asc' == strtolower( $_GET['order'] ) ) ? 'ASC' : 'DESC';
|
||||
|
||||
|
||||
if( ! class_exists( 'WP_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
|
||||
|
||||
/**
|
||||
* Class UM_Emails_List_Table
|
||||
*/
|
||||
class UM_Emails_List_Table extends WP_List_Table {
|
||||
|
||||
var $no_items_message = '';
|
||||
var $sortable_columns = array();
|
||||
var $default_sorting_field = '';
|
||||
var $actions = array();
|
||||
var $bulk_actions = array();
|
||||
var $columns = array();
|
||||
|
||||
function __construct( $args = array() ){
|
||||
$args = wp_parse_args( $args, array(
|
||||
'singular' => __( 'item', 'ultimate-member' ),
|
||||
'plural' => __( 'items', 'ultimate-member' ),
|
||||
'ajax' => false
|
||||
) );
|
||||
|
||||
$this->no_items_message = $args['plural'] . ' ' . __( 'not found.', 'ultimate-member' );
|
||||
|
||||
parent::__construct( $args );
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $no_items_message = '';
|
||||
|
||||
|
||||
}
|
||||
|
||||
function __call( $name, $arguments ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
$columns = $this->get_columns();
|
||||
$hidden = array();
|
||||
$sortable = $this->get_sortable_columns();
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
}
|
||||
|
||||
function column_default( $item, $column_name ) {
|
||||
if( isset( $item[ $column_name ] ) ) {
|
||||
return $item[ $column_name ];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
echo $this->no_items_message;
|
||||
}
|
||||
|
||||
function set_sortable_columns( $args = array() ) {
|
||||
$return_args = array();
|
||||
foreach( $args as $k=>$val ) {
|
||||
if( is_numeric( $k ) ) {
|
||||
$return_args[ $val ] = array( $val, $val == $this->default_sorting_field );
|
||||
} else if( is_string( $k ) ) {
|
||||
$return_args[ $k ] = array( $val, $k == $this->default_sorting_field );
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->sortable_columns = $return_args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return $this->sortable_columns;
|
||||
}
|
||||
|
||||
function set_columns( $args = array() ) {
|
||||
if ( count( $this->bulk_actions ) ) {
|
||||
$args = array_merge( array( 'cb' => '<input type="checkbox" />' ), $args );
|
||||
}
|
||||
$this->columns = $args;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
function set_actions( $args = array() ) {
|
||||
$this->actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function get_actions() {
|
||||
return $this->actions;
|
||||
}
|
||||
|
||||
function set_bulk_actions( $args = array() ) {
|
||||
$this->bulk_actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
return $this->bulk_actions;
|
||||
}
|
||||
|
||||
function column_email( $item ) {
|
||||
$active = UM()->options()->get( $item['key'] . '_on' );
|
||||
|
||||
return '<span class="dashicons um-notification-status ' . ( ! empty( $active ) ? 'um-notification-is-active dashicons-yes' : 'dashicons-no-alt' ) . '"></span><a href="' . add_query_arg( array( 'email' => $item['key'] ) ) . '"><strong>'. $item['title'] . '</strong></a>';
|
||||
}
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $sortable_columns = array();
|
||||
|
||||
|
||||
function column_recipients( $item ) {
|
||||
if ( $item['recipient'] == 'admin' )
|
||||
return UM()->options()->get( 'admin_email' );
|
||||
else
|
||||
return __( 'Member', 'ultimate-member' );
|
||||
}
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $default_sorting_field = '';
|
||||
|
||||
|
||||
function column_configure( $item ) {
|
||||
return '<a class="button um-email-configure" href="' . add_query_arg( array( 'email' => $item['key'] ) ) . '"><span class="dashicons dashicons-admin-generic"></span></a>';
|
||||
}
|
||||
|
||||
function column_icl_translations( $item ) {
|
||||
return UM()->external_integrations()->wpml_column_content( $item );
|
||||
}
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $actions = array();
|
||||
|
||||
|
||||
function wpc_set_pagination_args( $attr = array() ) {
|
||||
$this->set_pagination_args( $attr );
|
||||
}
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $bulk_actions = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $columns = array();
|
||||
|
||||
|
||||
/**
|
||||
* UM_Emails_List_Table constructor.
|
||||
*
|
||||
* @param array $args
|
||||
*/
|
||||
function __construct( $args = array() ){
|
||||
$args = wp_parse_args( $args, array(
|
||||
'singular' => __( 'item', 'ultimate-member' ),
|
||||
'plural' => __( 'items', 'ultimate-member' ),
|
||||
'ajax' => false
|
||||
) );
|
||||
|
||||
$this->no_items_message = $args['plural'] . ' ' . __( 'not found.', 'ultimate-member' );
|
||||
|
||||
parent::__construct( $args );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $name
|
||||
* @param array $arguments
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function __call( $name, $arguments ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function prepare_items() {
|
||||
$columns = $this->get_columns();
|
||||
$hidden = array();
|
||||
$sortable = $this->get_sortable_columns();
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $item
|
||||
* @param string $column_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_default( $item, $column_name ) {
|
||||
if( isset( $item[ $column_name ] ) ) {
|
||||
return $item[ $column_name ];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function no_items() {
|
||||
echo $this->no_items_message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_sortable_columns( $args = array() ) {
|
||||
$return_args = array();
|
||||
foreach( $args as $k=>$val ) {
|
||||
if( is_numeric( $k ) ) {
|
||||
$return_args[ $val ] = array( $val, $val == $this->default_sorting_field );
|
||||
} else if( is_string( $k ) ) {
|
||||
$return_args[ $k ] = array( $val, $k == $this->default_sorting_field );
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->sortable_columns = $return_args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_sortable_columns() {
|
||||
return $this->sortable_columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_columns( $args = array() ) {
|
||||
if ( count( $this->bulk_actions ) ) {
|
||||
$args = array_merge( array( 'cb' => '<input type="checkbox" />' ), $args );
|
||||
}
|
||||
$this->columns = $args;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_columns() {
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_actions( $args = array() ) {
|
||||
$this->actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_actions() {
|
||||
return $this->actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_bulk_actions( $args = array() ) {
|
||||
$this->bulk_actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_bulk_actions() {
|
||||
return $this->bulk_actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_email( $item ) {
|
||||
$active = UM()->options()->get( $item['key'] . '_on' );
|
||||
|
||||
return '<span class="dashicons um-notification-status ' . ( ! empty( $active ) ? 'um-notification-is-active dashicons-yes' : 'dashicons-no-alt' ) . '"></span><a href="' . add_query_arg( array( 'email' => $item['key'] ) ) . '"><strong>'. $item['title'] . '</strong></a>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return mixed|string|void
|
||||
*/
|
||||
function column_recipients( $item ) {
|
||||
if ( $item['recipient'] == 'admin' )
|
||||
return UM()->options()->get( 'admin_email' );
|
||||
else
|
||||
return __( 'Member', 'ultimate-member' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_configure( $item ) {
|
||||
return '<a class="button um-email-configure" href="' . add_query_arg( array( 'email' => $item['key'] ) ) . '"><span class="dashicons dashicons-admin-generic"></span></a>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_icl_translations( $item ) {
|
||||
return UM()->external_integrations()->wpml_column_content( $item );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $attr
|
||||
*/
|
||||
function wpc_set_pagination_args( $attr = array() ) {
|
||||
$this->set_pagination_args( $attr );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$ListTable = new UM_Emails_List_Table( array(
|
||||
'singular' => __( 'Email Notification', 'ultimate-member' ),
|
||||
'plural' => __( 'Email Notifications', 'ultimate-member' ),
|
||||
'ajax' => false
|
||||
'singular' => __( 'Email Notification', 'ultimate-member' ),
|
||||
'plural' => __( 'Email Notifications', 'ultimate-member' ),
|
||||
'ajax' => false
|
||||
));
|
||||
|
||||
$per_page = 20;
|
||||
@@ -207,11 +311,11 @@ $ListTable->items = $emails;
|
||||
$ListTable->wpc_set_pagination_args( array( 'total_items' => count( $emails ), 'per_page' => $per_page ) ); ?>
|
||||
|
||||
<form action="" method="get" name="um-settings-emails" id="um-settings-emails">
|
||||
<input type="hidden" name="page" value="um_options" />
|
||||
<input type="hidden" name="tab" value="email" />
|
||||
<?php if ( ! empty( $_GET['section'] ) ) { ?>
|
||||
<input type="hidden" name="section" value="<?php echo $_GET['section'] ?>" />
|
||||
<?php }
|
||||
<input type="hidden" name="page" value="um_options" />
|
||||
<input type="hidden" name="tab" value="email" />
|
||||
<?php if ( ! empty( $_GET['section'] ) ) { ?>
|
||||
<input type="hidden" name="section" value="<?php echo $_GET['section'] ?>" />
|
||||
<?php }
|
||||
|
||||
$ListTable->display(); ?>
|
||||
$ListTable->display(); ?>
|
||||
</form>
|
||||
@@ -120,15 +120,53 @@ if( ! class_exists( 'WP_List_Table' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
|
||||
|
||||
/**
|
||||
* Class UM_Roles_List_Table
|
||||
*/
|
||||
class UM_Roles_List_Table extends WP_List_Table {
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $no_items_message = '';
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $sortable_columns = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
var $default_sorting_field = '';
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $actions = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $bulk_actions = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
var $columns = array();
|
||||
|
||||
|
||||
/**
|
||||
* UM_Roles_List_Table constructor.
|
||||
*
|
||||
* @param array $args
|
||||
*/
|
||||
function __construct( $args = array() ){
|
||||
$args = wp_parse_args( $args, array(
|
||||
'singular' => __( 'item', 'ultimate-member' ),
|
||||
@@ -139,14 +177,23 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
$this->no_items_message = $args['plural'] . ' ' . __( 'not found.', 'ultimate-member' );
|
||||
|
||||
parent::__construct( $args );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param callable $name
|
||||
* @param array $arguments
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function __call( $name, $arguments ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function prepare_items() {
|
||||
$columns = $this->get_columns();
|
||||
$hidden = array();
|
||||
@@ -154,6 +201,13 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $item
|
||||
* @param string $column_name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_default( $item, $column_name ) {
|
||||
if( isset( $item[ $column_name ] ) ) {
|
||||
return $item[ $column_name ];
|
||||
@@ -162,10 +216,20 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function no_items() {
|
||||
echo $this->no_items_message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_sortable_columns( $args = array() ) {
|
||||
$return_args = array();
|
||||
foreach( $args as $k=>$val ) {
|
||||
@@ -181,10 +245,20 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_sortable_columns() {
|
||||
return $this->sortable_columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_columns( $args = array() ) {
|
||||
if( count( $this->bulk_actions ) ) {
|
||||
$args = array_merge( array( 'cb' => '<input type="checkbox" />' ), $args );
|
||||
@@ -193,34 +267,68 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_columns() {
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_actions( $args = array() ) {
|
||||
$this->actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_actions() {
|
||||
return $this->actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
function set_bulk_actions( $args = array() ) {
|
||||
$this->bulk_actions = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_bulk_actions() {
|
||||
return $this->bulk_actions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param object $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_cb( $item ) {
|
||||
return sprintf( '<input type="checkbox" name="item[]" value="%s" />', $item['key'] );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_title( $item ) {
|
||||
$actions = array();
|
||||
|
||||
@@ -241,26 +349,44 @@ class UM_Roles_List_Table extends WP_List_Table {
|
||||
return sprintf('%1$s %2$s', '<strong><a class="row-title" href="admin.php?page=um_roles&tab=edit&id=' . $item['key'] . '">' . $item['name'] . '</a></strong>', $this->row_actions( $actions ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function column_roleid( $item ) {
|
||||
return ! empty( $item['_um_is_custom'] ) ? 'um_' . $item['key'] : $item['key'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*/
|
||||
function column_core( $item ) {
|
||||
echo ! empty( $item['_um_is_custom'] ) ? __( 'Yes', 'ultimate-member' ) : __( 'No', 'ultimate-member' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*/
|
||||
function column_admin_access( $item ) {
|
||||
echo ! empty( $item['_um_can_access_wpadmin'] ) ? __( 'Yes', 'ultimate-member' ) : __( 'No', 'ultimate-member' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $item
|
||||
*/
|
||||
function column_priority( $item ) {
|
||||
echo ! empty( $item['_um_priority'] ) ? $item['_um_priority'] : '-';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $attr
|
||||
*/
|
||||
function um_set_pagination_args( $attr = array() ) {
|
||||
$this->set_pagination_args( $attr );
|
||||
}
|
||||
@@ -332,17 +458,11 @@ foreach ( $wp_roles->roles as $roleID => $role_data ) {
|
||||
switch( strtolower( $order ) ) {
|
||||
case 'asc':
|
||||
uasort( $roles, function( $a, $b ) {
|
||||
//$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
|
||||
//$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
|
||||
|
||||
return strnatcmp( $a['name'], $b['name'] );
|
||||
} );
|
||||
break;
|
||||
case 'desc':
|
||||
uasort( $roles, function( $a, $b ) {
|
||||
//$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
|
||||
//$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
|
||||
|
||||
return strnatcmp( $a['name'], $b['name'] ) * -1;
|
||||
} );
|
||||
break;
|
||||
@@ -355,7 +475,9 @@ $ListTable->um_set_pagination_args( array( 'total_items' => count( $roles ), 'pe
|
||||
<div class="wrap">
|
||||
<h2>
|
||||
<?php _e( 'User Roles', 'ultimate-member' ) ?>
|
||||
<a class="add-new-h2" href="<?php echo add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ?>"><?php _e( 'Add New', 'ultimate-member' ) ?></a>
|
||||
<a class="add-new-h2" href="<?php echo add_query_arg( array( 'page' => 'um_roles', 'tab' => 'add' ), admin_url( 'admin.php' ) ) ?>">
|
||||
<?php _e( 'Add New', 'ultimate-member' ) ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<?php if ( ! empty( $_GET['msg'] ) ) {
|
||||
|
||||
@@ -1,27 +1,19 @@
|
||||
<?php
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
/**
|
||||
* This populates all existing UM users with meta_key `last_login` as `user_registered` if the meta key doesn't exist.
|
||||
* Target Version: 1.3.39
|
||||
*/
|
||||
|
||||
global $wpdb;
|
||||
$wpdb->query('INSERT INTO '.$wpdb->usermeta.'(user_id, meta_key, meta_value)
|
||||
SELECT uu.ID, "_um_last_login", uu.user_registered
|
||||
FROM '.$wpdb->users.' AS uu
|
||||
WHERE
|
||||
uu.ID NOT IN(
|
||||
SELECT user_id FROM '.$wpdb->usermeta.'
|
||||
WHERE meta_key = "_um_last_login"
|
||||
GROUP BY user_id
|
||||
)'
|
||||
);
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
|
||||
?>
|
||||
/**
|
||||
* This populates all existing UM users with meta_key `last_login` as `user_registered` if the meta key doesn't exist.
|
||||
* Target Version: 1.3.39
|
||||
*/
|
||||
global $wpdb;
|
||||
$wpdb->query(
|
||||
'INSERT INTO '.$wpdb->usermeta.'(user_id, meta_key, meta_value)
|
||||
SELECT uu.ID, "_um_last_login", uu.user_registered
|
||||
FROM '.$wpdb->users.' AS uu
|
||||
WHERE uu.ID NOT IN(
|
||||
SELECT user_id FROM '.$wpdb->usermeta.'
|
||||
WHERE meta_key = "_um_last_login"
|
||||
GROUP BY user_id
|
||||
)'
|
||||
);
|
||||
@@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) )
|
||||
|
||||
/**
|
||||
* This populates all existing UM users with meta_key `last_login` as `user_registered` if the meta key doesn't exist.
|
||||
* Target Version: 1.3.39
|
||||
* Target Version: 2.0
|
||||
*/
|
||||
|
||||
global $wpdb;
|
||||
|
||||
@@ -35,7 +35,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
|
||||
'private-content' => '2.0',
|
||||
'profile-completeness' => '2.0.1',
|
||||
'recaptcha' => '2.0',
|
||||
'reviews' => '2.0.1',
|
||||
'reviews' => '2.0.2',
|
||||
'social-activity' => '2.0.1',
|
||||
'social-login' => '2.0.1',
|
||||
'terms-conditions' => '2.0',
|
||||
|
||||
@@ -1030,20 +1030,6 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
* @return um\core\Menu
|
||||
*/
|
||||
function menu() {
|
||||
if ( empty( $this->classes['menu'] ) ) {
|
||||
$this->classes['menu'] = new um\core\Menu();
|
||||
}
|
||||
|
||||
return $this->classes['menu'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
*
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'Menu' ) ) {
|
||||
class Menu {
|
||||
|
||||
function __construct() {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @new menu
|
||||
***/
|
||||
function new_ui( $position, $element, $trigger, $items ) {
|
||||
|
||||
?>
|
||||
|
||||
<div class="um-dropdown" data-element="<?php echo $element; ?>" data-position="<?php echo $position; ?>" data-trigger="<?php echo $trigger; ?>">
|
||||
<div class="um-dropdown-b">
|
||||
<div class="um-dropdown-arr"><i class=""></i></div>
|
||||
<ul>
|
||||
<?php foreach( $items as $k => $v ) { ?>
|
||||
|
||||
<li><?php echo $v; ?></li>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,10 @@ if ( ! class_exists( 'Profile' ) ) {
|
||||
|
||||
|
||||
function ajax_delete_profile_photo() {
|
||||
extract( $_REQUEST );
|
||||
/**
|
||||
* @var $user_id
|
||||
*/
|
||||
extract( $_REQUEST );
|
||||
|
||||
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) )
|
||||
die( __( 'You can not edit this user' ) );
|
||||
@@ -31,7 +34,10 @@ if ( ! class_exists( 'Profile' ) ) {
|
||||
|
||||
|
||||
function ajax_delete_cover_photo() {
|
||||
extract($_REQUEST);
|
||||
/**
|
||||
* @var $user_id
|
||||
*/
|
||||
extract( $_REQUEST );
|
||||
|
||||
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) )
|
||||
die( __( 'You can not edit this user' ) );
|
||||
@@ -284,5 +290,30 @@ if ( ! class_exists( 'Profile' ) ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* New menu
|
||||
*
|
||||
* @param string $position
|
||||
* @param string $element
|
||||
* @param string $trigger
|
||||
* @param array $items
|
||||
*/
|
||||
function new_ui( $position, $element, $trigger, $items ) {
|
||||
?>
|
||||
|
||||
<div class="um-dropdown" data-element="<?php echo $element; ?>" data-position="<?php echo $position; ?>" data-trigger="<?php echo $trigger; ?>">
|
||||
<div class="um-dropdown-b">
|
||||
<div class="um-dropdown-arr"><i class=""></i></div>
|
||||
<ul>
|
||||
<?php foreach ( $items as $k => $v ) { ?>
|
||||
<li><?php echo $v; ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -592,7 +592,7 @@ add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
|
||||
'<a href="#" class="um-dropdown-hide">' . __( 'Cancel', 'ultimate-member' ) . '</a>',
|
||||
);
|
||||
|
||||
echo UM()->menu()->new_ui( 'bc', 'div.um-cover', 'click', $items );
|
||||
echo UM()->profile()->new_ui( 'bc', 'div.um-cover', 'click', $items );
|
||||
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
|
||||
*/
|
||||
$items = apply_filters( 'um_user_photo_menu_view', $items );
|
||||
|
||||
echo UM()->menu()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
|
||||
echo UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
|
||||
|
||||
} else if (UM()->fields()->editing == true) {
|
||||
|
||||
@@ -782,7 +782,7 @@ add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
|
||||
*/
|
||||
$items = apply_filters( 'um_user_photo_menu_edit', $items );
|
||||
|
||||
echo UM()->menu()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
|
||||
echo UM()->profile()->new_ui( 'bc', 'div.um-profile-photo', 'click', $items );
|
||||
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
|
||||
|
||||
}
|
||||
|
||||
UM()->menu()->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items );
|
||||
UM()->profile()->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items );
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user