public function check_template( $template,
$request ) { if ( !
$template ) { return true;
} if ( $request['id'
] ) { $post =
get_post( $request['id'
] );
$current_template =
get_page_template_slug( $request['id'
] );
} else { $post = null;
$current_template = '';
} // Always allow for updating a post to the same template, even if that template is no longer supported.
if ( $template ===
$current_template ) { return true;
} // If this is a create request, get_post() will return null and wp theme will fallback to the passed post type.