Unregisters a template.
Parameters
$template_name
stringrequired- Template name including namespace.
Source
public function unregister( $template_name ) {
if ( ! $this->is_registered( $template_name ) ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Template name. */
sprintf( __( 'Template "%s" is not registered.' ), $template_name ),
'6.7.0'
);
/* translators: %s: Template name. */
return new WP_Error( 'template_not_registered', __( 'Template "%s" is not registered.' ) );
}
$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.