ID, '_wp_page_template', true ); $page_templates = wp_get_theme()->get_page_templates(); // If the template doesn't exists, remove the data to allow WordPress to save if ( ! isset( $page_templates[ $template ] ) ) { delete_post_meta( $post->ID, '_wp_page_template' ); } } /** * Register wpml compatibility hooks */ public function register_wpml_hooks() { if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { new RWMB_WPML; } } }