Created
June 12, 2019 15:16
-
-
Save Garconis/43efc386e53ff6c735f8dcd763fec031 to your computer and use it in GitHub Desktop.
Impreza | Help update theme meta data to certain post types (only run once)
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 | |
$local_args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'fs_local', | |
); | |
$local_posts_array = get_posts( $local_args ); | |
foreach ( $local_posts_array as $post ) { | |
update_post_meta( $post->ID, 'us_header_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_titlebar_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_sidebar_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_footer_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_content_id', '__defaults__' ); | |
} | |
$focus_args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'fs_focus', | |
); | |
$focus_posts_array = get_posts( $focus_args ); | |
foreach ( $focus_posts_array as $post ) { | |
update_post_meta( $post->ID, 'us_header_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_titlebar_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_sidebar_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_footer_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_content_id', '__defaults__' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment