Changeset 2724113
- Timestamp:
- 05/15/2022 02:09:03 PM (4 years ago)
- Location:
- copy-move-posts/trunk
- Files:
-
- 3 edited
-
copy-move-posts-admin-page.php (modified) (2 diffs)
-
copy-move-posts-function.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
copy-move-posts/trunk/copy-move-posts-admin-page.php
r2380329 r2724113 5 5 } 6 6 jQuery(document).ready(function ($) { 7 //alert("helo");8 7 $("#convert_post").submit(function () { 9 8 var isnum = /^\d+$/; … … 49 48 <?php $post_type=apply_filters('CPMV_get_posts_types',''); //echo "<pre>"; print_r($post_type);?> 50 49 <select name="post_from"> 51 <?php foreach ($post_type as $types) { 52 if($types->name!='attachment' && $types->name!='revision' && $types->name!='nav_menu_item' && $types->name!='custom_css' && $types->name!='customize_changeset' && $types->name!='oembed_cache' && $types->name!='user_request' && $types->name!='wp_block') {?> 50 <?php foreach ($post_type as $types) { ?> 53 51 <option value="<?php echo $types->name;?>"><?php echo $types->labels->name?> (<?php echo $types->name;?>)</option> 54 <?php } }?>52 <?php }?> 55 53 </select> 56 54 <span><b>To:</b></span> 57 55 <select name="post_to"> 58 <?php foreach ($post_type as $types) { 59 if($types->name!='attachment' && $types->name!='revision' && $types->name!='nav_menu_item' && $types->name!='custom_css' && $types->name!='customize_changeset' && $types->name!='oembed_cache' && $types->name!='user_request' && $types->name!='wp_block') {?> 56 <?php foreach ($post_type as $types) { ?> 60 57 <option value="<?php echo $types->name;?>"><?php echo $types->labels->name?> (<?php echo $types->name;?>)</option> 61 <?php } }?>58 <?php }?> 62 59 </select> 63 60 </div><br> -
copy-move-posts/trunk/copy-move-posts-function.php
r2380329 r2724113 3 3 Plugin Name: Copy Move posts 4 4 Author: Ujjaval Jani 5 Version: 1. 55 Version: 1.6 6 6 Description: You can Copy or Move posts from one Post type to another Post type with custom field,thumbnail and meta information. 7 7 License: GPLv3 … … 15 15 function CPMV_get_posts_types() 16 16 { 17 $post_types=get_post_types('',''); 17 $get_cpt_args = array( 18 'public' => true, 19 ); 20 $post_types=get_post_types($get_cpt_args,'object'); 21 unset($post_types['attachment']); 18 22 return $post_types; 19 23 } … … 40 44 $pagination=-1; 41 45 } 42 if(filter_var($_POST['cmp'], FILTER_SANITIZE_STRING)==1) 46 if(filter_var($_POST['cmp'], FILTER_SANITIZE_STRING)==1) ///Copy posts 43 47 { 44 48 global $wpdb; … … 78 82 //print_r($my_post); 79 83 //exit(); 80 $post_id=wp_insert_post( $my_post , $wp_error);84 $post_id=wp_insert_post( $my_post , true); 81 85 } 82 86 else … … 91 95 'post_type' => filter_var($_POST['post_to'],FILTER_SANITIZE_STRING), 92 96 ); 93 $post_id=wp_insert_post( $my_post , $wp_error);97 $post_id=wp_insert_post( $my_post , true); 94 98 95 99 foreach ($post_meta as $key => $value) { … … 100 104 } 101 105 } 102 elseif(filter_var($_POST['cmp'], FILTER_SANITIZE_STRING)==2) 103 { 106 elseif(filter_var($_POST['cmp'], FILTER_SANITIZE_STRING)==2) ///Move posts 107 { 104 108 global $wpdb; 105 109 $args = array('post_type'=> filter_var($_POST['post_from'],FILTER_SANITIZE_STRING),'posts_per_page'=> filter_var($pagination,FILTER_SANITIZE_STRING)); … … 114 118 'post_type' => filter_var($_POST['post_to'],FILTER_SANITIZE_STRING), 115 119 ); 116 $post_id=wp_update_post( $my_post , $wp_error);120 $post_id=wp_update_post( $my_post , true); 117 121 } 118 122 … … 121 125 } 122 126 add_action('init', 'CPMV_convert_post'); 123 124 125 ?> -
copy-move-posts/trunk/readme.txt
r2380329 r2724113 1 1 === Copy Move Posts === 2 2 Contributors: ujjavaljani 3 Tags: Copy posts, Move posts,posts Meta data,posts Thumbnails,posts custom fields,downloads,custom posts,copy move posts,bulk copy,bulk move, duplicate posts, move posts, transfer posts3 Tags: Copy posts, Move posts, posts Meta data,posts Thumbnails,posts custom fields,downloads,custom posts,copy move posts,bulk copy,bulk move, duplicate posts, move posts, transfer posts 4 4 Requires at least: 3.9 5 Tested up to: 5. 5.16 Stable tag: 1. 55 Tested up to: 5.9.3 6 Stable tag: 1.6 7 7 License: GPLv3 8 8 … … 39 39 40 40 == Changelog == 41 = 1.6 - 15/05/22 = 42 * Check WordPress version compatibility. 43 * New - Custom post type listing changes, only showinf public posts. 41 44 = 1.5 - 13/09/20 = 42 45 * Check WordPress version compatibility.
Note: See TracChangeset
for help on using the changeset viewer.