'page', 'meta_query' => array( array( 'key' => '_wp_page_template', 'value' => 'default', 'compare' => '!=' ) ) ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); $meta_value = get_post_meta( get_the_ID(), '_wp_page_template', true ); $page_templates_dir = 'page-templates/'; $conatins = strpos( $meta_value, $page_templates_dir ); if ( false !== $conatins ) { $meta_value = basename( $meta_value ); update_post_meta( get_the_ID(), '_wp_page_template', $meta_value ); } } } } add_action( 'after_switch_theme', 'responsive_update_page_template_meta' ); /** * Responsive 2.0 update check * * Queries WordPress.org API to get details on responsive theme where we can get the current version number * * @return bool */ function responsive_theme_query() { $themes = get_theme_updates(); $new_version = false; foreach ( $themes as $stylesheet => $theme ) { if ( 'responsive' == $stylesheet ) { $new_version = $theme->update['new_version']; } } // Check if we had a response and compare the current version on wp.org to version 2. If it is version 2 or greater display a message if ( $new_version && version_compare( $new_version, '2', '>=' ) ) { return true; } return false; }