Last active
August 29, 2015 14:01
-
-
Save westonruter/81bdfd4f7878807b0492 to your computer and use it in GitHub Desktop.
Hacky. Past this into a WP-CLI shell, for example, to grab an export of postmeta to paste into Debug Bar Console on another server.
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 | |
$source_post_id = 123; | |
$dest_post_id = 456; | |
foreach( get_post_custom( $source_post_id ) as $key => $values ) { $value = array_shift( $values ); printf( 'update_post_meta( %d, %s, %s );' . PHP_EOL, var_export( $dest_post_id, true ), var_export( $key, true ), var_export( $value, true ) ); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment