Created
August 24, 2020 15:56
-
-
Save jcasabona/3f7406e1813543eea595d4e24cd3ea28 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
function convert_fm_to_acf() { | |
$args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'post', | |
); | |
$the_query = new WP_Query( $args ); | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
$old_t = get_post_meta( get_the_ID(), 'wpp_episode_transcript', true ); | |
$old_s = get_post_meta( get_the_ID(), 'wpp_episode_sponsor', true ); | |
update_field( 'hibi_episode_sponsor', $old_s, get_the_ID() ); | |
update_field( 'hibi_transcript', $old_t, get_the_ID() ); | |
} | |
wp_reset_postdata(); | |
} | |
add_action( 'admin_init', 'convert_fm_to_acf' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment