Created
October 10, 2016 02:28
-
-
Save d0ky/cd3c5183339210379d1987006db9f9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo'<pre>'; | |
// Include the wp-load'er | |
include('wp-load.php'); | |
$query = new WP_Query( array( 'post_type' => 'portfolio_page', 'posts_per_page' => '-1' ) ); | |
while ($query->have_posts()) : $query->the_post(); | |
$ids=""; | |
$ids = get_post_meta($post->ID, 'qode_portfolio-image-gallery'); | |
//print_R( $ids ); | |
if ($ids[0]!='') { | |
$my_post = array( | |
'ID' => $post->ID, | |
'post_content' => $post->post_content." [gallery ids=\"".$ids[0]."\"]" | |
); | |
// Update the post into the database | |
wp_update_post( $my_post ); | |
echo 'update product ID '.$post->ID; | |
} | |
endwhile; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment