Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / plugins
diff options
context:
space:
mode:
Commit31837d2a233f3a2f838adac3af8687df10d69a69 (patch)
Author
 edocev <emil.docev2000@gmail.com>
2020-07-02 18:40:03 +0300
Committer
 GitHub <noreply@github.com>
2020-07-02 18:40:03 +0300
Filesea582b59cb08f69df0e4c55c065f2ea11dc56a86 /wp-content/plugins
tues-interns-2020-31837d2a233f3a2f838adac3af8687df10d69a69.tar
tues-interns-2020-31837d2a233f3a2f838adac3af8687df10d69a69.tar.gz
tues-interns-2020-31837d2a233f3a2f838adac3af8687df10d69a69.zip
Parent012e99ce9a6f03b6e9069f1fe00d45a37c7a9714 (diff)
Parent64360a10b9c5fc6e67234e1f431381a4e63025d6 (diff)
Merge pull request #50 from DevriX/feature-cars-cpt
Feature Cars CPT
2 files changed, 37 insertions, 0 deletions
-rw-r--r--wp-content/plugins/dx-cars/class.cpt.php23
-rw-r--r--wp-content/plugins/dx-cars/dx-cars.php14
diff --git a/wp-content/plugins/dx-cars/class.cpt.php b/wp-content/plugins/dx-cars/class.cpt.php
new file mode 100644
index 0000000..0d0b4ab
--- /dev/null
+++ b/wp-content/plugins/dx-cars/class.cpt.php
@@ -0,0 +1,23 @@
+<?php
+class Vehicles {
+ function init() {
+ add_action( 'init', array( $this, 'cpt_create' ) );
+ }
+
+ public function labels() {
+ $arr = array(
+ 'labels' => array(
+ 'name' => __( 'Vehicles' ),
+ 'singular_name' => __( 'Vechicle' )
+ ),
+ 'public' => true,
+ 'has_archive' => true,
+ 'rewrite' => array( 'slug' => 'vechicles' ),
+ 'show_in_rest' => true, );
+ return $arr;
+ }
+
+ function cpt_create() {
+ register_post_type( 'vechicles', $this->labels() );
+ }
+}
diff --git a/wp-content/plugins/dx-cars/dx-cars.php b/wp-content/plugins/dx-cars/dx-cars.php
new file mode 100644
index 0000000..90cc6ec
--- /dev/null
+++ b/wp-content/plugins/dx-cars/dx-cars.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Plugin Name: DX Cars
+ * Plugin URI: https://devrix.com
+ * Description: Plugin for handling cars
+ * Version: 0.1
+ * Author: DevriX-interns-2020
+ * Author URI: https://devrix.com
+ * Text Domain: dx-cars
+ */
+ include 'class.cpt.php';
+
+ $cars = new Vehicles;
+ $cars->init();