Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / plugins
diff options
context:
space:
mode:
Commitd8295fa518a976e5491eb77a61676e33cfcabb7c (patch)
Author
 pgmatev <petargabriel.matev@gmail.com>
2020-07-03 17:31:45 +0300
Committer
 pgmatev <petargabriel.matev@gmail.com>
2020-07-03 17:31:45 +0300
Files9f20c16b1f8e43cfa6d38ee61dd53fdd113e15c9 /wp-content/plugins
tues-interns-2020-d8295fa518a976e5491eb77a61676e33cfcabb7c.tar
tues-interns-2020-d8295fa518a976e5491eb77a61676e33cfcabb7c.tar.gz
tues-interns-2020-d8295fa518a976e5491eb77a61676e33cfcabb7c.zip
Parent586d0d23dd5dbd9bc906544eb7b8aeabe643cee5 (diff)
Created class for Custom Metaboxes
diff --git a/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php b/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
index 45f07ac..6ad44aa 100644
--- a/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
+++ b/wp-content/plugins/dx-cars/class.taxonomies.hierarchical.php
@@ -22,6 +22,23 @@ class TaxonomiesHierarchical {
return $arr;
}
+ public function labels_types() {
+ $arr = array (
+ 'name' => _x( 'Types', 'taxonomy general name' ),
+ 'singular_name' => _x( 'Type', 'taxonomy singular name' ),
+ 'search_items' => __( 'Search Type', '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' => __( 'Type' ),
+ );
+ return $arr;
+ }
+
public function tax_create(){
register_taxonomy( 'vehicle-category', 'vehicles', array(
'hierarchical' => true,
@@ -34,5 +51,16 @@ class TaxonomiesHierarchical {
'rewrite' => array( 'slug' => 'vehicle-category' ),
)
);
+ register_taxonomy( 'car-type', 'vehicles', array(
+ 'hierarchical' => true,
+ 'labels' => $this->labels_types(),
+ '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
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 901a0bd..bcb24f5 100644
--- a/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php
+++ b/wp-content/plugins/dx-cars/class.taxonomies.non-hierarchical.php
@@ -68,16 +68,5 @@ class Taxonomies {
'rewrite' => array( 'slug' => 'fuel' ),
)
);
- 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
diff --git a/wp-content/plugins/dx-users/class.cm.php b/wp-content/plugins/dx-users/class.cm.php
new file mode 100644
index 0000000..df2e61a
--- /dev/null
+++ b/wp-content/plugins/dx-users/class.cm.php
@@ -0,0 +1,15 @@
+<?php
+class Users {
+ function init() {
+ add_action( 'add_meta_boxes', array( $this, 'add_custom_box_user' ) );
+ }
+ function add_custom_box_user() {
+ $screen = 'user';
+ add_meta_box(
+ 'wporg_box_id', // Unique ID
+ 'Phone Number', // Box title
+ 'wporg_custom_box_html', // Content callback, must be of type callable
+ $screen // Post type
+ );
+ }
+}
diff --git a/wp-content/plugins/dx-users/dx-users.php b/wp-content/plugins/dx-users/dx-users.php
new file mode 100644
index 0000000..a16ab0f
--- /dev/null
+++ b/wp-content/plugins/dx-users/dx-users.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Plugin Name: DX Users
+ * Plugin URI: https://devrix.com
+ * Description: Plugin for custom user metaboxes
+ * Version: 0.1
+ * Author: DevriX-interns-2020
+ * Author URI: https://devrix.com
+ * Text Domain: dx-users
+ */
+
+defined( 'ABSPATH' ) or die( 'No script kiddies please!' );