ar WP $wp */
global $wp;
// Non-publicly queryable taxonomies should not register query vars, except in the admin.
if ( false !== $this->query_var && $wp ) {
$wp->add_query_var( $this->query_var );
}
if ( false !== $this->rewrite && ( is_admin() || get_option( 'permalink_structure' ) ) ) {
if ( $this->hierarchical && $this->rewrite['hierarchical'] ) {
$tag = '(.+?)';
} else {
$tag = '([^/]+)';
}
add_rewrite_tag( "%$this->name%", $tag, $this->query_var ? "{$this->query_var}=" : "taxonomy=$this->name&term=" );
add_permastruct( $this->name, "{$this->rewrite['slug']}/%$this->name%", $this->rewrite );
}
}
/**
* Removes any rewrite rules, permastructs, and rules for the taxonomy.
*
* @since 4.7.0
*
* @global WP $wp Current WordPress environment instance.
*/
public function remove_rewrite_rules() {
/* @var WP $wp */
global $wp;
// Remove query var.
if ( false !== $this->query_var ) {
$wp->remove_query_var( $this->query_var );
}
// Remove rewrite tags and permastructs.
if ( false !== $this->rewrite ) {
remove_rewrite_tag( "%$this->name%" );
remove_permastruct( $this->name );
}
}
/**
* Registers the ajax callback for the meta box.
*
* @since 4.7.0
*/
public function add_hooks() {
add_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' );
}
/**
* Removes the ajax callback for the meta box.
*
* @since 4.7.0
*/
public function remove_hooks() {
remove_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' );
}
/**
* Gets the REST API controller for this taxonomy.
*
* Will only instantiate the controller class once per request.
*
* @since 5.5.0
*
* @return WP_REST_Controller|null The controller instance, or null if the taxonomy
* is set not to show in rest.
*/
public function get_rest_controller() {
if ( ! $this->show_in_rest ) {
return null;
}
$class = $this->rest_controller_class ? $this->rest_controller_class : WP_REST_Terms_Controller::class;
if ( ! class_exists( $class ) ) {
return null;
}
if ( ! is_subclass_of( $class, WP_REST_Controller::class ) ) {
return null;
}
if ( ! $this->rest_controller ) {
$this->rest_controller = new $class( $this->name );
}
if ( ! ( $this->rest_controller instanceof $class ) ) {
return null;
}
return $this->rest_controller;
}
/**
* Returns the default labels for taxonomies.
*
* @since 6.0.0
*
* @return (string|null)[][] The default labels for taxonomies.
*/
public static function get_default_labels() {
if ( ! empty( self::$default_labels ) ) {
return self::$default_labels;
}
$name_field_description = __( 'The name is how it appears on your site.' );
$slug_field_description = __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' );
$parent_field_description = __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' );
$desc_field_description = __( 'The description is not prominent by default; however, some themes may show it.' );
self::$default_labels = array(
'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ),
'popular_items' => array( __( 'Popular Tags' ), null ),
'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ),
'parent_item' => array( null, __( 'Parent Category' ) ),
'parent_item_colon' => array( null, __( 'Parent Category:' ) ),
'name_field_description' => array( $name_field_description, $name_field_description ),
'slug_field_description' => array( $slug_field_description, $slug_field_description ),
'parent_field_description' => array( null, $parent_field_description ),
'desc_field_description' => array( $desc_field_description, $desc_field_description ),
'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ),
'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ),
'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ),
'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ),
'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ),
'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ),
'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ),
'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ),
'filter_by_item' => array( null, __( 'Filter by category' ) ),
'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ),
'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ),
/* translators: Tab heading when selecting from the most used terms. */
'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ),
'back_to_items' => array( __( '← Go to Tags' ), __( '← Go to Categories' ) ),
'item_link' => array(
_x( 'Tag Link', 'navigation link block title' ),
_x( 'Category Link', 'navigation link block title' ),
),
'item_link_description' => array(
_x( 'A link to a tag.', 'navigation link block description' ),
_x( 'A link to a category.', 'navigation link block description' ),
),
);
return self::$default_labels;
}
/**
* Resets the cache for the default labels.
*
* @since 6.0.0
*/
public static function reset_default_labels() {
self::$default_labels = array();
}
}
Fatal error: Uncaught Error: Class 'WP_Taxonomy' not found in /var/www/html/orthoservice.com.br/web/wp-includes/taxonomy.php:28
Stack trace:
#0 /var/www/html/orthoservice.com.br/web/wp-settings.php(499): create_initial_taxonomies()
#1 /var/www/html/orthoservice.com.br/web/wp-config.php(115): require_once('/var/www/html/o...')
#2 /var/www/html/orthoservice.com.br/web/wp-load.php(50): require_once('/var/www/html/o...')
#3 /var/www/html/orthoservice.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/o...')
#4 /var/www/html/orthoservice.com.br/web/index.php(17): require('/var/www/html/o...')
#5 {main}
thrown in /var/www/html/orthoservice.com.br/web/wp-includes/taxonomy.php on line 28