mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Version 1.0.42
This commit is contained in:
@@ -175,6 +175,12 @@
|
||||
cursor: move !important;
|
||||
}
|
||||
|
||||
.um-admin-drag-fld-title i {
|
||||
width: 24px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.um-admin-drag-fld.um-field-type-group {background: #555;border: 0}
|
||||
.um-admin-drag-fld-title.um-field-type-group,.um-admin-drag-fld-type.um-field-type-group {color: #fff}
|
||||
.um-admin-drag-group {background: #FCFCFC;cursor: default;padding: 20px;border: 1px dashed #bbb;}
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.redux-container #import_export_default_section_group h4 {
|
||||
margin: 0 0 12px 0 !important;
|
||||
}
|
||||
|
||||
.redux-container #import_export_default_section_group .hr {
|
||||
height: 4px !important;
|
||||
}
|
||||
|
||||
.redux-sidebar .redux-group-menu li.active a, .redux-sidebar .redux-group-menu li.active a:hover, .redux-sidebar .redux-group-menu li.activeChild a, .redux-sidebar .redux-group-menu li.activeChild a:hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
@@ -340,6 +340,12 @@
|
||||
|
||||
case 'um_admin_preview_form':
|
||||
|
||||
$mode = $ultimatemember->query->get_attr('mode', $arg1 );
|
||||
|
||||
if ( $mode == 'profile' ) {
|
||||
$ultimatemember->fields->editing = true;
|
||||
}
|
||||
|
||||
$output = do_shortcode('[ultimatemember form_id='.$arg1.']');
|
||||
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,47 @@
|
||||
<?php
|
||||
|
||||
/***
|
||||
*** @duplicate form
|
||||
***/
|
||||
add_action('um_admin_do_action__duplicate_form', 'um_admin_do_action__duplicate_form');
|
||||
function um_admin_do_action__duplicate_form( $action ){
|
||||
global $ultimatemember;
|
||||
if ( !is_admin() || !current_user_can('manage_options') ) die();
|
||||
if ( !isset($_REQUEST['post_id']) || !is_numeric( $_REQUEST['post_id'] ) ) die();
|
||||
|
||||
$post_id = $_REQUEST['post_id'];
|
||||
|
||||
$n = array(
|
||||
'post_type' => 'um_form',
|
||||
'post_title' => sprintf(__('Duplicate of %s','ultimatemember'), get_the_title($post_id) ),
|
||||
'post_status' => 'publish',
|
||||
'post_author' => um_user('ID'),
|
||||
);
|
||||
|
||||
$n_id = wp_insert_post( $n );
|
||||
|
||||
$n_fields = get_post_custom( $post_id );
|
||||
foreach ( $n_fields as $key => $value ) {
|
||||
|
||||
if ( $key == '_um_custom_fields' ) {
|
||||
$the_value = unserialize( $value[0] );
|
||||
} else {
|
||||
$the_value = $value[0];
|
||||
}
|
||||
|
||||
update_post_meta( $n_id, $key, $the_value );
|
||||
|
||||
}
|
||||
|
||||
delete_post_meta($n_id, '_um_core');
|
||||
|
||||
$url = admin_url('edit.php?post_type=um_form');
|
||||
$url = add_query_arg('update','form_duplicated',$url);
|
||||
|
||||
exit( wp_redirect( $url ) );
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @download a language remotely
|
||||
***/
|
||||
|
||||
@@ -12,6 +12,28 @@ class UM_Admin_Columns {
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @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','ultimatemember') . '</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;
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -110,6 +110,10 @@ class UM_Admin_Notices {
|
||||
|
||||
$update = $_REQUEST['update'];
|
||||
switch($update) {
|
||||
|
||||
case 'form_duplicated':
|
||||
$messages[0]['content'] = __('The form has been duplicated successfully.','ultimatemember');
|
||||
break;
|
||||
|
||||
case 'user_updated':
|
||||
$messages[0]['content'] = __('User has been updated.','ultimatemember');
|
||||
|
||||
Reference in New Issue
Block a user