Changeset 2118766
- Timestamp:
- 07/06/2019 11:13:25 PM (7 years ago)
- Location:
- content-repeater/trunk
- Files:
-
- 3 edited
-
content-repeater.php (modified) (1 diff)
-
includes/rename-fields.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
content-repeater/trunk/content-repeater.php
r2118761 r2118766 3 3 * Plugin Name: Content Repeater 4 4 * Description: Quickly set up custom content like Testimonials, Coupons, Products, Flipboxes, Portals, Portfolios, Before & Afters, etc. and display it in interesting ways: Ajax Reload, Masonry, Isotope, Slick Slider, Single Row. 5 * Version: 1.0.1 65 * Version: 1.0.17 6 6 * Author: Denis Buka 7 7 * Text Domain: content-repeater -
content-repeater/trunk/includes/rename-fields.php
r2045559 r2118766 58 58 // print_r($the_posts); 59 59 foreach($posts as $k=>$v) { 60 if(!metadata_exists('post', $v->ID, $_POST['cr-rename-to'])) { 61 add_post_meta($v->ID, sanitize_text_field($_POST['cr-rename-to']), $v->post_content); 62 } 60 // if(!metadata_exists('post', $v->ID, $_POST['cr-rename-to'])) { 61 update_post_meta($v->ID, sanitize_text_field($_POST['cr-rename-to']), $v->post_content); 62 $my_post = array(); 63 $my_post['ID'] = $v->ID; 64 $my_post['post_content'] = ''; 65 wp_update_post( wp_slash($my_post) ); 66 // } 67 } 68 $results = count($posts); 69 } elseif($_POST['cr-rename-to'] == 'post_content') { 70 $posts = get_posts(array( 71 'post_type' => $_POST['cr-rename-type'], 72 'posts_per_page' => -1 73 )); 74 // print_r($the_posts); 75 foreach($posts as $k=>$v) { 76 $my_post = array(); 77 $my_post['ID'] = $v->ID; 78 $my_post['post_content'] = get_post_meta( $v->ID, $_POST['cr-rename-from'], true ); 79 wp_update_post( wp_slash($my_post) ); 80 delete_post_meta( $v->ID, $_POST['cr-rename-from'] ); 63 81 } 64 82 $results = count($posts); -
content-repeater/trunk/readme.txt
r2118761 r2118766 106 106 = 1.0.16 = 107 107 add 'post_content' field 108 = 1.0.17 = 109 field renaming to 'post_content'
Note: See TracChangeset
for help on using the changeset viewer.