-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy-move-posts-admin-page.php
More file actions
74 lines (73 loc) · 2.49 KB
/
copy-move-posts-admin-page.php
File metadata and controls
74 lines (73 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<script type="text/javascript">
if(typeof jQuery == 'undefined')
{
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></'+'script>');
}
jQuery(document).ready(function ($) {
$("#convert_post").submit(function () {
var isnum = /^\d+$/;
var need=$('#needCount').val();
if(!isnum.test(need))
{
if(need==-1)
{
return true;
}
else if(need<-1)
{
alert("Please enter value bigger than -1.");
$('#needCount').val(-1);
return false;
}
else
{
alert("Please enter only numeric value.");
$('#needCount').val(-1);
return false;
}
}
$(".submitBtn").css("display", 'none');
$(".sbt_text").css("display", 'block');
return true;
});
});
</script>
<style type="text/css">
.sbt_text{display: none;}
</style>
<div>
<form method="post" action='' id="convert_post">
<div class="what_want">
<h3>What you want to do with Posts?</h3>
<input type="radio" name="cmp" checked="checked" value="1">Copy
<span><b> OR </b></span>
<input type="radio" name="cmp" value="2">Move
</div><br>
<div class="post_type">
<span><b>From:</b></span>
<?php $post_type=apply_filters('CPMV_get_posts_types',''); //echo "<pre>"; print_r($post_type);?>
<select name="post_from">
<?php foreach ($post_type as $types) { ?>
<option value="<?php echo $types->name;?>"><?php echo $types->labels->name?> (<?php echo $types->name;?>)</option>
<?php }?>
</select>
<span><b>To:</b></span>
<select name="post_to">
<?php foreach ($post_type as $types) { ?>
<option value="<?php echo $types->name;?>"><?php echo $types->labels->name?> (<?php echo $types->name;?>)</option>
<?php }?>
</select>
</div><br>
<span><b>Enter post count that you want to copy or move:</b></span>
<input type="text" name="need_count" id="needCount" value="-1"><span> -1 means all posts.</span>
<br>
<br>
<input type="submit" value="Complete" class="button-primary submitBtn" name="change_post">
<p class="sbt_text">Please wait, While Processing...</p>
<br><br>
<b>Note:-</b> Please take the database backup first then try.
<br>
<br>
Please rate and review it <a href="https://wordpress.org/support/plugin/copy-move-posts/reviews/" target="_blank">wordpress.org</a> to spread the love.
</form>
</div>