Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / plugins
diff options
context:
space:
mode:
Commit586d0d23dd5dbd9bc906544eb7b8aeabe643cee5 (patch)
Author
 pgmatev <petargabriel.matev@gmail.com>
2020-07-03 15:47:50 +0300
Committer
 pgmatev <petargabriel.matev@gmail.com>
2020-07-03 15:47:50 +0300
Filesa4e9689a601ead4ce1bb9fd453883427cc448c9d /wp-content/plugins
tues-interns-2020-586d0d23dd5dbd9bc906544eb7b8aeabe643cee5.tar
tues-interns-2020-586d0d23dd5dbd9bc906544eb7b8aeabe643cee5.tar.gz
tues-interns-2020-586d0d23dd5dbd9bc906544eb7b8aeabe643cee5.zip
Parent14e3084de010fc5a03552e57b7bb2d468ac345a3 (diff)
Changed Types to Categories; Added Non-hierarchical Types
diff --git a/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php b/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
index 22293ec..45f07ac 100644
--- a/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
+++ b/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
@@ -7,23 +7,23 @@ class TaxonomiesHierarchical {
}
public function labels() {
$arr = array (
- 'name' => _x( 'Types', 'taxonomy general name' ),
- 'singular_name' => _x( 'Type', 'taxonomy singular name' ),
- 'search_items' => __( 'Search Types', 'textdomain' ),
- 'all_items' => __( 'All Types', 'textdomain' ),
- 'parent_item' => __( 'Parent Type', 'textdomain' ),
- 'parent_item_colon' => __( 'Parent Type:', 'textdomain' ),
- 'edit_item' => __( 'Edit Type' ),
- 'update_item' => __( 'Update Type' ),
- 'add_new_item' => __( 'Add New Type' ),
- 'new_item_name' => __( 'New Type Name' ),
- 'menu_name' => __( 'Types' ),
+ 'name' => _x( 'Categories', 'taxonomy general name' ),
+ 'singular_name' => _x( 'Category', 'taxonomy singular name' ),
+ 'search_items' => __( 'Search Category', 'textdomain' ),
+ 'all_items' => __( 'All Category', 'textdomain' ),
+ 'parent_item' => __( 'Parent Category', 'textdomain' ),
+ 'parent_item_colon' => __( 'Parent Category:', 'textdomain' ),
+ 'edit_item' => __( 'Edit Category' ),
+ 'update_item' => __( 'Update Category' ),
+ 'add_new_item' => __( 'Add New Category' ),
+ 'new_item_name' => __( 'New Category Name' ),
+ 'menu_name' => __( 'Category' ),
);
return $arr;
}
public function tax_create(){
- register_taxonomy( 'vehicle-type', 'vehicles', array(
+ register_taxonomy( 'vehicle-category', 'vehicles', array(
'hierarchical' => true,
'labels' => $this->labels(),
'show_ui' => true,
@@ -31,7 +31,7 @@ class TaxonomiesHierarchical {
'show_in_rest' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
- 'rewrite' => array( 'slug' => 'vehicle-type' ),
+ 'rewrite' => array( 'slug' => 'vehicle-category' ),
)
);
}
diff --git a/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php b/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php
index d851422..901a0bd 100644
--- a/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php
+++ b/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php
@@ -5,6 +5,7 @@ class Taxonomies {
function init() {
add_action( 'init', array( $this, 'tax_create' ) , 999 );
}
+
public function labels($name) {
$arr = array (
'name' => _x( $name.'s', 'taxonomy general name' ),
@@ -67,15 +68,16 @@ class Taxonomies {
'rewrite' => array( 'slug' => 'fuel' ),
)
);
- // register_taxonomy( 'type', 'vehicles', array(
- // 'hierarchical' => false,
- // 'labels' => $this->labels(),
- // 'show_ui' => true,
- // 'show_admin_column' => true,
- // 'update_count_callback' => '_update_post_term_count',
- // 'query_var' => true,
- // 'rewrite' => array( 'slug' => 'type' ),
- // )
- // )
+ register_taxonomy( 'car-type', 'vehicles', array(
+ 'hierarchical' => false,
+ 'labels' => $this->labels('Type'),
+ 'show_ui' => true,
+ 'show_admin_column' => true,
+ 'show_in_rest' => true,
+ 'update_count_callback' => '_update_post_term_count',
+ 'query_var' => true,
+ 'rewrite' => array( 'slug' => 'car-type' ),
+ )
+ );
}
} \ No newline at end of file