Unregisters a template.
Parameters
$template_namestringrequired- Template name including namespace.
Source
public function unregister( $template_name ) {
if ( ! $this->is_registered( $template_name ) ) {
/* translators: %s: Template name. */
$error_message = sprintf( __( 'Template "%s" is not registered.' ), $template_name );
_doing_it_wrong( __METHOD__, $error_message, '6.7.0' );
return new WP_Error( 'template_not_registered', $error_message );
}
$unregistered_template = $this->registered_templates[ $template_name ];
unset( $this->registered_templates[ $template_name ] );
return $unregistered_template;
}
Changelog
| Version | Description |
|---|---|
| 6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.